:root,
[data-theme="dark"] {
    /* DEFAULT DARK NATURE THEME */
    --primary: #10b981;
    --primary-hover: #059669;
    --bg: #031008;
    --card-bg: #091a10;
    --text: #ecfdf5;
    --text-muted: #6ee7b7;
    --border: #142a1b;
    --accent: #fbbf24;
    --danger: #f87171;
    --gradient: linear-gradient(135deg, #059669 0%, #84cc16 35%, #eab308 70%, #d97706 100%);
    /* Nature Sunset (Green to Yellow to Orange) */
    --font-sans: 'Inter', system-ui, sans-serif;
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --primary: #047857;
    --primary-hover: #065f46;
    --bg: #f3faf5;
    /* Fresh morning dew green */
    --card-bg: #ffffff;
    --text: #064e3b;
    --text-muted: #059669;
    --border: #e2f2e9;
    --accent: #ca8a04;
    --danger: #dc2626;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.2) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2.5rem;
}

.success-icon-circle {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
    position: relative;
    z-index: 2;
    animation: checkmark 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both, pulse-soft 2s infinite;
}

.success-icon-circle i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    line-height: 1;
}

.success-icon-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse-soft 2s infinite 0.5s;
    z-index: 1;
}

.resa-container {
    max-width: 1200px;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    background: var(--gradient);
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    /* Force white text for rainbow background readability */
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 500;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.header-logo {
    height: 70px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.4rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-session {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-center {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 500;
}

.session-btn {
    background: white;
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.session-btn:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

.session-btn.logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.session-btn.logout:hover {
    background: var(--danger);
    border-color: var(--danger);
}


.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Modern Stepper */
.modern-stepper-container {
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border);
}

.modern-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.modern-stepper .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.modern-stepper .step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.modern-stepper .step-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.modern-stepper .step.active {
    color: var(--primary);
}

.modern-stepper .step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: scale(1.15);
}

.modern-stepper .step-divider {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 10px;
    position: relative;
    top: -10px;
    z-index: 1;
}

.step-indicator:not(.modern-stepper) {
    display: none !important;
}

.content {
    padding: 2.5rem;
}

.form-section {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.form-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

#step-1 .grid,
#step-2 .grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 450px));
    justify-content: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group-small {
    margin-bottom: 1.5rem;
    width: 50%;
}

.selection-grid,
.timeslot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.timeslot-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.selection-card,
.timeslot-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeslot-card {
    padding: 0.75rem 0.5rem;
    gap: 0.25rem;
    font-size: 0.9rem;
    border-radius: 0.75rem;
}

.selection-card .card-icon {
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.8;
    transition: all 0.25s ease;
}

.selection-card:hover:not(.disabled),
.timeslot-card:hover:not(.disabled) {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.selection-card:hover .card-icon {
    transform: scale(1.2);
    opacity: 1;
}

.selection-card.selected,
.timeslot-card.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.selection-card.selected .card-icon {
    color: white;
}

.selection-card.disabled,
.timeslot-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--border);
    filter: grayscale(1);
    transform: none !important;
    box-shadow: none !important;
}

.timeslot-card .capacity-tag {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
}

.selection-placeholder,
.timeslot-placeholder {
    grid-column: 1 / -1;
    padding: 2.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border);
    border-radius: 1.25rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

.client-participants-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
    transition: all 0.4s ease;
}

.client-participants-grid.single-column {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
}

.address-collapsible {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.collapsible-header .toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.address-collapsible.active .collapsible-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: var(--primary);
}

.address-collapsible.active .toggle-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

.collapsible-content {
    display: none;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

.step-3-intro {
    max-width: 500px;
    margin: 0 auto 3rem;
    text-align: center;
    background: rgba(99, 102, 241, 0.05);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.insurance-note {
    font-size: 0.9rem;
    color: var(--danger);
    background: rgba(220, 38, 38, 0.08);
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-left: 4px solid var(--danger);
    line-height: 1.5;
    text-align: left;
}

.step-3-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text);
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.flatpickr-alt-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem !important;
    cursor: pointer !important;
}

[data-theme="dark"] .flatpickr-alt-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236ee7b7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
}

.btn {
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--primary);
    color: var(--primary);
}

/* Bouton "Réserver sans les participants" */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
    filter: brightness(1.07);
}

