/* Booking wizard + admin styles — relies on :root tokens from css/style.css */

/* Any class rule that sets `display` on an element also using the `hidden`
   attribute silently defeats it (the browser's [hidden]{display:none} is a
   low-priority UA-stylesheet default that any same-specificity author rule
   overrides). Force it back everywhere in this file, once, rather than
   remembering a per-element [hidden] override each time. */
[hidden] {
    display: none !important;
}

/* ---------- Stepper ---------- */
.wizard-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

/* Each step stretches so the connectors fill the row — always one line. */
.wizard-step-circle-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.wizard-step-circle-wrap:last-child {
    flex: 0 0 auto;
}

.wizard-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.wizard-step-circle.is-active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wizard-step-circle.is-done {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-light);
}

.wizard-step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.wizard-step-label.is-active {
    color: var(--text-primary);
    font-weight: 600;
}

.wizard-step-connector {
    flex: 1 1 auto;
    min-width: 12px;
    height: 1px;
    margin-right: 0.5rem;
    background: var(--border-color);
}

/* ---------- Steps ---------- */
.wizard-step h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.wizard-step-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.wizard-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
}

/* ---------- Car size step ---------- */
.car-size-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.car-size-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.car-size-card:hover {
    border-color: var(--primary-light);
}

.car-size-card.is-selected {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.car-size-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.car-size-card.is-selected .car-size-icon {
    background: var(--primary-color);
    color: var(--text-light);
}

.car-size-label {
    font-weight: 600;
    color: var(--text-primary);
}

.car-size-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.car-size-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.7rem;
}

.car-size-card.is-selected .car-size-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ---------- Window diagram + legend ---------- */
.window-diagram {
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 12px;
    margin-bottom: 1.25rem;
}

.window-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

.window-diagram [data-win] {
    transition: fill .15s ease, stroke .15s ease;
}

.window-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.window-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-align: left;
}

.window-legend-row.is-selected {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
}

.window-legend-title {
    font-weight: 600;
    color: var(--text-primary);
}

.window-legend-price {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-top: 2px;
}

.window-legend-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.7rem;
}

.window-legend-row.is-selected .window-legend-checkbox {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.windshield-subchoices {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0 0.25rem 0.25rem;
    flex-wrap: wrap;
}

.windshield-subchoice-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.windshield-subchoice-btn.is-active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.legal-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #8a5a00;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 0.75rem 0.9rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

/* ---------- Options step ---------- */
.option-picker {
    margin-bottom: 1rem;
}

.option-picker-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-choice-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.option-choice-btn.is-active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.option-advise-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.option-advise-btn.is-active {
    background: var(--secondary-color);
    color: var(--text-light);
    border-color: var(--secondary-color);
}

/* ---------- Slot picker ---------- */
.slot-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.slot-nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: var(--text-primary);
}

.slot-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slot-nav-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.slot-grid-scroll {
    overflow-x: auto;
}

.slot-grid {
    display: grid;
    gap: 0.6rem;
    min-width: 600px;
}

