:root {
    --navy: #1b3a57;
    --navy-dark: #122840;
    --gold: #c9a227;
    --gold-dark: #a8871f;
    --gold-glow: rgba(201, 162, 39, 0.15);
    --mist: #768390;
    --snow: #f0f3f6;
    --white: #ffffff;
    --border-color: rgba(27, 58, 87, 0.16);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --heading: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Barlow", sans-serif;
    --success: #1f8f5f;
    --error: #b2352a;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.consultation-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--white);
    color: var(--navy);
    font-family: var(--body);
}

button,
input,
textarea {
    font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(201, 162, 39, 0.42);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.7rem 0.9rem;
    color: var(--white);
    background: var(--navy-dark);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.consultation-nav {
    display: flex;
    min-height: 6.7rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid var(--gold);
    background: var(--navy-dark);
}

.consultation-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.consultation-logo picture,
.consultation-logo img {
    display: block;
}

.consultation-logo img {
    width: auto;
    height: clamp(3.25rem, 5vw, 4.5rem);
}

.page-shell {
    width: 100%;
    max-width: 1120px;
    flex: 1;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.card {
    min-height: 19rem;
    padding: clamp(1.35rem, 4vw, 2rem);
    border-radius: 16px;
    background: var(--white);
    box-shadow:
        inset 2px 0 0 var(--navy),
        inset -2px 0 0 var(--navy),
        inset 0 2px 0 var(--navy),
        inset 0 -2px 0 var(--navy),
        var(--shadow-md);
}

.progress {
    display: flex;
    min-height: 0.75rem;
    justify-content: center;
    gap: 0.6rem;
    margin: 0 0 1.15rem;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(27, 58, 87, 0.28);
    border-radius: 999px;
    background: rgba(27, 58, 87, 0.18);
}

.progress-dot.is-complete,
.progress-dot.is-active {
    border-color: var(--gold);
    background: var(--gold);
}

.progress-dot.is-active {
    box-shadow: 0 0 0 4px var(--gold-glow);
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: consultation-step-in 0.25s ease-out;
}

.step[hidden] {
    display: none;
}

@keyframes consultation-step-in {
    from {
        opacity: 0;
        transform: translateX(14px);
    }

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

.question-title {
    display: flex;
    margin: 0 0 0.65rem;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    color: var(--navy);
    font-family: var(--heading);
    font-size: clamp(1.55rem, 3vw, 1.95rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    text-align: center;
}

.question-title::before {
    width: 72px;
    height: 52px;
    display: block;
    border-bottom: 3px solid var(--gold);
    background: url("/icons/consultation-rocket.svg") center 0 / 34px 34px no-repeat;
    content: "";
}

.question-subtitle {
    max-width: 44rem;
    margin: 0 auto 0.75rem;
    color: var(--mist);
    font-size: 0.92rem;
    line-height: 1.55;
    text-align: center;
}

.selection-type {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--gold-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.consultation-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.consultation-option {
    width: 100%;
    appearance: none;
    padding: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--navy);
    cursor: pointer;
    text-align: left;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.consultation-option:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 24px rgba(18, 40, 64, 0.08);
    transform: translateY(-1px);
}

.consultation-option.is-selected {
    border-color: var(--navy-dark);
    background: linear-gradient(180deg, var(--navy-dark), var(--navy));
    color: var(--white);
    box-shadow: 0 12px 28px rgba(18, 40, 64, 0.16);
}

.choice-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.choice-icon-wrap {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gold-glow);
    color: var(--gold-dark);
}

.choice-icon {
    width: 1.45rem;
    height: 1.45rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.questionnaire-option .choice-icon {
    fill: currentColor;
    stroke: none;
}

.choice-copy {
    min-width: 0;
    flex: 1;
}

.consultation-option-title,
.consultation-option-meta,
.consultation-option-description {
    display: block;
}

.consultation-option-title {
    font-family: var(--heading);
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-weight: 800;
    line-height: 1.1;
}

.consultation-option-meta {
    margin-top: 0.28rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.consultation-option-description {
    margin-top: 0.55rem;
    color: inherit;
    font-size: 0.88rem;
    line-height: 1.48;
    opacity: 0.8;
}

.consultation-option.is-selected .choice-icon-wrap {
    background: rgba(255, 255, 255, 0.14);
    color: var(--gold);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.form-grid__full {
    grid-column: 1 / -1;
}

#addressField[hidden] {
    display: none;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.45rem;
}

.field label {
    color: var(--mist);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    min-height: 3rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--snow);
    color: var(--navy);
    font-size: 1rem;
}

.field textarea {
    line-height: 1.55;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--gold);
    outline: 0;
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.situation-field {
    margin-top: 1rem;
}

.field-help {
    margin: 0;
    color: var(--mist);
    font-size: 0.85rem;
    line-height: 1.5;
}

.schedule-controls {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.schedule-controls .field {
    width: min(100%, 19rem);
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.slot-button {
    min-height: 3rem;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--snow);
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
}

.slot-button:hover,
.slot-button.is-selected {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold);
}

.slot-button.is-selected {
    background: var(--navy);
    color: var(--white);
}

.summary-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--snow);
}

.consultation-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(27, 58, 87, 0.1);
}

.consultation-summary > div:last-child {
    padding-top: 0.8rem;
    border-bottom: 0;
    color: var(--navy);
    font-size: 1.08rem;
}

.consultation-summary span {
    color: var(--mist);
}

.consultation-summary strong {
    text-align: right;
}

.hold-timer {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 10px;
    background: #fff8df;
    text-align: center;
    font-weight: 800;
}

.terms-button {
    display: flex;
    margin: 0 auto 0.75rem;
}

.terms-acceptance {
    display: flex;
    max-width: 38rem;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 auto;
    line-height: 1.5;
}

.terms-acceptance input {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
}

.flow-status {
    min-height: 1.5rem;
    margin: 0.9rem 0 0;
    color: var(--error);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.flow-status:empty {
    min-height: 0;
    margin: 0;
}

.flow-status--global {
    margin-bottom: 0.75rem;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    min-height: 3.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--white);
}

.btn-primary:hover {
    border-color: var(--gold-dark);
    background: var(--gold-dark);
}

.btn-secondary {
    border-color: var(--navy);
    background: transparent;
    color: var(--navy);
}

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

.consultation-terms-dialog {
    width: min(calc(100% - 2rem), 52rem);
    max-height: 86vh;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 14px;
    color: var(--navy);
}

.consultation-terms-dialog::backdrop {
    background: rgba(5, 15, 24, 0.78);
}

.dialog-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--navy-dark);
    color: var(--white);
}

