/* ==========================================================================
   Wizard — Global styles for the onboarding wizard
   
   Uses existing design tokens (--nr-*) and spacing scale.
   Matches the Figma onboarding wizard design.
   ========================================================================== */

/* ── Shell (renders inside MainLayout content area) ─────────────────────── */
.wizard-shell {
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 50%, #faf5ff 100%);
    border-radius: var(--nr-radius-xl);
    min-height: calc(100vh - 8rem);
    padding: 0;
}

body.dark-mode .wizard-shell {
    background: linear-gradient(135deg, var(--nr-background) 0%, #1a1a2e 100%);
}

/* ── Step indicator dots ────────────────────────────────────────────────── */
.wizard-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nr-space-5) var(--nr-space-6) 0;
    gap: 0;
}

.wizard-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    position: relative;
    z-index: 1;
}

.wizard-step-dot__circle {
    width: 2rem;
    height: 2rem;
    border-radius: var(--nr-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--nr-text-xs);
    font-weight: var(--nr-font-weight-semibold);
    border: 2px solid var(--nr-border);
    background: var(--nr-card);
    color: var(--nr-muted-foreground);
    transition: all 0.2s ease;
}

.wizard-step-dot--active .wizard-step-dot__circle {
    background: var(--nr-gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(91, 79, 230, 0.3);
}

.wizard-step-dot--completed .wizard-step-dot__circle {
    background: #dcfce7;
    border-color: #4ade80;
    color: #16a34a;
}

.wizard-step-dot__label {
    font-size: 0.625rem;
    color: var(--nr-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--nr-font-weight-medium);
    white-space: nowrap;
}

.wizard-step-dot--active .wizard-step-dot__label {
    color: #7c3aed;
    font-weight: var(--nr-font-weight-semibold);
}

.wizard-step-connector {
    width: 2rem;
    height: 2px;
    background: var(--nr-border);
    margin-bottom: 1.25rem;  /* offset to align with circles, not labels */
    flex-shrink: 0;
}

.wizard-step-connector--done {
    background: #4ade80;
}

@media (max-width: 640px) {
    .wizard-step-dot__label { display: none; }
    .wizard-step-connector { width: 1rem; }
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.wizard-progress {
    padding: var(--nr-space-4) var(--nr-space-6) 0;
}

.wizard-progress__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--nr-space-2);
}

.wizard-progress__label {
    font-size: var(--nr-text-sm);
    color: var(--nr-muted-foreground);
}

.wizard-progress__bar {
    height: 0.5rem;
    background: var(--nr-muted);
    border-radius: var(--nr-radius-full);
    overflow: hidden;
}

.wizard-progress__fill {
    height: 100%;
    background: var(--nr-gradient-primary);
    border-radius: var(--nr-radius-full);
    transition: width 0.3s ease;
}

/* ── Main content area ──────────────────────────────────────────────────── */
.wizard-content {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--nr-space-6);
}

/* ── Step icon (reused across steps) ────────────────────────────────────── */
.wizard-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: var(--nr-gradient-primary);
    border-radius: var(--nr-radius-2xl);
    font-size: 2rem;
    margin-bottom: var(--nr-space-4);
}

/* ── Navigation bar (back / skip / continue) ────────────────────────────── */
.wizard-nav {
    display: flex;
    flex-direction: column;
    gap: var(--nr-space-3);
    padding-top: var(--nr-space-6);
    border-top: 1px solid var(--nr-border);
    margin-top: var(--nr-space-6);
}

/* Mobile: actions (skip + continue) on top, back at the bottom */
.wizard-nav__actions {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: var(--nr-space-3);
    align-items: stretch;
}

.wizard-nav__back {
    order: 2;
}

/* Mobile: all nav buttons full-width */
.wizard-nav .wizard-btn-primary,
.wizard-nav .wizard-btn-secondary,
.wizard-nav .wizard-btn-ghost,
.wizard-nav .wizard-btn-finish {
    width: 100%;
    justify-content: center;
}

