:root {
    --imabox-primary: #2457d6;
    --imabox-bg: #ffffff;
    --imabox-card: #ffffff;
    --imabox-border: #e4e8ef;
    --imabox-text: #1f2937;
    --imabox-muted: #6b7280;
}

body {
    margin: 0;
    background: var(--imabox-bg);
    color: var(--imabox-text);
}

.booking-shell {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.booking-header {
    text-align: center;
    margin-bottom: 32px;
}

.booking-brand {
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--imabox-primary);
    margin-bottom: 12px;
}

.booking-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 3rem);
}

.booking-header p {
    color: var(--imabox-muted);
    margin: 0;
}

.booking-card {
    background: var(--imabox-card);
    border: 1px solid var(--imabox-border);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(31, 41, 55, .05);
    animation: appleStepAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.booking-hidden {
    display: none !important;
}

@keyframes appleStepAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Indicator */
.booking-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 520px;
    margin: 0 auto 28px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--imabox-border);
    border-radius: 30px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.booking-progress-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: default;
    transition: all .2s ease;
    padding: 5px 10px;
    border-radius: 20px;
    user-select: none;
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.booking-progress-step.active {
    color: var(--imabox-primary);
}

.booking-progress-step.active .step-dot {
    background: var(--imabox-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(36, 87, 214, 0.35);
}

.booking-progress-step.completed {
    color: #334155;
    cursor: pointer;
}

.booking-progress-step.completed .step-dot {
    background: #e0e7ff;
    color: var(--imabox-primary);
}

.booking-progress-step.completed:hover {
    background: #f8fafc;
    color: var(--imabox-primary);
}

.booking-progress-divider {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 2px;
    min-width: 10px;
    border-radius: 2px;
}

/* Apple Back Button */
.apple-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .15s ease;
}

.apple-back-btn:hover {
    background: #f1f5f9;
    color: var(--imabox-primary);
    border-color: #cbd5e1;
    transform: translateX(-2px);
}

/* Summary Pills and Cards */
.apple-summary-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--imabox-primary);
    background: rgba(36, 87, 214, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(36, 87, 214, 0.12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.apple-appointment-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.summary-item strong {
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 600;
}

.booking-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.booking-step-number {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--imabox-primary);
    color: white;
    font-weight: 700;
}

.booking-step h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

.booking-step p {
    margin: 0;
    color: var(--imabox-muted);
}

.form-select-lg,
.form-control-lg {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.05rem;
    border: 1.5px solid var(--imabox-border);
    background-color: #ffffff;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-select-lg:focus,
.form-control-lg:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--imabox-primary);
    box-shadow: 0 0 0 3px rgba(36, 87, 214, .12);
    outline: none;
}

.form-select {
    cursor: pointer;
}

.study-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.study-item-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 1.5px solid var(--imabox-border);
    border-radius: 12px;
    padding: 14px 18px;
    background: #ffffff;
    transition: all .15s ease-in-out;
}

.study-item:hover .study-item-body {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.study-item input:checked + .study-item-body {
    border-color: var(--imabox-primary);
    background: rgba(36, 87, 214, .04);
    box-shadow: 0 0 0 3px rgba(36, 87, 214, .12);
}

.study-item-control {
    padding-top: 2px;
    flex-shrink: 0;
}

.study-radio-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    transition: all .15s ease;
}

.study-radio-indicator::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    transform: scale(0);
    transition: transform .15s ease-in-out;
}

.study-item input:checked + .study-item-body .study-radio-indicator {
    border-color: var(--imabox-primary);
    background: var(--imabox-primary);
}

.study-item input:checked + .study-item-body .study-radio-indicator::after {
    transform: scale(1);
}

.study-item-content {
    flex: 1;
    min-width: 0;
}

.study-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.study-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--imabox-text);
}

.study-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--imabox-muted);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .15s ease;
}

.study-item input:checked + .study-item-body .study-item-badge {
    background: rgba(36, 87, 214, .12);
    color: var(--imabox-primary);
    font-weight: 600;
}

.study-item-desc {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--imabox-muted);
    line-height: 1.4;
}

.professional-option {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.professional-option input {
    position: absolute;
    opacity: 0;
}

.professional-option-body {
    border: 1px solid var(--imabox-border);
    border-radius: 12px;
    padding: 16px;
}

.professional-option input:checked + .professional-option-body {
    border-color: var(--imabox-primary);
    box-shadow: 0 0 0 3px rgba(36, 87, 214, .12);
}

/* Apple Calendar Design */
.apple-calendar-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.apple-calendar {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid var(--imabox-border);
    border-radius: 20px;
    padding: 22px 20px 18px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    user-select: none;
}

.apple-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;
}

.apple-cal-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.apple-cal-month {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.apple-cal-year {
    font-size: 1rem;
    font-weight: 500;
    color: #64748b;
}

.apple-cal-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.apple-cal-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-cal-nav-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--imabox-primary);
    border-color: #cbd5e1;
    transform: scale(1.05);
}

.apple-cal-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.apple-cal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f8fafc;
}

.apple-cal-today-pill {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--imabox-primary);
    background: rgba(36, 87, 214, 0.08);
    border: 1px solid rgba(36, 87, 214, 0.15);
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s ease;
}

.apple-cal-today-pill:hover {
    background: var(--imabox-primary);
    color: #ffffff;
}

.apple-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 10px;
}

.apple-cal-weekday {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.04em;
    padding: 4px 0;
}

.apple-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 6px;
    column-gap: 4px;
    place-items: center;
}

.apple-cal-cell {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    position: relative;
    transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    margin: 0;
}

.apple-cal-cell-inner {
    position: relative;
    z-index: 1;
}

