
:root {
    --bg-page: #f3f4f6;
    --bg-shell: #ffffff;
    --border-soft: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #2563eb;
    --primary-soft: #eff6ff;
    --primary-strong: #1d4ed8;
    --accent: #22c55e;
    --error: #ef4444;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --shadow-soft: 0 14px 35px rgba(15,23,42,.08);
    --shadow-strong: 0 18px 45px rgba(15,23,42,.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 55%), radial-gradient(circle at bottom right, rgba(16,185,129,.08), transparent 55%), var(--bg-page);
    color: var(--text-main);
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: linear-gradient(120deg,#0f172a,#1e293b);
    color: #e5e7eb;
    border-bottom: 1px solid rgba(148,163,184,.5);
}

.header-gradient {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 18px 20px;
}

.header-inner {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 16px;
    align-items: center;
}

.logo-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148,163,184,.7);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: linear-gradient(135deg,rgba(15,23,42,.25),rgba(15,23,42,.7));
}

.header-title {
    text-align: center;
}

.header-kicker {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.header-title h1 {
    font-size: clamp(1.25rem,2.4vw,1.7rem);
    font-weight: 600;
    color: #f9fafb;
}

.survey-shell {
    max-width: 900px;
    width: 100%;
    margin: 26px auto 40px;
    padding: 22px 20px 24px;
    background: var(--bg-shell);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.section-header {
    margin-bottom: 4px;
}

.section-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.section-header-subtitle {
    font-size: .9rem;
    color: var(--text-muted);
}

.question-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    padding: 12px 14px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

    .question-card:hover {
        box-shadow: 0 6px 18px rgba(15,23,42,.06);
        transform: translateY(-1px);
    }

    .question-card.error {
        border-color: var(--error);
        box-shadow: 0 0 0 1px rgba(239,68,68,.4);
    }

.question-title-row {
    display: flex;
    gap: 8px;
}

.question-number {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.question-label-text {
    font-size: .95rem;
    font-weight: 500;
}
/* controls */
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: .9rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    input[type="text"]:focus,
    input[type="number"]:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 1px rgba(37,99,235,.25);
    }

textarea {
    min-height: 70px;
}

.choice-options,
.scale-options,
.yesno-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.choice-option,
.scale-option,
.yesno-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .86rem;
    cursor: pointer;
}

    .choice-option input,
    .scale-option input,
    .yesno-option input {
        accent-color: var(--primary);
    }

.pending-questions {
    margin-top: 6px;
    font-size: .82rem;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 10px;
    padding: 6px 10px;
    border: 1px solid #fecaca;
}

.survey-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.btn {
    border: none;
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform .08s ease, box-shadow .12s ease, background .15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 7px 15px rgba(37,99,235,.25);
}

    .btn-primary:hover {
        background: var(--primary-strong);
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(37,99,235,.28);
    }

.btn:disabled {
    opacity: .55;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.thankyou-card {
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-soft);
    padding: 18px 16px;
    text-align: center;
    background: linear-gradient(135deg,#ecfdf5,#eff6ff);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

[hidden].modal-overlay {
    display: none !important;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 22px 18px;
    max-width: 360px;
    width: 90%;
    box-shadow: var(--shadow-strong);
    text-align: center;
}

.modal-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 700;
}
/* household */
.household-extra {
    margin-top: 10px;
    padding: 10px 10px 6px;
    border-radius: 10px;
    background: #e5f0ff;
    border: 1px dashed rgba(37,99,235,.35);
}

.household-extra-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 8px;
}

.household-persons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow: auto;
}

.household-person {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #dbe3ff;
}

.household-person-title {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d4ed8;
}

.household-person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
    gap: 6px 10px;
}
/* yes/no list extra */
.yesno-extra {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #eef2ff;
    border: 1px dashed rgba(79,70,229,.4);
}
/* inline other input */
.inline-text {
    max-width: 220px;
}

.dropdown-other-wrapper {
    margin-top: 6px;
    font-size: .85rem;
}

@media(max-width:768px) {
    .header-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .header-logo-left,
    .header-logo-right {
        display: none;
    }

    .survey-shell {
        margin: 18px auto 26px;
        padding: 18px 14px 20px;
    }

    .survey-footer {
        justify-content: center;
    }

    .btn {
        min-width: 120px;
    }
}