@media (min-width: 641px) {
    .wizard-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .wizard-nav__back {
        order: 1;
    }
    .wizard-nav__actions {
        order: 2;
        flex-direction: row;
        align-items: center;
        gap: var(--nr-space-3);
    }
    /* Restore auto-width on desktop */
    .wizard-nav .wizard-btn-primary,
    .wizard-nav .wizard-btn-secondary,
    .wizard-nav .wizard-btn-ghost,
    .wizard-nav .wizard-btn-finish {
        width: auto;
    }
}

/* ── Wizard buttons ─────────────────────────────────────────────────────── */
.wizard-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: var(--nr-gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--nr-radius-lg);
    font-size: var(--nr-text-base);
    font-weight: var(--nr-font-weight-semibold);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(91, 79, 230, 0.25);
}

.wizard-btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.wizard-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--nr-card);
    color: var(--nr-foreground);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    font-size: var(--nr-text-base);
    font-weight: var(--nr-font-weight-medium);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.wizard-btn-secondary:hover:not(:disabled) {
    background: var(--nr-muted);
    border-color: #c4b5fd;
}

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

.wizard-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--nr-muted-foreground);
    border: none;
    font-size: var(--nr-text-base);
    font-weight: var(--nr-font-weight-medium);
    cursor: pointer;
    transition: color 0.2s ease;
}

.wizard-btn-ghost:hover {
    color: var(--nr-foreground);
}

.wizard-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--nr-text-sm);
    min-width: auto;
}

.wizard-btn-lg {
    padding: 1rem 2rem;
    font-size: var(--nr-text-lg);
    min-width: 200px;
}

