/* ═══════════════════════════════════════════
   Wizard CSS - Sprint 18
   Dark theme, standalone layout
   ═══════════════════════════════════════════ */

:root {
    --w-primary: #ff6b35;
    --w-primary-hover: #ff8c5a;
    --w-bg-start: #1a0b2e;
    --w-bg-end: #0d1117;
    --w-surface: rgba(255, 255, 255, 0.05);
    --w-surface-hover: rgba(255, 255, 255, 0.08);
    --w-border: rgba(255, 255, 255, 0.1);
    --w-text: #e4e4e7;
    --w-text-muted: #a1a1aa;
    --w-success: #22c55e;
    --w-error: #ef4444;
    --w-warning: #f59e0b;
    --w-radius: 12px;
    --w-radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--w-bg-start), var(--w-bg-end));
    color: var(--w-text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Layout ─────────────────────────────── */

.wizard-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--w-border);
}

.wizard-logo {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}
.wizard-logo .logo-prefix {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--w-text-muted);
}
.wizard-logo .logo-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--w-primary);
}

.wizard-header__right { display: flex; align-items: center; gap: 1rem; }

.lang-switcher { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.lang-switcher a { color: var(--w-text-muted); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 4px; transition: all 0.2s; }
.lang-switcher a.active { color: var(--w-primary); font-weight: 600; }
.lang-switcher a:hover { color: var(--w-text); }
.lang-switcher span { color: var(--w-border); }

.wizard-main {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.wizard-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--w-border);
    color: var(--w-text-muted);
    font-size: 0.85rem;
}

/* ─── Progress Bar ───────────────────────── */

.wizard-progress { margin-bottom: 2.5rem; }

.wizard-progress__bar {
    height: 4px;
    background: var(--w-surface);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.wizard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--w-primary), var(--w-primary-hover));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.wizard-progress__steps {
    display: flex;
    justify-content: space-between;
}

.wizard-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: default;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.wizard-progress__step.active,
.wizard-progress__step.completed { opacity: 1; }

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid var(--w-border);
    transition: all 0.3s;
}
.wizard-progress__step.active .step-number {
    border-color: var(--w-primary);
    background: var(--w-primary);
    color: #fff;
}
.wizard-progress__step.completed .step-number {
    border-color: var(--w-success);
    background: var(--w-success);
    color: #fff;
}

.step-label {
    font-size: 0.7rem;
    color: var(--w-text-muted);
    text-align: center;
    max-width: 80px;
}
.wizard-progress__step.active .step-label { color: var(--w-text); font-weight: 500; }

/* ─── Step Content ───────────────────────── */

.wizard-step__header {
    margin-bottom: 2rem;
    text-align: center;
}
.wizard-step__header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.wizard-step__subtitle {
    color: var(--w-text-muted);
    font-size: 1rem;
}

/* ─── Form Fields ────────────────────────── */

