/* ═══════════════════════════════════════════════
   Booking Wizard — Full-screen interactive flow
   ═══════════════════════════════════════════════ */

/* ─── Modal overlay ─── */

.bw-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.bw-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
.bw-backdrop {
    display: none;
}
.bw-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--ocf-heading) 6%, transparent);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--ocf-body);
    transition: all var(--duration) ease;
}
.bw-modal-close:hover { background: color-mix(in srgb, var(--ocf-heading) 12%, transparent); color: var(--ocf-heading); }
.bw-modal-close svg { width: 1.125rem; height: 1.125rem; }

.bw {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--ocf-bg);
    overflow-y: auto;
}

/* ─── Progress bar ─── */

.bw-progress {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--ocf-border-light);
    z-index: 2;
    flex-shrink: 0;
}

.bw-progress-bar {
    height: 100%;
    width: 20%;
    background: var(--ocf-accent);
    border-radius: 0 2px 2px 0;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Header ─── */

.bw-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.625rem 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ocf-border-light) 6%, transparent);
}
.bw-header-brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
@media (max-width: 639px) {
    .bw-header-brand {
        flex-direction: column;
        gap: 0.125rem;
    }
}

@media (min-width: 1024px) {
    .bw-header { height: 6rem; padding: 0 3rem; }
}

.bw-logo { text-decoration: none; }

.bw-logo-img {
    height: 2rem;
    width: auto;
}

@media (min-width: 1024px) {
    .bw-logo-img { height: 2.5rem; }
}

.bw-logo-text {
    font-family: var(--ocf-font-heading), Georgia, serif;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ocf-heading);
    letter-spacing: -0.01em;
}

.bw-phone {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--ocf-heading);
    text-decoration: none;
    transition: color var(--duration) ease;
}

.bw-phone:hover { color: var(--ocf-accent); }

.bw-phone svg {
    width: 1rem;
    height: 1rem;
}

/* ─── Steps viewport ─── */

.bw-viewport {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1.5rem 0;
}

@media (min-width: 640px) {
    .bw-viewport { padding: 1.5rem 2rem 0; }
}

@media (min-width: 1024px) {
    .bw-viewport { padding: 2rem 3rem 0; }
}

.bw-step {
    display: none;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    animation: bw-fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bw-step.is-active {
    display: block;
}

.bw-step.is-leaving {
    animation: bw-fadeOut 0.25s ease forwards;
}

@keyframes bw-fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bw-fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px);
    }
}

.bw-step-inner {
    width: 100%;
}

/* ─── Step typography ─── */

.bw-step-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ocf-accent);
    margin-bottom: 0.5rem;
}

.bw-title {
    font-family: var(--ocf-font-heading), Georgia, serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--ocf-heading);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.bw-subtitle {
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--ocf-body);
    margin-bottom: 1.5rem;
    max-width: 30rem;
}

/* ─── Service tile grid (Step 1) ─── */

.bw-service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .bw-service-grid { grid-template-columns: repeat(3, 1fr); gap: 0.625rem; }
}

/* ─── Tiles (universal) ─── */

.bw-tile {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--ocf-bg);
    border: 1.5px solid var(--ocf-border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
    color: var(--ocf-heading);
}

.bw-tile:hover {
    border-color: var(--ocf-border);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.bw-tile.is-selected {
    border-color: var(--ocf-accent);
    background: color-mix(in srgb, var(--ocf-accent) 4%, var(--ocf-bg));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocf-accent) 12%, transparent);
}

.bw-tile.is-selected .bw-tile-check {
    opacity: 1;
    transform: scale(1);
}

.bw-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ocf-accent);
    transition: color 0.25s ease;
}

.bw-tile-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.bw-tile-label {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}

.bw-tile-check {
    margin-left: auto;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ocf-accent);
    color: var(--ocf-bg);
    border-radius: var(--radius-full);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bw-tile-check svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ─── Service checklist (wizard select mode) ─── */

.bw-service-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bw-service-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--ocf-bg);
    border: 1.5px solid var(--ocf-border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
}

.bw-service-row:hover {
    border-color: var(--ocf-border);
    background: var(--ocf-bg-alt);
}

.bw-service-row.is-selected {
    border-color: var(--ocf-accent);
    background: color-mix(in srgb, var(--ocf-accent) 4%, var(--ocf-bg));
}

.bw-service-row-check {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ocf-border);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: transparent;
}

.bw-service-row.is-selected .bw-service-row-check {
    background: var(--ocf-accent);
    border-color: var(--ocf-accent);
    color: #fff;
}

.bw-service-row-check svg {
    width: 0.875rem;
    height: 0.875rem;
}

.bw-service-row-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--ocf-heading);
}

/* ─── Choice buttons (Step 2 & 3) ─── */

.bw-field-group {
    margin-bottom: 0.875rem;
}

.bw-field-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ocf-label);
    margin-bottom: 0.75rem;
}

.bw-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ocf-body);
}

.bw-choice-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.bw-choice-row--3 {
    grid-template-columns: repeat(3, 1fr);
}

.bw-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--ocf-bg);
    border: 1.5px solid var(--ocf-border-light);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ocf-heading);
    transition: all 0.25s ease;
}