/* ── Card styling ───────────────────────────────────────────────────────── */
.wizard-card {
    background: var(--nr-card);
    border: 2px solid var(--nr-border);
    border-radius: var(--nr-radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.wizard-card--accent {
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
}

.wizard-card__header {
    padding: var(--nr-space-4) var(--nr-space-4) var(--nr-space-2);
}

.wizard-card__body {
    padding: 0 var(--nr-space-4) var(--nr-space-4);
}

/* ── Chip / selectable card ─────────────────────────────────────────────── */
.wizard-chip {
    display: flex;
    align-items: flex-start;
    gap: var(--nr-space-3);
    padding: var(--nr-space-3) var(--nr-space-4);
    border: 2px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    background: var(--nr-card);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.wizard-chip:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.wizard-chip--selected {
    border-color: #8b5cf6;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.wizard-chip--danger {
    border-color: #fca5a5;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.wizard-chip__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.wizard-chip__label {
    font-weight: var(--nr-font-weight-medium);
    color: var(--nr-foreground);
}

.wizard-chip__desc {
    font-size: var(--nr-text-xs);
    color: var(--nr-muted-foreground);
    margin-top: 2px;
}

/* ── Chip grid ──────────────────────────────────────────────────────────── */
.wizard-chip-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--nr-space-3);
}

@media (min-width: 641px) {
    .wizard-chip-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Stepper (number inc/dec) ───────────────────────────────────────────── */
.wizard-stepper {
    display: flex;
    align-items: center;
    gap: var(--nr-space-3);
}

.wizard-stepper__btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--nr-radius-full);
    border: 1px solid var(--nr-border);
    background: var(--nr-card);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wizard-stepper__btn:hover:not(:disabled) {
    background: var(--nr-muted);
    border-color: #c4b5fd;
}

.wizard-stepper__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wizard-stepper__value {
    flex: 1;
    text-align: center;
}

.wizard-stepper__number {
    font-size: var(--nr-text-4xl);
    font-weight: var(--nr-font-weight-bold);
    color: var(--nr-foreground);
}

.wizard-stepper__label {
    font-size: var(--nr-text-sm);
    color: var(--nr-muted-foreground);
}

/* ── Info / warning / error boxes ───────────────────────────────────────── */
.wizard-info {
    display: flex;
    gap: var(--nr-space-3);
    padding: var(--nr-space-4);
    border-radius: var(--nr-radius-lg);
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.wizard-info__icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.wizard-warning {
    display: flex;
    gap: var(--nr-space-3);
    padding: var(--nr-space-4);
    border-radius: var(--nr-radius-lg);
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.wizard-error {
    display: flex;
    gap: var(--nr-space-3);
    padding: var(--nr-space-4);
    border-radius: var(--nr-radius-lg);
    border: 1px solid #fecaca;
    background: #fef2f2;
}

/* ── Tier buttons (Must/Nice/Skip) ──────────────────────────────────────── */
.wizard-tier-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius-md);
    font-size: var(--nr-text-xs);
    font-weight: var(--nr-font-weight-semibold);
    cursor: pointer;
    background: var(--nr-card);
    transition: all 0.15s ease;
    height: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.wizard-tier-btn--active.wizard-tier-btn--must {
    background: #dcfce7;
    border-color: #4ade80;
    color: #15803d;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.wizard-tier-btn--active.wizard-tier-btn--nice {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.wizard-tier-btn--active.wizard-tier-btn--skip {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

/* ── Section heading icon ───────────────────────────────────────────────── */
.wizard-section-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--nr-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ── Review step day rows ───────────────────────────────────────────────── */
.wizard-review-days {
    display: flex;
    flex-direction: column;
    gap: var(--nr-space-2);
}

.wizard-review-day {
    display: flex;
    align-items: center;
    gap: var(--nr-space-3);
    padding: var(--nr-space-2) var(--nr-space-3);
    border-radius: var(--nr-radius-md);
    background: var(--nr-muted);
}

/* ── Attraction list in auto-picks ──────────────────────────────────────── */
.wizard-attraction-list {
    display: flex;
    flex-direction: column;
    gap: var(--nr-space-4);
}

/* ── Date input styling ─────────────────────────────────────────────────── */
.wizard-date-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    font-size: var(--nr-text-base);
    font-family: inherit;
    background: var(--nr-card);
    color: var(--nr-foreground);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wizard-date-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ── Inline calendar (Figma-matching) ───────────────────────────────────── */
.wizard-calendar {
    display: flex;
    justify-content: center;
}

.wizard-calendar__grid {
    display: flex;
    gap: var(--nr-space-4);
}

.wizard-calendar__grid--desktop { display: flex; }
.wizard-calendar__grid--mobile  { display: none; }

@media (max-width: 640px) {
    .wizard-calendar__grid--desktop { display: none; }
    .wizard-calendar__grid--mobile  { display: flex; }
}

.wizard-calendar__month {
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    padding: var(--nr-space-3);
    background: var(--nr-card);
    min-width: 260px;
}

.wizard-calendar__month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--nr-space-2);
}

.wizard-calendar__month-title {
    font-weight: var(--nr-font-weight-semibold);
    font-size: var(--nr-text-sm);
    color: var(--nr-foreground);
}

.wizard-calendar__nav-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: var(--nr-radius-md);
    font-size: 1.25rem;
    color: var(--nr-muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.wizard-calendar__nav-btn:hover {
    background: var(--nr-muted);
}

.wizard-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: var(--nr-text-xs);
    color: var(--nr-muted-foreground);
    font-weight: var(--nr-font-weight-medium);
    margin-bottom: var(--nr-space-1);
}

.wizard-calendar__weekdays span {
    padding: 0.25rem 0;
}

.wizard-calendar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.wizard-calendar__day {
    width: 100%;
    aspect-ratio: 1;
    max-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-size: var(--nr-text-sm);
    color: var(--nr-foreground);
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.1s ease;
    padding: 0;
}

.wizard-calendar__day:hover:not(:disabled) {
    background: #f5f3ff;
}

.wizard-calendar__day--outside {
    color: var(--nr-muted-foreground);
    opacity: 0.3;
}

.wizard-calendar__day--disabled {
    color: var(--nr-muted-foreground);
    opacity: 0.3;
    cursor: not-allowed;
}

.wizard-calendar__day--today {
    font-weight: var(--nr-font-weight-bold);
    color: #7c3aed;
}

.wizard-calendar__day--selected {
    background: var(--nr-gradient-primary) !important;
    color: #fff !important;
    font-weight: var(--nr-font-weight-semibold);
}

.wizard-calendar__day--range-start {
    border-radius: var(--nr-radius-full) 0 0 var(--nr-radius-full);
}

.wizard-calendar__day--range-end {
    border-radius: 0 var(--nr-radius-full) var(--nr-radius-full) 0;
}

.wizard-calendar__day--range-start.wizard-calendar__day--range-end {
    border-radius: var(--nr-radius-full);
}

.wizard-calendar__day--in-range {
    background: #ede9fe;
    color: #5b21b6;
}

/* ── Toggle switch ──────────────────────────────────────────────────────── */
.wizard-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--nr-space-4);
    background: var(--nr-muted);
    border-radius: var(--nr-radius-lg);
    border: 1px solid var(--nr-border);
}

