/* Wizard-specific styles. Layered on top of base.css.
 * Mobile-first; tested at 360px through desktop.
 * Uses the partner brand variables (--primary, --accent, --text, --bg) when set.
 */

.wizard {
    max-width: 640px;
    margin: 1.5rem auto 4rem;
    padding: 0 1rem;
}

.wizard h1 {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    line-height: 1.2;
}

.wizard .lede {
    margin: 0 0 1.5rem;
    color: #555;
    font-size: 1rem;
}

.wizard .muted { color: #777; font-size: 0.9rem; }
.wizard .optional { color: #999; font-weight: normal; font-size: 0.85em; }
.wizard .ok { color: #1c7a39; font-weight: 600; }
.wizard .error { color: #b00020; }
.wizard small { color: #777; display: block; font-weight: normal; font-size: 0.85em; }

/* Progress nav */
.wizard-progress {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    overflow-x: auto;
}
.wizard-step {
    flex: 1 0 auto;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 3px solid #ddd;
    color: #888;
    font-size: 0.78rem;
    line-height: 1.2;
    min-width: 64px;
}
.wizard-step.done { border-color: var(--accent, #1192E8); color: #444; }
.wizard-step.active {
    border-color: var(--primary, #0F62FE);
    color: var(--text, #161616);
    font-weight: 600;
}
.wizard-step-num {
    display: inline-block;
    width: 1.5em; height: 1.5em; line-height: 1.5em;
    border-radius: 50%;
    background: #f0f0f0;
    margin-bottom: 0.25rem;
}
.wizard-step.active .wizard-step-num {
    background: var(--primary, #0F62FE);
    color: #fff;
}
.wizard-step.done .wizard-step-num { background: var(--accent, #1192E8); color: #fff; }
.wizard-step-label { display: block; }

.wizard-progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0 0.25rem;
}
.wizard-progress-bar-fill {
    height: 100%;
    background: var(--primary, #0F62FE);
    transition: width 240ms ease-out;
}
.wizard-progress-readout {
    margin: 0 0 0.75rem;
    text-align: right;
    color: #666;
    font-size: 0.85rem;
}

.wizard-back { margin: 0 0 0.75rem; }
.wizard-back a {
    color: var(--primary, #0F62FE);
    text-decoration: none;
    font-size: 0.95rem;
}
.wizard-back a:hover { text-decoration: underline; }

/* Form scaffolding */
.wizard fieldset {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 1rem 1.25rem 1.25rem;
    margin: 0 0 1rem;
}
.wizard fieldset legend { padding: 0 0.5rem; font-weight: 600; color: #333; }
.wizard label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 500;
    color: #222;
    font-size: 0.95rem;
}
.wizard input[type="text"],
.wizard input[type="email"],
.wizard input[type="tel"],
.wizard input[type="date"],
.wizard input[type="number"],
.wizard select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.wizard input:focus, .wizard select:focus {
    outline: 2px solid var(--accent, #1192E8);
    outline-offset: 1px;
    border-color: var(--accent, #1192E8);
}
.wizard input[type="range"] { width: 100%; }
.wizard input[type="checkbox"] { margin-right: 0.5rem; }

.wizard .slider-readout {
    text-align: center;
    color: #333;
    margin: 0.25rem 0 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}
/* Amount picker (step 1) — slider + exact-amount input in a soft card. */
.wizard .amount-card {
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    background: #fafbfd;
    padding: 1.1rem 1.25rem 1.15rem;
    margin: 0.35rem 0 0.5rem;
    text-align: center;
}

.wizard .slider-readout.big {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    color: var(--primary, #0F62FE);
    margin: 0 0 0.85rem;
}

.wizard .slider-scale {
    display: flex;
    justify-content: space-between;
    color: #98a1ad;
    font-size: 0.78rem;
    margin-top: 0.45rem;
}

/* Custom-drawn range control. --fill (set from JS) is the % of track to
   paint in the brand color so the left side reads as "selected". */
.wizard input.amount-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;               /* generous touch target */
    background: transparent;
    --fill: 0%;
    margin: 0;
    padding: 0;
    border: none;
}
.wizard input.amount-range:focus { outline: none; }

.wizard input.amount-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        var(--primary, #0F62FE) var(--fill),
        #e5e8ee var(--fill)
    );
}
.wizard input.amount-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    margin-top: -8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #0F62FE);
    box-shadow: 0 1px 4px rgba(22, 22, 22, 0.25);
    cursor: grab;
    transition: transform 120ms ease;
}
.wizard input.amount-range:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.15);
}
.wizard input.amount-range:focus-visible::-webkit-slider-thumb {
    outline: 2px solid var(--accent, #1192E8);
    outline-offset: 2px;
}

.wizard input.amount-range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #e5e8ee;
}
.wizard input.amount-range::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--primary, #0F62FE);
}
.wizard input.amount-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #0F62FE);
    box-shadow: 0 1px 4px rgba(22, 22, 22, 0.25);
    cursor: grab;
}

.wizard .amount-card .dollar-input {
    max-width: 240px;
    margin: 0 auto;
}
.wizard .amount-card .dollar-input input { font-size: 1.15rem; text-align: center; }
.wizard .amount-card small { margin-top: 0.5rem; }

.wizard button.linklike {
    display: block;
    background: none;
    border: none;
    padding: 0;
    margin: 0.9rem auto 0;
    color: var(--primary, #0F62FE);
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
}
.wizard button.linklike:hover { text-decoration: underline; }

.wizard .dollar-input { position: relative; }
.wizard .dollar-input .prefix {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}
.wizard .dollar-input input { padding-left: 1.5rem; }

.wizard .phone-row { display: flex; gap: 0.5rem; }
.wizard .phone-row input { flex: 1; }

.wizard button {
    font-size: 1rem;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
}
.wizard button.primary {
    background: var(--primary, #0F62FE);
    color: #fff;
    margin-top: 1.25rem;
    width: 100%;
}
.wizard button.primary.big { padding: 0.85rem 1.5rem; font-size: 1.1rem; }
.wizard button.secondary {
    background: #fff;
    color: var(--primary, #0F62FE);
    border-color: var(--primary, #0F62FE);
}
.wizard button:disabled { opacity: 0.6; cursor: not-allowed; }

.wizard .wizard-help {
    color: #777;
    font-size: 0.85rem;
    margin: 1.5rem 0;
    text-align: center;
}

/* Review */
.review-section {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 0 1rem 0.5rem;
    margin: 0 0 1rem;
}
.review-section h3 {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 1.05rem;
    margin: 0.75rem 0;
}
.review-section .edit { font-size: 0.85rem; color: var(--primary, #0F62FE); }
.review-section dl { margin: 0 0 0.5rem; }
.review-section dt { color: #777; font-size: 0.85rem; margin-top: 0.5rem; }
.review-section dd { margin: 0 0 0.25rem; color: #222; font-weight: 500; }

.error-banner {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #b00020;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0 0 1rem;
}
.error-banner ul {
    margin: 0.4rem 0 0 1.25rem;
    padding: 0;
}
.error-banner li { margin: 0.1rem 0; }

.dev-code {
    background: #fff7e0;
    border: 1px dashed #d4a72c;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    color: #6b5500;
    font-size: 0.95rem;
}
.dev-code code {
    background: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

/* Mobile tightening */
@media (max-width: 480px) {
    .wizard h1 { font-size: 1.3rem; }
    .wizard fieldset { padding: 0.75rem 1rem 1rem; }
    .wizard-step-label { display: none; }
    .wizard-step-num { margin-bottom: 0; }
}
