﻿:root {
    --public-bg: #f3f8fb;
    --public-bg-2: #eef5f8;
    --public-surface: #ffffff;
    --public-surface-soft: #f7fbfd;
    --public-text: #143140;
    --public-muted: #597185;
    --public-line: #d2e1ea;
    --public-accent: #0f7f74;
    --public-accent-2: #13a29a;
    --public-accent-soft: #e7f8f5;
    --public-shadow: 0 12px 35px rgba(16, 57, 77, 0.1);
    --public-shadow-soft: 0 6px 18px rgba(16, 57, 77, 0.07);
    --mobile-nav-height: 66px;
}

body.wizard-body {
    background:
        radial-gradient(900px 420px at 120% -10%, #dbf3ef 0%, transparent 60%),
        radial-gradient(700px 380px at -10% 110%, #deedf8 0%, transparent 62%),
        linear-gradient(180deg, var(--public-bg) 0%, var(--public-bg-2) 100%);
    color: var(--public-text);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

.wizard-shell,
.wizard-shell * {
    font-family: inherit;
}

.public-shell {
    min-height: 100vh;
}

.public-hero-band {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: clamp(120px, 22vh, 180px);
    background: linear-gradient(135deg, #118778 0%, #0f6d64 100%);
    z-index: -1;
}

.public-topbar {
    background: rgba(248, 252, 255, 0.93);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--public-line);
    padding: 12px 16px 9px;
    z-index: 30;
}

.public-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.public-brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #12364a;
}

.public-top-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.public-top-subtitle {
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--public-muted);
    line-height: 1.6;
}

.wizard-shell {
    width: min(760px, calc(100% - 20px));
    margin: clamp(10px, 2.4vh, 18px) auto 0;
    padding-bottom: calc(var(--mobile-nav-height) + 22px);
    gap: clamp(10px, 1.8vh, 14px);
}

.card.wizard-hero-card,
.card.wizard-question-card,
.card.wizard-result-card {
    background: var(--public-surface);
    border: 1px solid var(--public-line);
    border-radius: 16px;
    box-shadow: var(--public-shadow);
}

.compact-header {
    padding: clamp(12px, 2.2vh, 16px);
    gap: 9px;
}

.compact-header h1 {
    font-size: clamp(25px, 3vw, 31px);
    line-height: 1.25;
    font-weight: 800;
}

.compact-header p {
    color: var(--public-muted);
    font-size: 14px;
    line-height: 1.7;
}

.progress-text {
    font-size: 13px;
    color: #45637a;
    font-weight: 700;
}

.wizard-stepper {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

.wizard-stepper-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    width: 100%;
}

.wizard-step-item {
    min-width: 0;
}

.wizard-step-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.wizard-step-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #bcd0e0;
    background: #dce7f1;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.wizard-step-connector {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: #cadeee;
}

.wizard-step-meta {
    display: grid;
    gap: 2px;
}

.wizard-step-kicker {
    font-size: 10px;
    color: #8ba0b1;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.wizard-step-title {
    font-size: 18px;
    color: #1e3b4e;
    font-weight: 700;
    line-height: 1.3;
}

.wizard-step-status {
    font-size: 12px;
    font-weight: 700;
    color: #7b90a1;
}

.wizard-step-item.active .wizard-step-dot {
    border-color: #2b7de0;
    background: #3e91f0;
    box-shadow: 0 0 0 3px rgba(62, 145, 240, 0.18);
}

.wizard-step-item.active .wizard-step-connector {
    background: #9fc4ee;
}

.wizard-step-item.active .wizard-step-status {
    color: #2b7de0;
}

.wizard-step-item.done .wizard-step-dot {
    border-color: #0f8c7f;
    background: #0f8c7f;
}

.wizard-step-item.done .wizard-step-dot::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    top: 4px;
    left: 4px;
}

.wizard-step-item.done .wizard-step-connector {
    background: #2ba89a;
}

.wizard-step-item.done .wizard-step-status {
    color: #0f8c7f;
}

.wizard-progress-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: #deebf3;
    overflow: hidden;
}

.wizard-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--public-accent), var(--public-accent-2));
    transition: width 0.25s ease;
}

