﻿/* ============================================
   TURN WIZARD - YASHAT.IR
   Unified responsive design for appointment booking
   Author: Refactor 2025
   ============================================ */

:root {
    --tw-primary: #006aff;
    --tw-primary-dark: #0052cc;
    --tw-primary-light: #e0eaff;
    --tw-gradient: linear-gradient(135deg, #006aff 0%, #00d4ff 100%);
    --tw-success: #10b981;
    --tw-success-light: #d1fae5;
    --tw-danger: #ef4444;
    --tw-danger-light: #fee2e2;
    --tw-warning: #f59e0b;
    --tw-gray-50: #f8fafc;
    --tw-gray-100: #f1f5f9;
    --tw-gray-200: #e2e8f0;
    --tw-gray-300: #cbd5e1;
    --tw-gray-400: #94a3b8;
    --tw-gray-500: #64748b;
    --tw-gray-600: #475569;
    --tw-gray-700: #334155;
    --tw-gray-800: #1e293b;
    --tw-radius-sm: 12px;
    --tw-radius: 16px;
    --tw-radius-lg: 24px;
    --tw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --tw-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --tw-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --tw-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============== Wizard Container ============== */
.tw-wizard {
    font-family: 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
    direction: rtl;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.tw-wizard__header {
    text-align: center;
    margin-bottom: 32px;
}

.tw-wizard__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tw-gray-800);
    margin-bottom: 8px;
}

.tw-wizard__subtitle {
    font-size: 0.95rem;
    color: var(--tw-gray-500);
    margin: 0;
}

/* ============== Stepper ============== */
.tw-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: var(--tw-radius-lg);
    padding: 20px 24px;
    margin-bottom: 32px;
    box-shadow: var(--tw-shadow);
    position: relative;
    overflow: hidden;
}

.tw-stepper__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.4;
    transition: var(--tw-transition);
}

    .tw-stepper__item.is-active,
    .tw-stepper__item.is-completed {
        opacity: 1;
    }

.tw-stepper__circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tw-gray-200);
    color: var(--tw-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    transition: var(--tw-transition);
    border: 3px solid transparent;
}

.tw-stepper__item.is-active .tw-stepper__circle {
    background: var(--tw-gradient);
    color: white;
    box-shadow: 0 0 0 4px var(--tw-primary-light);
    transform: scale(1.05);
}

.tw-stepper__item.is-completed .tw-stepper__circle {
    background: var(--tw-success);
    color: white;
}

    .tw-stepper__item.is-completed .tw-stepper__circle::after {
        content: '✓';
        font-size: 1.2rem;
    }

    .tw-stepper__item.is-completed .tw-stepper__circle span {
        display: none;
    }

.tw-stepper__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tw-gray-500);
    text-align: center;
    transition: var(--tw-transition);
}

.tw-stepper__item.is-active .tw-stepper__label {
    color: var(--tw-primary);
    font-weight: 700;
}

.tw-stepper__item.is-completed .tw-stepper__label {
    color: var(--tw-success);
}

.tw-stepper__line {
    flex: 1;
    height: 2px;
    background: var(--tw-gray-200);
    margin: 0 8px;
    margin-bottom: 30px;
    transition: var(--tw-transition);
    position: relative;
}

    .tw-stepper__line.is-completed {
        background: var(--tw-success);
    }

/* ============== Step Panels ============== */
.tw-step {
    display: none;
    animation: twFadeIn 0.4s ease-out;
}

    .tw-step.is-active {
        display: block;
    }

@keyframes twFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tw-card {
    background: white;
    border-radius: var(--tw-radius-lg);
    padding: 28px;
    box-shadow: var(--tw-shadow);
    border: 1px solid var(--tw-gray-100);
}

.tw-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tw-gray-800);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .tw-card__title i {
        color: var(--tw-primary);
        font-size: 1.5rem;
    }

.tw-card__subtitle {
    font-size: 0.9rem;
    color: var(--tw-gray-500);
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tw-gray-100);
}

/* ============== Doctor Card (Step 1) ============== */
.tw-doctor-card {
    display: flex;
    gap: 24px;
    align-items: center;
    background: var(--tw-gray-50);
    border-radius: var(--tw-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.tw-doctor-card__avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--tw-shadow);
    flex-shrink: 0;
}

.tw-doctor-card__info {
    flex: 1;
}

.tw-doctor-card__name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tw-gray-800);
    margin-bottom: 4px;
}

.tw-doctor-card__specialty {
    font-size: 0.95rem;
    color: var(--tw-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.tw-doctor-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--tw-gray-500);
}

.tw-doctor-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .tw-doctor-card__meta-item i {
        color: var(--tw-primary);
    }

