/* ============================================
   OROPTICA - COMPANY TUNNEL
   Step-by-step with URL routing + Booking + Questionnaire
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: 72px;
}

/* ===== SUB BAR ===== */
.co-subbar {
    position: sticky;
    top: 72px;
    z-index: 99;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.co-subbar-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.co-topbar-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.co-topbar-step {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
}

.co-topbar-close {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.co-topbar-close:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.co-topbar-close .material-symbols-outlined { font-size: 1.125rem; }

/* ===== PROGRESS BAR ===== */
.co-progress {
    height: 3px;
    background: #f1f5f9;
    position: sticky;
    top: 113px;
    z-index: 98;
}

.co-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 0 3px 3px 0;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== MAIN ===== */
.co-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem 8rem;
}

.co-container {
    width: 100%;
    max-width: 560px;
}

/* ===== STEPS ===== */
.co-step {
    display: none;
}

.co-step.active {
    display: block;
    animation: coFadeIn 0.4s ease;
}

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

/* Step header */
.co-step-header {
    margin-bottom: 1.75rem;
}

.co-step-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.co-step-icon .material-symbols-outlined {
    font-size: 1.625rem;
    color: white;
}

.co-step-number {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.co-step-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.co-step-desc {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
}

/* ===== CARDS ===== */
.co-card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
    margin-bottom: 0.75rem;
}

.co-card:last-child { margin-bottom: 0; }

.co-card-title {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.co-card-title .material-symbols-outlined {
    font-size: 1.125rem;
    color: #94a3b8;
}

/* ===== FORM ELEMENTS ===== */
.co-label {
    color: #94a3b8;
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
    display: block;
}

.co-input {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

.co-input::placeholder { color: #cbd5e1; font-weight: 500; }

.co-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
    outline: none;
}

textarea.co-input {
    min-height: 5rem;
    padding: 0.75rem 0.875rem;
    resize: vertical;
    line-height: 1.5;
}

.co-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.co-form-group { margin-bottom: 0.75rem; }
.co-form-group:last-child { margin-bottom: 0; }

/* ===== SELECT ===== */
.co-select {
    width: 100%;
    height: 2.75rem;
    padding: 0 2.5rem 0 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.co-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
    outline: none;
}

/* ===== MOTIF GRID ===== */
.co-motif-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.co-motif-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.co-motif-btn .material-symbols-outlined {
    font-size: 1.75rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.co-motif-btn:hover {
    border-color: #bfdbfe;
    background: #fafbff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

.co-motif-btn.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.co-motif-btn.selected .material-symbols-outlined { color: #3b82f6; }

/* ===== SPECIALIST GRID ===== */
.co-specialist-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.co-specialist-placeholder {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 1.5rem 0;
    width: 100%;
}

.co-specialist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-width: 100px;
    flex: 1;
}

.co-specialist-card:hover {
    border-color: #bfdbfe;
    background: #fafbff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

.co-specialist-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.co-specialist-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.co-specialist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.co-specialist-avatar .material-symbols-outlined {
    font-size: 1.75rem;
    color: #94a3b8;
}

.co-specialist-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

/* ===== CALENDAR ===== */
.co-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.co-cal-month {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.co-cal-nav {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.co-cal-nav:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.co-cal-nav .material-symbols-outlined { font-size: 1.125rem; }

.co-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.co-cal-day-header {
    text-align: center;
    font-size: 0.625rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0;
}

.co-cal-day {
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    padding: 0.5rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.co-cal-day:hover:not(.past):not(.other-month) {
    background: #eff6ff;
    color: #2563eb;
}

.co-cal-day.other-month { color: #d1d5db; pointer-events: none; }
.co-cal-day.past { color: #d1d5db; pointer-events: none; }
.co-cal-day.today { background: #f1f5f9; font-weight: 800; }

.co-cal-day.selected {
    background: #3b82f6;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* ===== TIME SLOTS ===== */
.co-timeslots-section { margin-top: 0.5rem; }

.co-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.co-slots-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.co-slots-placeholder .material-symbols-outlined {
    font-size: 1.5rem;
    color: #cbd5e1;
}

.co-slot-btn {
    height: 2.5rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
}

.co-slot-btn:hover:not(:disabled) {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.co-slot-btn.selected {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.co-slot-btn.unavailable {
    color: #d1d5db;
    border-color: #f1f5f9;
    background: #fafafa;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ===== RECAP ===== */
.co-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.co-recap-row:last-child { border-bottom: none; }

.co-recap-label {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 600;
}

.co-recap-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

/* ===== FOOTER NAV ===== */
.co-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-top: 1px solid #f1f5f9;
}

.co-footer-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.co-footer-left { display: flex; align-items: center; }
.co-footer-right { display: flex; align-items: center; gap: 0.625rem; }

.co-btn-cancel {
    color: #94a3b8;
    font-weight: 600;
    padding: 0 0.75rem;
    height: 2.5rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    text-decoration: none;
}

.co-btn-cancel:hover { color: #475569; }

.co-btn-prev {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    padding: 0 1.25rem;
    height: 2.5rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
    font-family: inherit;
}

.co-btn-prev:hover {
    border-color: #cbd5e1;
    color: #1e293b;
    background: #fafafa;
}

.co-btn-prev .material-symbols-outlined { font-size: 1rem; }

.co-btn-next {
    background: #3b82f6;
    color: white;
    padding: 0 1.5rem;
    height: 2.5rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px -3px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
    font-family: inherit;
}

.co-btn-next:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px -3px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.co-btn-next:active { transform: scale(0.98) translateY(0); }
.co-btn-next .material-symbols-outlined { font-size: 1.125rem; }

/* ===== FINISH SCREEN ===== */
.co-finish {
    text-align: center;
    padding: 2rem 0 1rem;
}

.co-finish-check {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: coPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.co-finish-check .material-symbols-outlined {
    font-size: 2.75rem;
    color: #16a34a;
    font-variation-settings: 'FILL' 1;
}

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

.co-finish-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin-bottom: 0.625rem;
    line-height: 1.3;
}

.co-finish-desc {
    font-size: 0.9375rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Success recap */
.co-success-recap {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
    display: inline-block;
    min-width: 320px;
    max-width: 100%;
}

.co-success-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.co-success-row:last-child { border-bottom: none; }

.co-success-label {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 600;
}

.co-success-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

.co-btn-done {
    background: #16a34a;
    color: white;
    padding: 0 2.25rem;
    height: 3rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px -3px rgba(22, 163, 74, 0.4);
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.co-btn-done:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.co-btn-done .material-symbols-outlined { font-size: 1.25rem; }

/* ===== PRE-FILL BUTTON ===== */
.co-prefill-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
    margin-bottom: 0;
}

.co-prefill-btn:hover {
    border-color: #bfdbfe;
    background: #fafbff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

.co-prefill-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
}

.co-prefill-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
}

.co-prefill-icon .material-symbols-outlined {
    font-size: 1.375rem;
    color: white;
}

.co-prefill-content { flex: 1; min-width: 0; }

.co-prefill-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.125rem;
}

.co-prefill-desc {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.4;
}

.co-prefill-chevron {
    font-size: 1.25rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.co-prefill-btn.active .co-prefill-chevron {
    transform: rotate(180deg);
}

/* ===== QUESTIONNAIRE ===== */
.co-questionnaire {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
}

.co-questionnaire.open {
    max-height: 5000px;
    opacity: 1;
}

.co-questionnaire .co-card {
    border-radius: 0;
    border-left: 1.5px solid #e2e8f0;
    border-right: 1.5px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    border-top: none;
    margin-bottom: 0;
    box-shadow: none;
}

.co-questionnaire .co-card:last-of-type {
    border-radius: 0 0 16px 16px;
    border-bottom: 1.5px solid #e2e8f0;
}

/* ===== OPTION CARDS ===== */
.co-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.co-option {
    padding: 0.875rem;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-family: inherit;
    text-align: left;
}

.co-option:hover {
    border-color: #bfdbfe;
    background: #fafbff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

.co-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.co-option-radio {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.co-option.selected .co-option-radio {
    border-color: #3b82f6;
    background: #3b82f6;
}

.co-option.selected .co-option-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.co-option-content { flex: 1; min-width: 0; }

.co-option-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.co-option.selected .co-option-label { color: #1e40af; }

/* Badges */
.co-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 100px;
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.co-badge--blue   { background: #dbeafe; color: #1d4ed8; }
.co-badge--green  { background: #dcfce7; color: #166534; }
.co-badge--amber  { background: #fef3c7; color: #92400e; }
.co-badge--purple { background: #ede9fe; color: #5b21b6; }
.co-badge--pink   { background: #fce7f3; color: #9d174d; }

/* ===== SEGMENTED CONTROL ===== */
.co-segments {
    display: inline-flex;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    gap: 3px;
    flex-wrap: wrap;
}

.co-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.125rem;
    padding: 0 0.875rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.co-segment:hover { color: #475569; background: rgba(255, 255, 255, 0.5); }

.co-segment.selected {
    background: white;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ===== SWITCH TOGGLE ===== */
.co-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
}

.co-switch-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.co-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    height: 28px;
    width: 48px;
    align-items: center;
    border-radius: 9999px;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.25s ease;
    border: none;
    padding: 0;
}

.co-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.co-switch-knob {
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.co-switch:has(input:checked) .co-switch-knob {
    transform: translateX(20px) translateY(-50%);
}

.co-switch:has(input:checked) { background: #3b82f6; }

/* ===== RX TABLE ===== */
.co-rx-wrapper {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.co-rx-wrapper.open {
    max-height: 300px;
    opacity: 1;
    margin-top: 1rem;
}

.co-rx-title {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.co-rx-title .material-symbols-outlined { font-size: 1rem; color: #94a3b8; }

.co-rx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.co-rx-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.25rem;
    border-bottom: 1.5px solid #e2e8f0;
    text-align: center;
}

.co-rx-table th:first-child { width: 48px; }

.co-rx-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.25rem;
    height: 2.75rem;
    vertical-align: middle;
}

.co-rx-table tr:last-child td { border-bottom: none; }

.co-rx-table td:first-child {
    text-align: center;
    font-weight: 800;
    font-size: 0.6875rem;
    color: #3b82f6;
    background: rgba(248, 250, 252, 0.5);
    letter-spacing: 0.02em;
}

.co-rx-table input {
    text-align: center;
    font-weight: 700;
    font-size: 0.8125rem;
    color: #0f172a;
    background: white;
    border: none;
    padding: 0.25rem;
    min-height: 2rem;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', system-ui, sans-serif;
    transition: background 0.15s;
}

.co-rx-table input:focus { background: #eff6ff; outline: none; }
.co-rx-table input::placeholder { color: #d1d5db; font-weight: 500; }
.co-rx-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.co-rx-table input[type="number"]::-webkit-inner-spin-button,
.co-rx-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.co-rx-unit { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 0.7rem; color: #94a3b8; font-weight: 600; }

/* ===== SAVE BUTTON ===== */
.co-btn-save {
    width: calc(100% - 3px);
    height: 3rem;
    border: none;
    border-radius: 0 0 16px 16px;
    background: #10b981;
    color: white;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-left: 1.5px;
    box-shadow: 0 4px 14px -3px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
}

.co-btn-save:hover { background: #059669; }
.co-btn-save .material-symbols-outlined { font-size: 1.25rem; }

/* ===== SAVED MESSAGE ===== */
.co-saved-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    margin-top: 0.75rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.co-saved-msg.show {
    opacity: 1;
    max-height: 60px;
}

.co-saved-msg .material-symbols-outlined {
    font-size: 1.125rem;
    font-variation-settings: 'FILL' 1;
}

/* ===== TOAST ===== */
.co-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    font-family: 'Inter', sans-serif;
    animation: coToastIn 0.3s ease;
}

.co-toast--error {
    background: #ef4444;
    color: white;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.co-toast--info {
    background: #3b82f6;
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.co-toast--out { animation: coToastOut 0.3s ease forwards; }

@keyframes coToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes coToastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    body { padding-top: 64px; }

    .co-main { padding: 1.5rem 1rem 7rem; }

    .co-step-title { font-size: 1.25rem; }

    .co-card { padding: 1.25rem; border-radius: 14px; }

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

    .co-options { grid-template-columns: 1fr; }

    .co-slots-grid { grid-template-columns: repeat(3, 1fr); }

    .co-subbar-inner { padding: 0.375rem 1rem; }
    .co-topbar-badge { display: none; }
    .co-subbar { top: 64px; }
    .co-progress { top: 97px; }

    .co-footer-inner { padding: 0.75rem 1rem; }

    .co-btn-prev span:not(.material-symbols-outlined) { display: none; }
    .co-btn-prev { padding: 0 0.625rem; }

    .co-finish-title { font-size: 1.25rem; }

    .co-prefill-btn { padding: 1rem 1.25rem; }

    .co-specialist-card { min-width: 80px; }

    .co-success-recap { min-width: auto; width: 100%; }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] body {
    font-family: 'Heebo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[dir="rtl"] .co-option { text-align: right; }
[dir="rtl"] .co-step-header { text-align: right; }

[dir="rtl"] .co-card-title,
[dir="rtl"] .co-rx-title { flex-direction: row-reverse; }

[dir="rtl"] .co-switch-row { flex-direction: row-reverse; }
[dir="rtl"] .co-switch-knob { left: auto; right: 3px; }
[dir="rtl"] .co-switch:has(input:checked) .co-switch-knob { transform: translateX(-20px) translateY(-50%); }

[dir="rtl"] .co-footer-inner { flex-direction: row-reverse; }
[dir="rtl"] .co-footer-right { flex-direction: row-reverse; }
[dir="rtl"] .co-btn-prev,
[dir="rtl"] .co-btn-next { flex-direction: row-reverse; }
[dir="rtl"] .co-btn-done { flex-direction: row-reverse; }

[dir="rtl"] .co-progress-bar { border-radius: 3px 0 0 3px; }
[dir="rtl"] .co-subbar-inner { flex-direction: row-reverse; }

[dir="rtl"] .co-prefill-btn { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .co-recap-row,
[dir="rtl"] .co-success-row { flex-direction: row-reverse; }
[dir="rtl"] .co-saved-msg { flex-direction: row-reverse; }
[dir="rtl"] .co-btn-save { flex-direction: row-reverse; }

[dir="rtl"] .co-select {
    padding: 0 0.875rem 0 2.5rem;
    background-position: left 0.75rem center;
}

[dir="rtl"] .co-cal-header { flex-direction: row-reverse; }

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .co-footer { padding-bottom: env(safe-area-inset-bottom); }
}