.btn-warning:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badge rouge sur le bouton d'onglet "Participants en attente" */
.pending-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    animation: pulseRed 2s infinite;
    line-height: 1;
}

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%       { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.session-btn-pending {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.session-btn-pending:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

.footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
}

.summary-card {
    display: grid;
    gap: 1.5rem;
}

.summary-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.summary-section:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.summary-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.summary-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.summary-detail .detail-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.detail-content label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    text-transform: none;
    font-weight: 400;
}

.detail-content span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.participants-list-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.participant-chip {
    background: var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.participant-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.participant-card.collapsed {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
}

.participant-card.collapsed:hover {
    background: rgba(255, 255, 255, 0.1);
}

.participant-card.collapsed .grid {
    display: none;
}

.participant-card .collapsed-header {
    display: none;
}

.participant-card.collapsed .collapsed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-header-text {
    font-weight: 600;
}

.remove-participant {
    color: var(--danger);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.participant-card.collapsed .remove-participant:not(.collapsed-header *) {
    display: none;
}

.participant-card:not(.collapsed) .remove-participant:not(.collapsed-header *) {
    display: block;
    margin-top: 1rem;
}

#summary-card {
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--primary);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 2rem;
}

.child-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    margin-top: 0.5rem;
    font-weight: 600;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#next-btn {
    margin-left: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.stepper-btn {
    width: 40px;
    height: 40px;
    border-radius: 0.4rem;
    border: none;
    background: var(--border);
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-btn:hover {
    background: var(--primary);
    color: white;
}

.stepper input {
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-size: 1.2rem;
    font-weight: 700;
    pointer-events: none;
}

/* Flatpickr Custom - Premium Redesign */
.flatpickr-calendar {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 1.25rem !important;
    font-family: var(--font-sans) !important;
    padding: 12px !important;
    backdrop-filter: blur(15px);
    animation: flatpickrFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 320px !important;
}

@keyframes flatpickrFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.flatpickr-calendar:before,
.flatpickr-calendar:after {
    display: none !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text) !important;
    fill: var(--text) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    font-weight: 700 !important;
    padding: 2px 8px;
    border-radius: 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--bg) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text) !important;
    fill: var(--text) !important;
    padding: 10px !important;
    transition: all 0.2s ease;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--primary) !important;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
}

.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
}

.flatpickr-day {
    color: var(--text) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
    margin: 2px !important;
    height: 35px !important;
    line-height: 33px !important;
}

.flatpickr-day:hover {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--primary) !important;
    transform: translateY(-1px);
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    font-weight: 700;
}

.flatpickr-day.selected:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-muted) !important;
    opacity: 0.25 !important;
    background: transparent !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-muted) !important;
    opacity: 0.4;
}

.flatpickr-day.inRange {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.group-badge {
    display: inline-block;
    background: #40c057;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Flatpickr Premium Design */
.flatpickr-calendar {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 1.25rem !important;
    padding: 0.5rem !important;
    font-family: var(--font-sans) !important;
}

.flatpickr-calendar.inline {
    width: 100% !important;
    box-shadow: none !important;
    margin: 0.5rem 0 !important;
}

#date-input {
    display: none;
}

.flatpickr-day {
    border-radius: 0.75rem !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.flatpickr-day.today.selected {
    color: white !important;
    background: var(--primary) !important;
}

.flatpickr-day:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--primary) !important;
}

.flatpickr-current-month {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
}

.flatpickr-weekday {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.flatpickr-alt-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem !important;
    cursor: pointer !important;
}

[data-theme="dark"] .flatpickr-alt-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236ee7b7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
}

/* Planning View Styles */
.planning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.booking-row {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.booking-main-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.booking-secondary-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

.validation-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(251, 191, 36, 0.1);
    border: 1px dashed var(--accent);
    padding: 0.4rem 0.75rem;
    border-radius: 0.75rem;
    min-width: 100px;
}

.v-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.v-code {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0.1em;
    word-break: break-all;
}

.success-validation-code {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0.2em;
    word-break: break-all;
}

.booking-row:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.time-slot {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.client-info {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.client-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-tag {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.material-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    letter-spacing: 0.05em;
}

.status-paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.status-unpaid {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Touch-friendly buttons for the receptionist */
button.toggle-payment-btn {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    padding: 0.6rem 1.2rem !important;
    border-radius: 0.6rem !important;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button.toggle-payment-btn.status-unpaid {
    background: var(--danger) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3) !important;
}

button.toggle-payment-btn.status-unpaid:hover {
    background: #e03131 !important;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-2px);
}

button.toggle-payment-btn.deposit-solde {
    background: #d97706 !important; /* warm amber color */
    color: white !important;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3) !important;
}

button.toggle-payment-btn.deposit-solde:hover {
    background: #b45309 !important;
    box-shadow: 0 6px 15px rgba(217, 119, 6, 0.4) !important;
    transform: translateY(-2px);
}

button.toggle-payment-btn:active {
    transform: translateY(1px);
}

.booking-price-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 5rem;
    color: var(--text-muted);
}

.stats-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--surface2);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Stock Panel */
.stock-panel {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
}