/* ============== Step 2: Auth ============== */
.tw-auth-tabs {
    display: flex;
    background: var(--tw-gray-100);
    border-radius: var(--tw-radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.tw-auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    color: var(--tw-gray-500);
    cursor: pointer;
    transition: var(--tw-transition);
    font-size: 0.9rem;
}

    .tw-auth-tab.is-active {
        background: white;
        color: var(--tw-primary);
        box-shadow: var(--tw-shadow-sm);
    }

.tw-form-group {
    margin-bottom: 18px;
}

.tw-form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tw-gray-700);
    margin-bottom: 8px;
}

    .tw-form-label .tw-required {
        color: var(--tw-danger);
        margin-right: 3px;
    }

.tw-form-input,
.tw-form-select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--tw-gray-200);
    border-radius: var(--tw-radius-sm);
    font-size: 0.95rem;
    background: white;
    color: var(--tw-gray-800);
    transition: var(--tw-transition);
    font-family: inherit;
    direction: rtl;
}

    .tw-form-input:focus,
    .tw-form-select:focus {
        outline: none;
        border-color: var(--tw-primary);
        box-shadow: 0 0 0 4px var(--tw-primary-light);
    }

    .tw-form-input.is-error,
    .tw-form-select.is-error {
        border-color: var(--tw-danger);
    }

    .tw-form-input:read-only {
        background: var(--tw-gray-50);
        color: var(--tw-gray-500);
    }

.tw-form-error {
    display: none;
    color: var(--tw-danger);
    font-size: 0.8rem;
    margin-top: 5px;
    padding-right: 4px;
}

    .tw-form-error.is-visible {
        display: block;
    }

.tw-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tw-form-grid--full {
    grid-column: 1 / -1;
}

/* Gender Radio */
.tw-radio-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.tw-radio {
    flex: 1;
    position: relative;
    cursor: pointer;
}

    .tw-radio input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.tw-radio__label {
    display: block;
    padding: 13px 16px;
    border: 1.5px solid var(--tw-gray-200);
    border-radius: var(--tw-radius-sm);
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tw-gray-600);
    transition: var(--tw-transition);
    background: white;
}

.tw-radio input:checked + .tw-radio__label {
    border-color: var(--tw-primary);
    background: var(--tw-primary-light);
    color: var(--tw-primary);
    box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.1);
}

/* ============== Step 3: Calendar ============== */
.tw-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.tw-day-card {
    background: white;
    border: 2px solid var(--tw-gray-200);
    border-radius: var(--tw-radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--tw-transition);
    position: relative;
    overflow: hidden;
}

    .tw-day-card:hover:not(.is-disabled) {
        border-color: var(--tw-primary);
        transform: translateY(-3px);
        box-shadow: var(--tw-shadow);
    }

    .tw-day-card.is-selected {
        border-color: var(--tw-primary);
        background: var(--tw-primary-light);
        box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.15);
    }

    .tw-day-card.is-disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: var(--tw-gray-50);
    }

.tw-day-card__weekday {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tw-gray-700);
    margin-bottom: 6px;
}

.tw-day-card__day {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tw-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.tw-day-card__month {
    font-size: 0.78rem;
    color: var(--tw-gray-500);
    margin-bottom: 10px;
}

.tw-day-card__badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.tw-day-card__badge--available {
    background: var(--tw-success-light);
    color: var(--tw-success);
}

.tw-day-card__badge--full {
    background: var(--tw-danger-light);
    color: var(--tw-danger);
}

/* Time Slots */
.tw-slots-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px dashed var(--tw-gray-200);
}

.tw-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.tw-slot {
    background: white;
    border: 1.5px solid var(--tw-gray-200);
    border-radius: var(--tw-radius-sm);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--tw-transition);
    font-family: inherit;
}

    .tw-slot:hover:not(.is-disabled) {
        border-color: var(--tw-primary);
        background: var(--tw-primary-light);
    }

    .tw-slot.is-selected {
        background: var(--tw-gradient);
        border-color: var(--tw-primary);
        color: white;
        box-shadow: 0 4px 12px rgba(0, 106, 255, 0.3);
        transform: scale(1.03);
    }

    .tw-slot.is-disabled {
        opacity: 0.4;
        cursor: not-allowed;
        background: var(--tw-gray-50);
    }

.tw-slot__time {
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
    display: block;
    margin-bottom: 4px;
}

.tw-slot__count {
    font-size: 0.72rem;
    color: var(--tw-gray-500);
    display: block;
}

.tw-slot.is-selected .tw-slot__count {
    color: rgba(255, 255, 255, 0.9);
}