.apple-cal-cell:hover:not(.apple-cal-disabled):not(.apple-cal-other-month):not(.apple-cal-selected) {
    background: #f1f5f9;
    color: var(--imabox-primary);
    font-weight: 600;
    transform: scale(1.08);
}

.apple-cal-cell:active:not(.apple-cal-disabled):not(.apple-cal-other-month) {
    transform: scale(0.95);
}

.apple-cal-today:not(.apple-cal-selected) {
    color: var(--imabox-primary);
    font-weight: 700;
}

.apple-cal-today:not(.apple-cal-selected)::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--imabox-primary);
}

.apple-cal-selected {
    background: var(--imabox-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(36, 87, 214, 0.38);
    transform: scale(1.06);
}

.apple-cal-selected::after {
    display: none !important;
}

.apple-cal-disabled {
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 0.45;
    pointer-events: none;
}

.apple-cal-other-month {
    color: #e2e8f0;
    pointer-events: none;
    cursor: default;
    font-size: 0.85rem;
}

/* Apple Time Slots Grid */
.apple-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.apple-time-slot {
    display: block;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.apple-time-slot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.apple-time-slot-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    transition: all .16s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.apple-time-slot:hover .apple-time-slot-pill {
    border-color: #94a3b8;
    background: #f8fafc;
    color: var(--imabox-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.apple-time-slot input:checked + .apple-time-slot-pill {
    background: var(--imabox-primary);
    border-color: var(--imabox-primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(36, 87, 214, 0.35);
    transform: translateY(-1px) scale(1.02);
}

.apple-time-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    gap: 14px;
    color: #64748b;
    font-size: 0.95rem;
}

.apple-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(36, 87, 214, 0.15);
    border-top-color: var(--imabox-primary);
    border-radius: 50%;
    animation: apple-spin 0.75s linear infinite;
}

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

.apple-time-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px dashed #cbd5e1;
    width: 100%;
}

.apple-time-empty svg {
    color: #94a3b8;
    margin-bottom: 8px;
}

.apple-time-empty p {
    margin: 0 0 4px;
    font-weight: 600;
    color: #334155;
}

.apple-time-empty small {
    color: #94a3b8;
}

@media (max-width: 720px) {
    .booking-shell {
        width: min(100% - 20px, 980px);
        padding-top: 24px;
    }

    .booking-card {
        padding: 20px;
    }

    .time-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .booking-progress-bar {
        padding: 4px 8px;
        margin-bottom: 20px;
    }

    .booking-progress-step {
        padding: 4px 6px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .step-dot {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .apple-appointment-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .apple-summary-pill {
        max-width: 140px;
        font-size: 0.75rem;
    }

    .apple-calendar {
        padding: 18px 12px 14px;
        border-radius: 16px;
    }

    .apple-cal-cell {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .apple-time-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .apple-time-slot-pill {
        height: 42px;
        font-size: 0.9rem;
        padding: 0 8px;
    }
}

.booking-card {
    position: relative;
}

.booking-print-action {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}

@media print {
    body {
        background: #fff !important;
    }

    .no-print {
        display: none !important;
    }

    .booking-shell {
        min-height: auto !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .booking-card {
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 24px !important;
    }

    a,
    button {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .booking-print-action {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin-bottom: 16px;
    }
}

.booking-brand-logo {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 56px;
    margin: 0 auto;
    object-fit: contain;
}

/* Public booking page spacing and small-screen layout */
.booking-shell {
    width: min(calc(100% - 40px), 980px);
    padding: 56px 0 96px;
}

.booking-header {
    margin-bottom: 40px;
}

.booking-brand-logo {
    max-width: min(260px, 80vw);
    max-height: 64px;
    margin-bottom: 20px;
}

.booking-progress-bar {
    margin-bottom: 36px;
}

.booking-card {
    padding: 36px;
    margin-bottom: 28px;
}

@media (max-width: 720px) {
    .booking-shell {
        width: calc(100% - 32px);
        padding: 36px 0 64px;
    }

    .booking-header {
        margin-bottom: 30px;
    }

    .booking-card {
        padding: 26px 22px;
        margin-bottom: 20px;
    }

    .booking-progress-bar {
        margin-bottom: 24px;
    }

    .booking-step {
        gap: 12px;
    }
}

@media (max-width: 540px) {
    .booking-shell {
        width: calc(100% - 24px);
        padding: 28px 0 48px;
    }

    .booking-brand-logo {
        max-width: min(220px, 72vw);
        max-height: 56px;
        margin-bottom: 16px;
    }

    .booking-card {
        padding: 22px 16px;
        border-radius: 16px;
    }

    .booking-progress-bar {
        padding: 5px 8px;
        margin-bottom: 20px;
    }

    .booking-progress-step {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        padding: 4px 2px;
        gap: 4px;
        font-size: 0.7rem;
    }

    .booking-progress-divider {
        flex: 0 0 10px;
        min-width: 0;
    }

    .booking-step-number {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .booking-step h2 {
        font-size: 1.1rem;
    }

    .study-item-body {
        padding: 14px;
    }

    .study-item-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .apple-calendar {
        padding: 16px 10px 14px;
    }

    .apple-cal-grid {
        column-gap: 0;
    }

    .apple-cal-cell {
        width: min(100%, 42px);
        height: auto;
        aspect-ratio: 1;
    }

    .apple-time-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apple-summary-pill {
        max-width: min(140px, 42vw);
    }
}

@media (max-width: 360px) {
    .booking-progress-step .step-title {
        display: none;
    }

    .booking-progress-divider {
        flex-basis: 16px;
    }

    .apple-cal-month {
        font-size: 1.1rem;
    }

    .apple-cal-year {
        font-size: 0.9rem;
    }
}

@media print {
    .booking-brand-logo {
        max-height: 50px;
    }
}