.stock-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

.stock-live-badge i {
    font-size: 0.45rem;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.stock-center-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.stock-center-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.stock-center-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stock-type-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.stock-type-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.stock-type-numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stock-remaining {
    font-weight: 800;
    font-size: 1rem;
}

.stock-total {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stock-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stock-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.stock-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 900px) {
    .booking-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .booking-main-info {
        min-width: 0;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .booking-secondary-info {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .course-tag {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .booking-row {
        padding: 0.75rem;
    }

    .booking-main-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .booking-main-info .time-slot {
        font-size: 1.1rem;
    }

    .booking-main-info .validation-box {
        min-width: auto;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.3rem 0.6rem;
    }

    .booking-secondary-info {
        flex-direction: column;
        align-items: stretch;
    }

    .booking-secondary-info > div:last-child {
        align-items: stretch !important;
        text-align: left !important;
    }

    .booking-price-status {
        text-align: left;
        align-items: flex-start;
    }

    .stock-panel {
        padding: 1rem;
    }

    .stock-grid {
        grid-template-columns: 1fr;
    }
}

/* intl-tel-input full width */
.iti { width: 100%; }

/* Capacity Notification Banner */
.capacity-notification {
    margin: 1rem 0;
    animation: slideInNotif 0.3s ease-out;
}

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

.capacity-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 1rem;
    color: var(--text);
    font-size: 0.9rem;
}

.capacity-notification-content > i {
    color: var(--accent, #fbbf24);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.capacity-notification-content strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.capacity-notification-content p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.4;
}

.capacity-notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.capacity-notification-close:hover {
    opacity: 1;
}

/* App Info Footer */
.app-info-footer {
    width: 100%;
    max-width: 1100px;
    margin: 2rem auto 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.footer-time {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.footer-time i {
    color: var(--primary);
}

.footer-time #footer-clock {
    color: var(--text);
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.separator {
    opacity: 0.3;
}

.footer-branding {
    opacity: 0.7;
}

.footer-user-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

@media (max-width: 768px) {
    .app-info-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        border-radius: 0;
        margin-top: 1rem;
    }
}

/* Responsiveness */
@media (max-width: 1024px) {
    /* Tablet specific adaptations */
    .client-participants-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    #step-1 .grid,
    #step-2 .grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 1.5rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .resa-container {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

@media (max-width: 768px) {
    body {
        display: block;
        padding: 0;
        margin: 0;
        background: var(--card-bg);
    }

    .resa-container {
        margin: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .resa-container > form {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center !important;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .header-branding {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 0.75rem;
    }

    .header-logo {
        height: 40px;
        width: auto;
        padding: 0.2rem;
    }

    .header-branding div p {
        display: none;
    }

    header h1 {
        font-size: 1.2rem;
        margin: 0;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .user-session {
        flex-direction: row;
        width: auto;
        padding: 0;
        background: transparent;
        border: none;
        gap: 0.5rem;
    }
    
    .user-info {
        display: none;
    }

    .modern-stepper-container {
        padding: 1rem 0.5rem;
        overflow-x: auto;
    }

    .modern-stepper {
        min-width: 320px;
    }

    .modern-stepper .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .modern-stepper .step-text {
        font-size: 0.65rem;
    }

    .modern-stepper .step-divider {
        margin: 0 4px;
        top: -8px;
    }

    .content {
        padding: 1.5rem 1rem;
        flex: 1;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    #step-3 .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    .input-group-small {
        width: 100%;
    }

    .flatpickr-calendar {
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto !important;
    }

    .footer {
        padding: 1rem;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .footer .btn {
        width: 100%;
        padding: 1rem;
    }
    
    #next-btn {
        margin-left: 0;
    }

    .participant-card {
        padding: 1rem;
    }

    #summary-card {
        padding: 1rem;
    }
    
    .selection-grid,
    .timeslot-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .planning-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1rem;
    }

    .date-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-selector span {
        font-size: 1rem !important;
        min-width: auto !important;
    }

    .stats-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.6rem 0.75rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .v-code {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }

    .success-validation-code {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
    }
}

/* Scroll indicators for mobile */
.scroll-indicator {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: var(--primary);
    font-size: 1.8rem;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    opacity: 0;
    visibility: hidden; pointer-events: none;
}

.scroll-indicator.active {
    opacity: 0.9;
    visibility: visible;
}

.scroll-indicator.down {
    bottom: 100px;
}

.scroll-indicator.up {
    top: 100px;
}

.scroll-indicator i {
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
    animation: bounce-shimmer 2s infinite ease-in-out;
}

@keyframes bounce-shimmer {
    0%, 100% { 
        transform: translateY(0);
        text-shadow: 0 0 0 var(--primary);
        opacity: 0.5;
    }
    50% { 
        transform: translateY(10px);
        text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
        opacity: 1;
    }
}

.scroll-indicator.up i {
    animation-name: bounce-shimmer-up;
}

@keyframes bounce-shimmer-up {
    0%, 100% { 
        transform: translateY(0);
        text-shadow: 0 0 0 var(--primary);
        opacity: 0.5;
    }
    50% { 
        transform: translateY(-10px);
        text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .scroll-indicator {
        display: block;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .selection-grid,
    .timeslot-grid {
        grid-template-columns: 1fr;
    }
}

/* CGV Iframe Drawer */
.cgv-drawer {
    margin-top: 1rem;
    height: 0;
    overflow: hidden;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    position: relative;
    width: 100%;
}

.cgv-drawer.open {
    height: 450px;
    opacity: 1;
    margin-bottom: 1.5rem;
}

.cgv-content-body {
    width: 100%;
    height: calc(100% - 40px);
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
    color: #333;
    line-height: 1.6;
}

.cgv-content-body p { margin-bottom: 1rem; }

.cgv-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border);
    height: 40px;
}

.cgv-drawer-header span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cgv-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cgv-close-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.cgv-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
    transition: filter 0.2s;
}

.cgv-link:hover {
    filter: brightness(1.2);
}
/* Custom Flatpickr styles to only show days of the current month */
.flatpickr-day.prevMonthDay {
    visibility: hidden; pointer-events: none;
}

.flatpickr-day.nextMonthDay {
    display: none;
}

/* Custom Modal / Alert */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

.custom-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient);
}

.custom-modal-icon.fun-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    color: white;
    border-radius: 50% 50% 50% 10%; /* Funky shape */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    animation: wobble 1s ease-in-out infinite alternate;
    transform-origin: bottom center;
}

@keyframes wobble {
    0% { transform: rotate(-8deg) scale(1); }
    100% { transform: rotate(8deg) scale(1.1); }
}

.custom-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.custom-modal-message {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.custom-modal-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 1rem;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.custom-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}

.custom-modal-btn:active {
    transform: translateY(-1px);
}

/* Tablet Landscape Optimization (Kiosk Mode) */
@media (min-width: 1024px) and (orientation: landscape) {
    /* Support both .resa-container and direct body padding if not in iframe */
    body:not(.iframe-body) {
        padding: 0;
        align-items: stretch;
    }

    .resa-container {
        max-width: none;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }

    .content {
        flex: 1;
        padding: 2.5rem 4rem; /* Slightly less padding for widgets */
        display: flex;
        flex-direction: column;
    }

    .form-section {
        flex: 1;
    }

    #step-1 .grid, 
    #step-2 .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
        max-width: none;
    }

    .selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .timeslot-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .client-participants-grid {
        grid-template-columns: 1fr 1.2fr;
        gap: 4rem;
    }

    .step-3-intro {
        max-width: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        text-align: left;
        align-items: center;
        padding: 2.5rem;
        background: rgba(99, 102, 241, 0.03);
    }

    .insurance-note {
        margin-bottom: 0;
    }

    .step-3-label {
        text-align: center;
    }

    #course-details {
        margin-top: 3rem;
        padding: 2rem;
    }

    .footer {
        padding: 2rem 6rem;
        position: sticky;
        bottom: 0;
        z-index: 100;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    }

    /* Success Page Tablet Optimization */
    .success-page-content {
        max-width: 1000px !important;
        display: grid !important;
        grid-template-columns: 1fr 1.5fr;
        gap: 4rem;
        text-align: left !important;
        align-items: center;
    }

    .success-icon-wrapper {
        margin: 0 !important;
        width: 150px;
        height: 150px;
    }

    .success-icon-circle {
        font-size: 5rem;
    }
}
