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

:root {
    --bg: #060d1a;
    --bg2: #0a1628;
    --bg3: #0f1f35;
    --accent: #3b82f6;
    --accent2: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.18);
    --border: rgba(59, 130, 246, 0.15);
    --border-hover: rgba(59, 130, 246, 0.4);
    --text: #f0f4ff;
    --text-muted: #6b84a8;
    --text-dim: #3a4f6e;
    --white: #ffffff;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 10px;
    --radius-lg: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
            radial-gradient(ellipse 60% 50% at 10% 20%, rgba(59,130,246,0.07) 0%, transparent 70%),
            radial-gradient(ellipse 40% 40% at 90% 80%, rgba(59,130,246,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
            linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: rgba(6, 13, 26, 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.nav-logo strong {
    color: var(--white);
    letter-spacing: 0.14em;
    font-size: 14px;
    font-weight: 900;
}

.nav-logo span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.nav-progress {
    width: 150px;
    height: 3px;
    background: var(--bg3);
    border-radius: 999px;
    overflow: hidden;
}

.nav-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

main {
    position: relative;
    z-index: 1;
    padding: 110px 1.5rem 80px;
    max-width: 740px;
    margin: 0 auto;
}

.header {
    margin-bottom: 2rem;
    animation: fadeUp 0.6s ease both;
}

.step-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 1.25rem;
}

.step-label::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}

.header h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 900;
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.header h1 span {
    color: var(--accent2);
}

.header p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 560px;
}

.loading-screen,
.invite-error {
    display: none;
    min-height: calc(100vh - 64px);
    padding: 6rem 2rem 4rem;
    align-items: center;
    justify-content: center;
}

.loading-screen.visible,
.invite-error.visible {
    display: flex;
}

.loading-card,
.invite-error-card {
    width: 100%;
    max-width: 520px;
    text-align: center;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    backdrop-filter: blur(12px);
}

.loading-card strong,
.invite-error-card h2 {
    display: block;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--white);
}

.loading-card p,
.invite-error-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 14px;
}

.invite-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
    font-size: 30px;
    font-weight: 900;
    margin: 0 auto 20px;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.invite-error-icon.warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.4);
}

.invite-error-icon.success {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.4);
}

.invite-error-help {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-dim);
}

#form-area {
    display: none;
}

#form-area.visible {
    display: block;
}

.form-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.form-error.visible {
    display: block;
}

.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.q-card {
    background: rgba(10, 22, 40, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: fadeUp 0.5s ease both;
}

.q-card:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.q-card.invalid {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

.q-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.q-num {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.q-type {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg3);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    letter-spacing: 0.04em;
}

.q-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.78rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
}

.opt:hover {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.35);
}

.opt input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.opt span {
    font-size: 14px;
    color: #9db4d4;
    cursor: pointer;
    line-height: 1.4;
}

.outro-wrap {
    display: none;
    margin-top: 8px;
}

.outro-wrap.visible {
    display: block;
}

.outro-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.outro-input:focus {
    border-color: var(--accent);
}

.outro-input::placeholder {
    color: var(--text-dim);
}

.scale-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.scale-btn {
    flex: 1;
    padding: 10px 4px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius);
    background: var(--bg3);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.15s;
    text-align: center;
}

.scale-btn:hover {
    border-color: var(--accent);
    color: var(--accent2);
    background: rgba(59, 130, 246, 0.08);
}

.scale-btn.sel {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.scale-labels span {
    font-size: 11px;
    color: var(--text-dim);
}

.q-textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
    resize: vertical;
    min-height: 120px;
    line-height: 1.7;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.q-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.q-textarea::placeholder {
    color: var(--text-dim);
}

.submit-area {
    margin-top: 1.5rem;
    animation: fadeUp 0.5s ease both;
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 1rem;
}

.success-screen {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeUp 0.6s ease both;
}

.success-screen.visible {
    display: block;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(34,197,94,0.12);
    border: 1.5px solid rgba(34,197,94,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--success);
    font-size: 34px;
    font-weight: 900;
}

.success-screen h2 {
    font-size: 28px;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.success-screen p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    main {
        padding: 88px 1rem 60px;
    }

    nav {
        padding: 0 1rem;
    }

    .nav-progress {
        width: 90px;
    }

    .nav-logo span {
        display: none;
    }

    .q-card {
        padding: 1.25rem 1.1rem;
    }

    .scale-btn {
        font-size: 13px;
        padding: 8px 2px;
    }
}
