:root {
    --primary:        #1F497D;
    --primary-dark:   #163659;
    --primary-light:  #2E6FAD;
    --accent:         #DEEAF1;
    --accent-mid:     #B8D4E8;
    --accent-dark:    #8AB5D1;
    --text:           #1a2b3c;
    --text-muted:     #5a7185;
    --text-light:     #8fa8bc;
    --bg:             #ffffff;
    --bg-section:     #F5FAFD;
    --border:         #D8E9F4;
    --success:        #2E7D52;
    --success-bg:     #EBF7F0;
    --error:          #C0392B;
    --error-bg:       #FDF0EE;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow-sm:      0 2px 8px rgba(31,73,125,0.08);
    --shadow-md:      0 6px 24px rgba(31,73,125,0.12);
    --shadow-lg:      0 16px 48px rgba(31,73,125,0.15);
    --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font:           'Inter', 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
}

/* ─── Topbar ──────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(31,73,125,0.06);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.topbar-logo-mark {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.topbar-logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.topbar-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    background: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--accent-mid);
    white-space: nowrap;
}

/* ─── Progress Bar ────────────────────────────────────────────── */
.progress-bar-wrap {
    background: var(--accent);
    height: 3px;
    position: sticky;
    top: 64px;
    z-index: 99;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    transition: width 0.3s ease;
}

/* ─── Page Layout ─────────────────────────────────────────────── */
.page-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ─── Hero Header ─────────────────────────────────────────────── */
.survey-hero {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.survey-tag {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--accent-mid);
    margin-bottom: 20px;
}

.survey-hero h1 {
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.survey-hero p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 24px;
    line-height: 1.7;
}

.survey-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
}

.meta-icon {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* ─── Section Cards ───────────────────────────────────────────── */
.form-section {
    margin-bottom: 32px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.section-letter {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.section-head h2 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-head p {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    margin-top: 2px;
}

.section-body {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ─── Question ────────────────────────────────────────────────── */
.question { display: flex; flex-direction: column; gap: 12px; }

.question-label {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.q-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-light);
    background: var(--accent);
    border: 1px solid var(--accent-mid);
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 1px;
    flex-shrink: 0;
}

.q-required {
    color: var(--error);
    font-weight: 700;
    font-size: 0.85rem;
}

.question-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: -6px;
    font-style: italic;
}

/* ─── Text Inputs ─────────────────────────────────────────────── */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(31,73,125,0.1);
}

.form-input.error { border-color: var(--error); }
.form-input::placeholder { color: var(--text-light); }

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ─── Radio & Checkbox Options ────────────────────────────────── */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.option-item:hover {
    border-color: var(--accent-dark);
    background: var(--accent);
}

.option-item.selected {
    border-color: var(--primary);
    background: rgba(31, 73, 125, 0.05);
}

.option-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
    transition: var(--transition);
    background: #fff;
    position: relative;
    cursor: pointer;
}

.option-item input[type="checkbox"] { border-radius: 5px; }

.option-item input[type="radio"]:checked,
.option-item input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.option-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.option-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    color: #fff;
    font-weight: 800;
}

.option-label {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.4;
    flex: 1;
}

/* ─── Conditional Inputs ──────────────────────────────────────── */
.conditional-input {
    display: none;
    margin-top: 8px;
    padding: 14px 16px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-mid);
}

.conditional-input.visible { display: block; }

.conditional-input label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 7px;
}

/* ─── Max-select counter ──────────────────────────────────────── */
.max-select-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -4px;
}

.select-count {
    font-weight: 700;
    color: var(--primary);
}

/* ─── Validation ──────────────────────────────────────────────── */
.field-error {
    font-size: 0.8rem;
    color: var(--error);
    display: none;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.field-error.visible { display: flex; }

.form-section.has-error { border-color: rgba(192,57,43,0.3); }

/* ─── Submit Button ───────────────────────────────────────────── */
.submit-area {
    text-align: center;
    padding: 8px 0 0;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(31,73,125,0.35);
    position: relative;
    overflow: hidden;
    min-width: 220px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(31,73,125,0.45);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    40%, 100% { left: 160%; }
}

.submit-note {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ─── Loading Spinner ─────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ─── Thank You Screen ────────────────────────────────────────── */
.thank-you {
    display: none;
    text-align: center;
    padding: 60px 32px;
    animation: fadeInUp 0.6s ease forwards;
}

.thank-you.visible { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 2rem;
    box-shadow: 0 12px 32px rgba(31,73,125,0.3);
}

.thank-you h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.thank-you > p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 440px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.ty-cards {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.ty-card {
    padding: 16px 22px;
    background: var(--accent);
    border: 1px solid var(--accent-mid);
    border-radius: 12px;
    text-align: left;
    max-width: 200px;
}

.ty-card-icon { font-size: 1.3rem; margin-bottom: 8px; }
.ty-card strong { display: block; font-size: 0.85rem; color: var(--primary); margin-bottom: 4px; }
.ty-card p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid var(--primary);
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-back:hover { background: var(--accent); }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .topbar { padding: 0 20px; }
    .page-wrap { padding: 32px 16px 60px; }
    .section-body { padding: 20px 16px; }
    .section-head { padding: 18px 20px; }
    .input-row { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    .survey-hero h1 { font-size: 1.5rem; }
    .ty-cards { flex-direction: column; align-items: center; }
    .topbar-badge { display: none; }
}