.tw-slot.is-disabled .tw-slot__time {
    text-decoration: line-through;
}

/* ============== Step 4: Confirm + Timer ============== */
.tw-timer {
    background: var(--tw-gray-50);
    border-radius: var(--tw-radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid var(--tw-gray-200);
    transition: var(--tw-transition);
}

    .tw-timer.is-urgent {
        border-color: var(--tw-danger);
        background: var(--tw-danger-light);
        animation: twPulse 1.5s ease-in-out infinite;
    }

@keyframes twPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.tw-timer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tw-timer__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tw-gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .tw-timer__label i {
        color: var(--tw-primary);
        font-size: 1.2rem;
    }

.tw-timer.is-urgent .tw-timer__label i {
    color: var(--tw-danger);
}

.tw-timer__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tw-primary);
    font-family: 'Courier New', monospace;
    direction: ltr;
}

.tw-timer.is-urgent .tw-timer__value {
    color: var(--tw-danger);
}

.tw-timer__progress {
    height: 8px;
    background: var(--tw-gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.tw-timer__bar {
    height: 100%;
    background: var(--tw-gradient);
    border-radius: 10px;
    transition: width 1s linear, background 0.3s;
    width: 100%;
}

.tw-timer.is-urgent .tw-timer__bar {
    background: var(--tw-danger);
}

/* Summary */
.tw-summary {
    background: var(--tw-gray-50);
    border-radius: var(--tw-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.tw-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--tw-gray-200);
}

    .tw-summary__row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .tw-summary__row:first-child {
        padding-top: 0;
    }

.tw-summary__label {
    font-size: 0.88rem;
    color: var(--tw-gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .tw-summary__label i {
        color: var(--tw-primary);
        font-size: 1rem;
    }

.tw-summary__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tw-gray-800);
}

.tw-summary__value--price {
    font-size: 1.15rem;
    color: var(--tw-primary);
}

/* ============== Buttons ============== */
.tw-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tw-gray-100);
}

.tw-btn {
    padding: 14px 28px;
    border-radius: var(--tw-radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--tw-transition);
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.tw-btn--primary {
    background: var(--tw-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 106, 255, 0.3);
}

    .tw-btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 106, 255, 0.4);
        color: white;
    }

    .tw-btn--primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.tw-btn--outline {
    background: white;
    color: var(--tw-gray-600);
    border: 1.5px solid var(--tw-gray-200);
}

    .tw-btn--outline:hover {
        border-color: var(--tw-primary);
        color: var(--tw-primary);
        background: var(--tw-primary-light);
    }

.tw-btn--danger {
    background: white;
    color: var(--tw-danger);
    border: 1.5px solid var(--tw-danger-light);
}

    .tw-btn--danger:hover {
        background: var(--tw-danger-light);
    }

.tw-btn--success {
    background: var(--tw-success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

    .tw-btn--success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
        color: white;
    }

/* ============== Loader ============== */
.tw-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.tw-loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tw-gray-200);
    border-top-color: var(--tw-primary);
    border-radius: 50%;
    animation: twSpin 0.8s linear infinite;
}

@keyframes twSpin {
    to {
        transform: rotate(360deg);
    }
}

.tw-loader__text {
    font-size: 0.9rem;
    color: var(--tw-gray-500);
    font-weight: 600;
}

/* ============== Empty state ============== */
.tw-empty {
    text-align: center;
    padding: 40px 20px;
}

.tw-empty__icon {
    font-size: 3rem;
    color: var(--tw-gray-300);
    margin-bottom: 16px;
}

.tw-empty__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tw-gray-700);
    margin-bottom: 8px;
}

.tw-empty__text {
    font-size: 0.9rem;
    color: var(--tw-gray-500);
    margin-bottom: 20px;
}

/* ============== Responsive ============== */
@media (max-width: 768px) {
    .tw-wizard {
        padding: 12px;
    }

    .tw-card {
        padding: 20px 16px;
    }

    .tw-stepper {
        padding: 16px 12px;
    }

    .tw-stepper__circle {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .tw-stepper__label {
        font-size: 0.75rem;
    }

    .tw-stepper__line {
        margin-bottom: 24px;
    }

    .tw-doctor-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .tw-doctor-card__avatar {
        width: 80px;
        height: 80px;
    }

    .tw-doctor-card__meta {
        justify-content: center;
    }

    .tw-form-grid {
        grid-template-columns: 1fr;
    }

    .tw-days-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .tw-day-card {
        padding: 12px 8px;
    }

    .tw-day-card__day {
        font-size: 1.3rem;
    }

    .tw-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .tw-actions {
        flex-direction: column-reverse;
    }

    .tw-btn {
        width: 100%;
    }

    .tw-timer__value {
        font-size: 1.2rem;
    }
}

/* ============== Dark mode friendly scrollbar ============== */
.tw-wizard ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tw-wizard ::-webkit-scrollbar-thumb {
    background: var(--tw-gray-300);
    border-radius: 10px;
}

    .tw-wizard ::-webkit-scrollbar-thumb:hover {
        background: var(--tw-gray-400);
    }
/* ===== Rules Section ===== */
.tw-rules {
    background: var(--tw-gray-50);
    border: 1.5px solid var(--tw-gray-200);
    border-radius: var(--tw-radius);
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 4px;
}

.tw-rules__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--tw-gray-200);
    margin-bottom: 16px;
}