.slot-day-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.slot-day-heading {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.slot-btn {
    padding: 0.5rem 0.25rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.slot-btn.is-selected {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.slot-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
    background: transparent;
}

.slot-loading,
.slot-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* ---------- Summary / payment ---------- */
.booking-summary-card {
    margin-bottom: 1rem;
}

.booking-summary-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.booking-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.booking-summary-row .service-name {
    color: var(--text-primary);
}

.booking-summary-row .service-detail {
    color: var(--text-secondary);
}

.booking-summary-row .price {
    color: var(--text-secondary);
}

.booking-summary-total {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.booking-summary-datetime {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.advise-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #0c5460;
    background: #d1ecf1;
    padding: 0.6rem 0.75rem;
    border-radius: var(--border-radius);
    margin-top: 0.75rem;
}

.deposit-card {
    margin-bottom: 1.5rem;
}

.deposit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.deposit-amount {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.deposit-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ---------- Success step ---------- */
.wizard-success {
    text-align: center;
}

.wizard-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d4edda;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.wizard-ref {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.wizard-success-card {
    text-align: left;
    margin-bottom: 1rem;
}

.wizard-success-emailnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.wizard-form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ---------- Wizard nav actions ---------- */
.wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.wizard-price-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.wizard-price-hint strong {
    color: var(--accent-color);
}

.wizard-form-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ---------- Admin (first pass, deliberately plain) ---------- */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-view-toggle {
    display: flex;
    gap: 0.5rem;
}

.admin-view-toggle button {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.admin-view-toggle button.is-active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.admin-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.admin-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.admin-calendar-nav button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.admin-calendar-scroll {
    overflow-x: auto;
}

.admin-calendar-grid {
    display: grid;
    gap: 0.5rem;
    min-width: 700px;
}

.admin-day-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.6rem;
}

.admin-day-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.admin-day-card-head span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}

.admin-day-card-head button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.admin-slot-row {
    font-size: 0.7rem;
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 3px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.admin-slot-row.is-booked {
    cursor: default;
    background: #d4edda;
    color: #155724;
    border-color: transparent;
}

.admin-slot-row.is-booked.status-no_deposit {
    background: #fde3cd;
    color: #b35900;
}

.admin-slot-row.is-booked.status-pending_payment {
    background: #d6e4f5;
    color: #1a5490;
}

.admin-slot-row.is-closed {
    background: #f8d7da;
    color: #842029;
    border-color: transparent;
}

/* Cancelled booking hint: the slot itself stays styled as free/available —
   this just marks that it held a booking that was cancelled. Deliberately
   NOT red (that's reserved for "closed/blocked" elsewhere in this file) —
   this is informational/reversible, not a warning. Clicking the icon itself
   (not the row) opens the cancelled booking's details/reactivation. */
.admin-cancelled-hint {
    color: #6c757d;
    cursor: pointer;
}

.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status--deposit_paid {
    background: #d4edda;
    color: #155724;
}

.badge-status--no_deposit {
    background: #fde3cd;
    color: #b35900;
}

.badge-status--pending_payment {
    background: #d6e4f5;
    color: #1a5490;
}

.badge-status--cancelled {
    background: #f8d7da;
    color: #842029;
}

.admin-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.admin-lookup-card,
.admin-bookings-panel {
    margin-bottom: 1.5rem;
}

.admin-lookup-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.admin-lookup-form input {
    flex: 1;
}

.admin-lookup-result {
    font-size: 0.9rem;
}

.admin-lookup-result-row {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.admin-reschedule-options {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.admin-reschedule-options button {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.admin-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-booking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.85rem;
}

.admin-booking-row .ref {
    font-weight: 700;
}

/* ---------- Admin: modal ---------- */
.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
}

.admin-modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.admin-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.admin-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.admin-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.admin-modal-actions .btn {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-status-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
}

.admin-status-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.admin-status-btn.is-active.status-deposit_paid { background: #d4edda; color: #155724; border-color: #155724; }
.admin-status-btn.is-active.status-no_deposit { background: #fde3cd; color: #b35900; border-color: #b35900; }
.admin-status-btn.is-active.status-cancelled { background: #f8d7da; color: #842029; border-color: #842029; }

.admin-conflict-list {
    background: #f8d7da;
    color: #842029;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.admin-conflict-list ul {
    margin: 0.5rem 0 0 1.2rem;
}

.admin-mini-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-mini-steps span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ---------- Admin: day view ---------- */
.admin-daylist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-daylist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    gap: 1rem;
}

.admin-daylist-row.is-booked {
    background: #d4edda;
    color: #155724;
}

.admin-daylist-row.is-booked.status-no_deposit {
    background: #fde3cd;
    color: #b35900;
}

.admin-daylist-row.is-booked.status-pending_payment {
    background: #d6e4f5;
    color: #1a5490;
}

.admin-daylist-row.is-closed {
    background: #f8d7da;
}

.admin-daylist-time {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 56px;
}

.admin-daylist-info {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-daylist-info strong {
    color: var(--text-primary);
}

.admin-daylist-row.is-booked .admin-daylist-time,
.admin-daylist-row.is-booked .admin-daylist-info,
.admin-daylist-row.is-booked .admin-daylist-info strong {
    color: #155724;
}

.admin-daylist-row.is-booked.status-no_deposit .admin-daylist-time,
.admin-daylist-row.is-booked.status-no_deposit .admin-daylist-info,
.admin-daylist-row.is-booked.status-no_deposit .admin-daylist-info strong {
    color: #b35900;
}

.admin-daylist-row.is-booked.status-pending_payment .admin-daylist-time,
.admin-daylist-row.is-booked.status-pending_payment .admin-daylist-info,
.admin-daylist-row.is-booked.status-pending_payment .admin-daylist-info strong {
    color: #1a5490;
}

.admin-daylist-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ---------- Admin: month view ---------- */
.admin-month-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-month-action-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.admin-month-weekday {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 4px;
}

.admin-month-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    opacity: 1;
}

.admin-month-cell.is-outside {
    opacity: 0.35;
}

.admin-month-cell.is-closed {
    background: #f8d7da;
}

.admin-month-cell.is-selected {
    border-color: var(--primary-color);
    border-width: 2px;
    background: var(--bg-secondary);
}

.admin-month-cell .date-num {
    font-size: 0.8rem;
}

.admin-month-cell .count {
    font-size: 0.65rem;
    color: var(--accent-color);
    font-weight: 700;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-row.wizard-form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Not enough room for six labels: keep the circles, name only the current step. */
@media (max-width: 860px) {
    .wizard-step-label:not(.is-active) {
        display: none;
    }
}