.bw-choice svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--ocf-body);
    transition: color 0.25s ease;
}

.bw-choice:hover {
    border-color: var(--ocf-border);
    box-shadow: var(--shadow-sm);
}

.bw-choice.is-selected {
    border-color: var(--ocf-accent);
    background: color-mix(in srgb, var(--ocf-accent) 4%, var(--ocf-bg));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocf-accent) 12%, transparent);
}

.bw-choice.is-selected svg {
    color: var(--ocf-accent);
}

/* ─── Textarea ─── */

.bw-textarea {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
    font-size: var(--text-base);
    color: var(--ocf-heading);
    background: var(--ocf-bg);
    border: 1.5px solid var(--ocf-border-light);
    border-radius: var(--radius);
    outline: none;
    resize: vertical;
    min-height: 90px;
    transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
}

.bw-textarea:focus {
    border-color: var(--ocf-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocf-accent) 10%, transparent);
}

.bw-textarea::placeholder {
    color: var(--ocf-body);
}

/* ─── Form inputs (Step 3) ─── */

.bw-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}
.bw-field-full { grid-column: 1 / -1; }
@media (max-width: 400px) {
    .bw-form-grid { grid-template-columns: 1fr; }
}

.bw-input {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
    font-size: var(--text-base);
    color: var(--ocf-heading);
    background: var(--ocf-bg);
    border: 1.5px solid var(--ocf-border-light);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
}

.bw-input:focus {
    border-color: var(--ocf-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocf-accent) 10%, transparent);
}

.bw-input::placeholder {
    color: var(--ocf-body);
}

.bw-input.bw-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.bw-error-msg {
    font-size: var(--text-xs);
    color: #dc2626;
    margin-top: 0.375rem;
    font-weight: 500;
}

/* ─── Summary (Step 4) ─── */

.bw-summary {
    background: var(--ocf-bg-alt);
    border: 1px solid var(--ocf-border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .bw-summary { padding: 2.5rem; }
}

.bw-summary-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--ocf-border-light) 8%, transparent);
}

.bw-summary-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.bw-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--ocf-accent) 8%, transparent);
    color: var(--ocf-accent);
}

.bw-summary-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.bw-summary-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ocf-label);
    margin-bottom: 0.25rem;
}

.bw-summary-value {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--ocf-heading);
    line-height: 1.4;
}

/* ─── Success state ─── */

.bw-success-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--ocf-accent) 10%, transparent);
    color: var(--ocf-accent);
    animation: bw-pop 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bw-success-icon svg {
    width: 2.5rem;
    height: 2.5rem;
}

@keyframes bw-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bw-step--success .bw-title {
    margin-bottom: 1rem;
}

.bw-step--success .bw-subtitle {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.bw-success-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
}

.bw-success-phone {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ocf-body);
    text-decoration: none;
    transition: color var(--duration) ease;
}

.bw-success-phone:hover {
    color: var(--ocf-accent);
}

/* ─── Schedule: time + date side by side ─── */

.bw-schedule-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .bw-schedule-row {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .bw-schedule-row .bw-field-group { margin-bottom: 0; }
}

/* ─── Date picker row ─── */

.bw-date-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.bw-date-row .bw-choice--asap {
    flex: 0 0 auto;
    min-width: 100px;
}

.bw-date-input-wrap {
    flex: 1;
}

.bw-date-input {
    height: 100%;
    cursor: pointer;
}

.bw-date-input.is-selected {
    border-color: var(--ocf-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocf-accent) 12%, transparent);
}

/* ─── Nav buttons (inline with content) ─── */

.bw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .bw-nav { padding: 1.5rem 2rem 2rem; }
}

@media (min-width: 640px) {
    .bw-nav { padding: 2.5rem 2rem 3rem; }
}

@media (min-width: 1024px) {
    .bw-nav { padding: 3rem 3rem 4rem; }
}

.bw-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--ocf-font-body), system-ui, sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.bw-btn svg {
    width: 1rem;
    height: 1rem;
}

.bw-btn--back {
    background: transparent;
    color: var(--ocf-body);
    padding-left: 1rem;
}

.bw-btn--back:hover {
    color: var(--ocf-heading);
}

.bw-btn--next {
    background: var(--ocf-accent);
    color: var(--ocf-bg);
    margin-left: auto;
}

.bw-btn--next:hover {
    background: var(--ocf-accent-hover);
}

.bw-btn--next:active {
    transform: scale(0.98);
}

.bw-btn--next.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ─── Next button group + Enter hint ─── */

.bw-next-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

.bw-key-hint {
    display: none;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--ocf-label);
    line-height: 1;
}

.bw-key-hint strong {
    font-weight: 600;
    color: var(--ocf-heading);
}

@media (min-width: 768px) {
    .bw-key-hint { display: block; }
}

/* ─── Shake validation ─── */

@keyframes bw-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.bw-shake {
    animation: bw-shake 0.4s ease;
}

/* ─── "Other" type-in input ─── */

.bw-other-input-wrap {
    margin-top: 0.75rem;
    animation: bw-fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ─── Mobile refinements ─── */

@media (max-width: 479px) {
    .bw-choice-row--3 {
        grid-template-columns: 1fr;
    }
    .bw-title {
        font-size: var(--text-2xl);
    }
}