/* ── Import defaults banner (step 4) ───────────────────────────────────── */
.wizard-import-defaults .wizard-card__body {
    padding-top: var(--nr-space-4);
}

.wizard-import-defaults__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--nr-space-3);
}

.wizard-import-defaults__content {
    flex: 1;
    min-width: 0;
}

.wizard-import-defaults__title-row {
    display: flex;
    align-items: center;
    gap: var(--nr-space-2);
    margin-bottom: var(--nr-space-2);
}

.wizard-import-defaults__close {
    border: 0;
    background: transparent;
    color: var(--nr-muted-foreground);
    width: 2rem;
    height: 2rem;
    border-radius: var(--nr-radius-md);
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.wizard-import-defaults__close:hover {
    background: var(--nr-muted);
}

.wizard-import-defaults__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nr-space-3);
    margin-top: var(--nr-space-4);
}

/* ── Selected date banner ───────────────────────────────────────────────── */
.wizard-date-summary {
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
    padding: var(--nr-space-4);
    border-radius: var(--nr-radius-lg);
    border: 1px solid #c4b5fd;
}

.wizard-date-summary__range {
    white-space: nowrap;
    overflow: visible;
}

@media (max-width: 420px) {
    .wizard-date-summary__range {
        font-size: var(--nr-text-base);
        letter-spacing: -0.01em;
    }
}

.wizard-card__header--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nr-space-3);
    flex-wrap: nowrap;
}

.wizard-card__header--toggle > *:first-child {
    min-width: 0;
}

.wizard-card__toggle-icon {
    flex-shrink: 0;
}

/* ── Day card in park plan ──────────────────────────────────────────────── */
.wizard-day-card {
    border: 2px solid var(--nr-border);
    border-radius: var(--nr-radius-xl);
    background: var(--nr-card);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.wizard-day-card:hover {
    border-color: #c4b5fd;
}

.wizard-day-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--nr-space-3) var(--nr-space-4);
    background: var(--nr-muted);
    border-bottom: 1px solid var(--nr-border);
}

.wizard-day-card__body {
    padding: var(--nr-space-4);
}

/* ── Hopper panel ───────────────────────────────────────────────────────── */
.wizard-hopper-panel {
    padding: var(--nr-space-3);
    border-radius: var(--nr-radius-lg);
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

/* ── Finish button (green gradient) ─────────────────────────────────────── */
.wizard-btn-finish {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    border-radius: var(--nr-radius-lg);
    font-size: var(--nr-text-lg);
    font-weight: var(--nr-font-weight-semibold);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    min-width: 200px;
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.3);
}

.wizard-btn-finish:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

/* ── Trip name input ────────────────────────────────────────────────────── */
.nr-label {
    display: block;
    font-size: var(--nr-text-sm);
    font-weight: var(--nr-font-weight-medium);
    color: var(--nr-foreground);
    margin-bottom: var(--nr-space-2);
}

.wizard-trip-name-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    font-size: var(--nr-text-base);
    font-family: inherit;
    background: var(--nr-card);
    color: var(--nr-foreground);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wizard-trip-name-input::placeholder {
    color: var(--nr-muted-foreground, #9ca3af);
}

.wizard-trip-name-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ── What happens next list ─────────────────────────────────────────────── */
.wizard-whats-next {
    display: flex;
    flex-direction: column;
    gap: var(--nr-space-3);
}

.wizard-whats-next__item {
    display: flex;
    align-items: flex-start;
    gap: var(--nr-space-3);
    font-size: var(--nr-text-sm);
    color: #374151;
}

.wizard-whats-next__num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: var(--nr-gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: var(--nr-font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
}
