* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    background: #0b1120;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 20% 30%, #0f172a, #030712);
}
.bg-glow::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.15), transparent 60%);
    animation: pulseGlow 8s infinite alternate;
}
@keyframes pulseGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

.app {
    position: relative;
    z-index: 2;
}

.screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.card {
    max-width: 1300px;
    width: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border-radius: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 45px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    padding: 2rem 2rem 2.5rem;
    transition: transform 0.2s ease;
}

h2 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f0f9ff, #b6e0ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

.sub {
    font-size: 1.1rem;
    color: #cbd5e6;
    border-left: 4px solid #38bdf8;
    padding-left: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.guide-text {
    background: rgba(0,0,0,0.4);
    border-radius: 1.5rem;
    padding: 0.8rem 1.2rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: #e2e8f0;
    border-left: 3px solid #facc15;
}
.warning-text {
    background: rgba(220,38,38,0.15);
    border-left-color: #dc2626;
    color: #fecaca;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.tag {
    background: rgba(30, 41, 59, 0.9);
    padding: 0.7rem 1.4rem;
    border-radius: 60px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.2);
}
.tag.level-high {
    background: #dc2626;
    color: white;
    border-color: #ff8a8a;
    box-shadow: 0 0 10px rgba(220,38,38,0.3);
}
.tag.level-medium {
    background: #facc15;
    color: #0f172a;
    border-color: #ffdf7e;
}
.tag.level-low {
    background: #22c55e;
    color: #0f172a;
    border-color: #86efac;
}
.tag.selected {
    background: #38bdf8;
    color: #0f172a;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(56,189,248,0.3);
}
.tag:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.two-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}
.col {
    flex: 1;
    min-width: 280px;
    background: rgba(0,0,0,0.3);
    border-radius: 2rem;
    padding: 1.5rem;
}
.col h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #facc15;
}

.dynamic-list {
    margin: 1rem 0;
}
.dynamic-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.dynamic-item input,
.dynamic-item select,
.dynamic-item textarea {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 2rem;
    padding: 0.6rem 1rem;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}
.dynamic-item input:focus,
.dynamic-item select:focus,
.dynamic-item textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.3);
}
.dynamic-item input {
    flex: 2;
    min-width: 120px;
}
.dynamic-item select {
    flex: 1;
    min-width: 100px;
}
.dynamic-item textarea {
    flex: 3;
    min-width: 180px;
    resize: vertical;
}
.dynamic-item button {
    background: rgba(220,38,38,0.6);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: white;
}
.add-btn {
    background: rgba(56,189,248,0.3);
    border: 1px dashed #38bdf8;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: #38bdf8;
    margin-top: 0.5rem;
}

.custom-input {
    margin: 1.5rem 0 1rem;
}
.custom-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cbd5e6;
}
.custom-input textarea, .custom-input input, .custom-input select {
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 1.5rem;
    padding: 0.8rem 1.2rem;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
.custom-input textarea:focus, .custom-input input:focus, .custom-input select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.3);
}
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.radio-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
button {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.8rem 2rem;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    color: #f1f5f9;
}
button.primary {
    background: #38bdf8;
    border: none;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(56,189,248,0.4);
}
button.primary:hover {
    background: #7dd3fc;
    transform: translateY(-3px);
}
button:hover:not(.primary) {
    background: rgba(71, 85, 105, 0.9);
}
button:disabled {
    opacity: 0.4;
    transform: none;
    cursor: not-allowed;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}
.step-dot {
    width: 12px;
    height: 12px;
    background: #334155;
    border-radius: 20px;
    transition: all 0.2s;
}
.step-dot.active {
    background: #38bdf8;
    width: 28px;
}
.step-dot.completed {
    background: #facc15;
}

.level-hint {
    background: rgba(0,0,0,0.6);
    border-radius: 2rem;
    padding: 0.6rem 1.2rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    border: 1px solid rgba(255,255,255,0.15);
}
.hint-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: 500;
}
.hint-badge {
    width: 20px;
    height: 20px;
    border-radius: 20px;
}
.hint-badge.red { background: #dc2626; }
.hint-badge.yellow { background: #facc15; }
.hint-badge.green { background: #22c55e; }
.hint-badge.gray { background: #334155; }

.result-box {
    background: rgba(0,0,0,0.5);
    border-radius: 2rem;
    padding: 1.8rem;
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 1rem;
    color: #e2e8f0;
    border: 1px solid rgba(56,189,248,0.3);
    max-height: 55vh;
    overflow-y: auto;
}
.result-box h1, .result-box h2, .result-box h3 {
    color: #facc15;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.result-box ul, .result-box ol {
    padding-left: 1.5rem;
}
.result-box code {
    background: #1e293b;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
}
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #38bdf8;
}
.error-box {
    background: rgba(220,38,38,0.2);
    border: 1px solid #dc2626;
    border-radius: 1.5rem;
    padding: 1rem;
    margin: 1rem 0;
}
footer {
    text-align: center;
    font-size: 0.7rem;
    margin-top: 1rem;
    color: #94a3b8;
}

@media (max-width: 750px) {
    .card { padding: 1.2rem; }
    h2 { font-size: 2rem; }
    .tag { font-size: 0.8rem; padding: 0.5rem 1rem; }
    .two-columns { flex-direction: column; }
    .dynamic-item { flex-direction: column; align-items: stretch; }
    .dynamic-item input, .dynamic-item select, .dynamic-item textarea { width: 100%; }
}