.dialog-header h2 {
    margin: 0;
    font-family: var(--heading);
}

.dialog-header button {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
}

#termsContent {
    padding: 1.5rem;
    line-height: 1.6;
}

.consultation-terms-dialog > .btn {
    display: flex;
    width: min(calc(100% - 3rem), 24rem);
    margin: 0 auto 1.5rem;
}

.success-state {
    padding: 1rem;
    text-align: center;
}

.success-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--success);
}

.success-icon::before {
    color: var(--white);
    content: "\2713";
    font-size: 2.2rem;
    font-weight: 800;
}

.step-title {
    margin: 0 0 0.75rem;
    font-family: var(--heading);
    font-size: 1.75rem;
}

.success-state p {
    color: var(--mist);
    line-height: 1.6;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    color: var(--mist);
    font-size: 0.85rem;
    text-align: center;
}

.footer a {
    color: inherit;
}

@media (max-width: 700px) {
    .consultation-nav {
        min-height: 5.5rem;
        padding: 0.75rem 1rem;
    }

    .page-shell {
        padding: 1.25rem 0.75rem 2rem;
    }

    .card {
        padding: 1.25rem;
    }

    .consultation-options,
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-grid__full {
        grid-column: auto;
    }

    .schedule-controls,
    .nav-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-buttons {
        flex-direction: column-reverse;
    }

    .nav-buttons .btn,
    .schedule-controls .btn,
    .schedule-controls .field {
        width: 100%;
    }

    .slot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .consultation-summary > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .consultation-summary strong {
        text-align: left;
    }

    .footer {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .step.active {
        animation: none;
    }
}