.form-field { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.form-label .required { color: var(--w-primary); margin-left: 2px; }

.form-help {
    color: var(--w-text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--w-surface);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-sm);
    color: var(--w-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input::placeholder { color: var(--w-text-muted); }
.form-input:focus {
    border-color: var(--w-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}
.form-input.error { border-color: var(--w-error); }

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.form-select option { background: #1a1a2e; color: var(--w-text); }

.form-color {
    width: 60px;
    height: 40px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-sm);
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.form-error {
    color: var(--w-error);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}
.form-error.visible { display: block; }

/* ─── Phone Input Group ─────────────────── */

.phone-input-group {
    display: flex;
    gap: 0.5rem;
}
.phone-country-select {
    width: 130px;
    flex-shrink: 0;
    padding-right: 0.5rem;
    font-size: 0.85rem;
}
.phone-number-input {
    flex: 1;
}

/* ─── Radio Cards ────────────────────────── */

.radio-group,
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.radio-card,
.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--w-surface);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.radio-card:hover,
.checkbox-card:hover {
    background: var(--w-surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}
.radio-card.selected,
.checkbox-card.selected {
    border-color: var(--w-primary);
    background: rgba(255, 107, 53, 0.1);
}

.radio-card input,
.checkbox-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--w-primary);
    flex-shrink: 0;
}

.radio-card__label,
.checkbox-card__label {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* ─── Wizard Navigation ─────────────────── */

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--w-border);
}

/* ─── Buttons ────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--w-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn--primary {
    background: var(--w-primary);
    color: #fff;
    border-color: var(--w-primary);
}
.btn--primary:hover { background: var(--w-primary-hover); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--outline {
    background: transparent;
    color: var(--w-text);
    border-color: var(--w-border);
}
.btn--outline:hover { border-color: var(--w-text-muted); background: var(--w-surface); }

.btn--lg { padding: 0.875rem 1.75rem; font-size: 1rem; }

.btn svg { flex-shrink: 0; }

/* ─── Notice ─────────────────────────────── */

.wizard-notice {
    text-align: center;
    padding: 2rem;
    background: var(--w-surface);
    border-radius: var(--w-radius);
    border: 1px solid var(--w-border);
}
.wizard-notice p { margin-bottom: 1rem; color: var(--w-text-muted); }

/* ─── Resume Section ─────────────────────── */

.wizard-resume {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--w-border);
    text-align: center;
}
.wizard-resume p {
    color: var(--w-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.resume-form {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}
.resume-form .form-input { flex: 1; }

.resume-message {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}
.resume-message.success { color: var(--w-success); }
.resume-message.error { color: var(--w-error); }

/* ─── Complete Page ──────────────────────── */

.wizard-complete {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 0;
}

.wizard-complete__icon {
    color: var(--w-success);
    margin-bottom: 1.5rem;
}
.wizard-complete__icon svg {
    animation: checkScale 0.5s ease-out;
}

@keyframes checkScale {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.wizard-complete h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.wizard-complete__subtitle {
    color: var(--w-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.wizard-complete__summary {
    background: var(--w-surface);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}
.wizard-complete__summary h3 { margin-bottom: 1rem; font-size: 1.1rem; }

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.summary-label { color: var(--w-text-muted); font-size: 0.8rem; }
.summary-value { font-weight: 500; }

.wizard-complete__next { margin-bottom: 2rem; }
.wizard-complete__next > p {
    color: var(--w-text-muted);
    margin-bottom: 1rem;
}

.next-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}
.next-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--w-surface);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-sm);
    padding: 1rem;
}
.next-step__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--w-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.wizard-complete__actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.wizard-complete__cta { min-width: 260px; }

.wizard-complete__guarantee {
    font-size: 0.8rem;
    opacity: 0.65;
    margin: 0;
}

/* ─── Loading State ──────────────────────── */

.btn--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn--loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Responsive ─────────────────────────── */

@media (max-width: 768px) {
    .wizard-main { padding: 1.5rem 1.25rem; }

    .step-label { font-size: 0.65rem; max-width: 60px; }

    .radio-group,
    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .wizard-header { padding: 0.75rem 1rem; }
    .wizard-header .logo-prefix,
    .wizard-header .logo-main { font-size: 1.1rem; }
    .lang-switcher { font-size: 0.8rem; gap: 0.3rem; }
    .lang-switcher a { padding: 0.35rem 0.4rem; }

    .wizard-main { padding: 1.25rem 0.875rem; }

    .wizard-progress__steps { gap: 0.15rem; }
    .step-label { display: none; }
    .step-number { width: 28px; height: 28px; font-size: 0.75rem; }

    .wizard-step__header { margin-bottom: 1.5rem; }
    .wizard-step__header h1 { font-size: 1.25rem; }
    .wizard-step__subtitle { font-size: 0.9rem; }

    .form-label { font-size: 0.9rem; }
    .phone-input-group { flex-direction: column; gap: 0.5rem; }
    .phone-country-select { width: 100%; }
    .form-input { padding: 0.875rem 1rem; font-size: 1rem; }

    .radio-card,
    .checkbox-card { padding: 1rem; min-height: 48px; }

    .wizard-nav { flex-direction: column; gap: 0.75rem; }
    .wizard-nav .btn { width: 100%; justify-content: center; }
    .btn--lg { padding: 1rem 1.5rem; font-size: 1rem; }

    .wizard-complete h1 { font-size: 1.5rem; }
    .wizard-complete__subtitle { font-size: 0.95rem; }
    .wizard-complete__cta { min-width: auto; width: 100%; }

    .resume-form { flex-direction: column; max-width: 100%; }
    .resume-form .btn { width: 100%; justify-content: center; }

    .wizard-footer { padding: 1rem; font-size: 0.8rem; }
}