.question-step-label {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: min(100%, 680px);
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #d5e5ef;
    background: #f0f7fc;
    color: #3e6078;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 700;
    white-space: normal;
    text-align: right;
}

.question-main-title {
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.4;
    color: var(--public-text);
    font-weight: 800;
}

.question-helper {
    color: var(--public-muted);
    font-size: 13px;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option-grid.is-odd .option-card:last-child {
    grid-column: 1 / -1;
}

.option-card {
    position: relative;
    min-height: clamp(64px, 8.2vh, 76px);
    border-radius: 14px;
    border: 1px solid #d4e2ec;
    background: var(--public-surface);
    color: #133444;
    padding: 14px 46px 14px 14px;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
    box-shadow: 0 1px 2px rgba(18, 58, 77, 0.03);
}

.option-card::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 14px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1.5px solid #b8cddd;
    background: #f3f8fc;
    transform: translateY(-50%);
}

.option-card::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #ffffff;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.option-card:hover,
.option-card:focus-visible {
    border-color: #8bc7bf;
    box-shadow: var(--public-shadow-soft);
    transform: translateY(-1px);
    outline: none;
}

.option-card.selected {
    border-color: var(--public-accent);
    background: var(--public-accent-soft);
}

.option-card.selected::before {
    border-color: #12887d;
    background: linear-gradient(180deg, #19a89d 0%, #0f7f74 100%);
    box-shadow: 0 0 0 3px rgba(15, 127, 116, 0.13);
}

.option-card.selected::after {
    opacity: 1;
}

.option-card.is-loading {
    opacity: 0.92;
}

.option-card.is-loading::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(15, 127, 116, 0.2);
    border-top-color: var(--public-accent);
    border-radius: 999px;
    transform: translateY(-50%);
    animation: spin 0.7s linear infinite;
    opacity: 1;
}

.option-card span,
.option-card strong,
.option-card small {
    font-family: inherit;
}

.option-card:disabled {
    cursor: wait;
}

.row-inline .button,
.row-inline button,
.row-inline .button-link {
    border-radius: 12px;
    font-weight: 700;
}

.summary-list {
    display: grid;
    gap: 8px;
    background: var(--public-surface-soft);
    border: 1px solid #d7e5ef;
    border-radius: 12px;
    padding: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.summary-key {
    font-size: 12px;
    color: var(--public-muted);
    background: #e8f1f7;
    border-radius: 999px;
    padding: 4px 8px;
}

.summary-value {
    font-size: 14px;
    color: var(--public-text);
    font-weight: 600;
}

.toast {
    background: #143949;
    color: #fff;
    display: inline-block;
    width: auto;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13px;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    min-height: var(--mobile-nav-height);
    padding: 10px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--public-line);
    z-index: 40;
}

#mobile-progress-text {
    text-align: center;
    color: #2b5169;
    font-weight: 700;
}

.nav-btn {
    min-width: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@media (min-width: 901px) {
    .public-topbar {
        display: block;
        position: sticky;
        top: 0;
    }

    .mobile-bottom-nav {
        display: none;
    }

    .wizard-shell {
        margin-top: 10px;
        padding-bottom: 28px;
    }

    .option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .wizard-stepper-bar {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .wizard-step-title {
        font-size: 21px;
    }
}

@media (max-width: 900px) {
    .public-topbar {
        display: none;
    }
}

@media (max-width: 640px) {
    .wizard-shell {
        width: calc(100% - 14px);
    }

    .compact-header h1 {
        font-size: clamp(25px, 6.2vw, 31px);
    }

    .question-main-title {
        font-size: clamp(30px, 9.2vw, 38px);
    }

    .option-card {
        font-size: 18px;
    }

    .wizard-stepper {
        overflow-x: hidden;
        padding-bottom: 2px;
    }

    .wizard-stepper-bar {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .wizard-step-item {
        flex: 1 1 0;
        min-width: 0;
    }

    .wizard-step-title {
        font-size: 13px;
        line-height: 1.25;
    }

    .wizard-step-status {
        font-size: 10px;
    }

    .wizard-step-dot {
        width: 16px;
        height: 16px;
    }
}