.tw-rules__header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--tw-primary-light);
    color: var(--tw-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.tw-rules__header-text {
    flex: 1;
}

.tw-rules__header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tw-gray-800);
    margin-bottom: 2px;
}

.tw-rules__header-sub {
    font-size: 0.8rem;
    color: var(--tw-gray-500);
}

.tw-rules__view-btn {
    background: white;
    border: 1.5px solid var(--tw-primary);
    color: var(--tw-primary);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--tw-transition);
    font-family: inherit;
    white-space: nowrap;
}

    .tw-rules__view-btn:hover {
        background: var(--tw-primary);
        color: white;
    }

/* Custom checkbox */
.tw-rules__agree {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

    .tw-rules__agree input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.tw-rules__agree-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--tw-gray-300);
    border-radius: 6px;
    background: white;
    flex-shrink: 0;
    position: relative;
    transition: var(--tw-transition);
    margin-top: 2px;
}

.tw-rules__agree input:checked + .tw-rules__agree-check {
    background: var(--tw-primary);
    border-color: var(--tw-primary);
}

    .tw-rules__agree input:checked + .tw-rules__agree-check::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 11px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: translate(-50%, -60%) rotate(45deg);
    }

.tw-rules__agree-text {
    font-size: 0.88rem;
    color: var(--tw-gray-700);
    line-height: 1.6;
}

/* Modal */
.tw-modal {
    border: none;
    border-radius: var(--tw-radius-lg);
    overflow: hidden;
}

.tw-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--tw-primary) 0%, #00d4ff 100%);
    color: white;
}

.tw-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.tw-modal__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tw-transition);
    font-size: 1rem;
}

    .tw-modal__close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

.tw-modal__body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.tw-modal__footer {
    padding: 16px 24px;
    background: var(--tw-gray-50);
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    border-top: 1px solid var(--tw-gray-100);
}

.tw-rules-list {
    padding-right: 24px;
    margin: 0;
    counter-reset: rules;
    list-style: none;
}

    .tw-rules-list li {
        counter-increment: rules;
        position: relative;
        padding: 12px 0 12px 0;
        padding-right: 44px;
        font-size: 0.92rem;
        line-height: 1.9;
        color: var(--tw-gray-700);
        border-bottom: 1px dashed var(--tw-gray-100);
    }

        .tw-rules-list li:last-child {
            border-bottom: none;
        }

        .tw-rules-list li::before {
            content: counter(rules);
            position: absolute;
            right: 0;
            top: 12px;
            width: 30px;
            height: 30px;
            background: var(--tw-primary-light);
            color: var(--tw-primary);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
        }

.tw-rules-list__hl {
    color: var(--tw-danger);
    font-weight: 700;
}
/* ============== Selected Day Banner ============== */
.tw-selected-day-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--tw-primary-light) 0%, #e6f7ff 100%);
    border: 1.5px solid rgba(0, 106, 255, 0.15);
    border-radius: var(--tw-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    animation: twSlideIn 0.4s ease-out;
}

@keyframes twSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tw-selected-day-banner__info {
    flex: 1;
    text-align: right;
}

.tw-selected-day-banner__label {
    font-size: 0.78rem;
    color: var(--tw-gray-500);
    font-weight: 600;
    margin-bottom: 2px;
}

.tw-selected-day-banner__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tw-primary);
}

.tw-selected-day-banner__back {
    background: white;
    border: 1.5px solid var(--tw-primary);
    color: var(--tw-primary);
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--tw-transition);
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

    .tw-selected-day-banner__back:hover {
        background: var(--tw-primary);
        color: white;
    }

/* Fade animations for view switch */
#tw_days_view,
#tw_slots_view {
    animation: twFadeIn 0.35s ease-out;
}

@media (max-width: 576px) {
    .tw-selected-day-banner {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .tw-selected-day-banner__back {
        width: 100%;
        justify-content: center;
    }

    .tw-selected-day-banner__info {
        text-align: center;
    }
}