        :root {
            --primary-color: #0f172a;
            /* Dark Navy from image */
            --primary-hover: #1e293b;
            --accent-color: #3b82f6;
            --text-main: #334155;
            --text-light: #64748b;
            --border-color: #e2e8f0;
            --bg-light: #ffffff;
        }

        body,
        html {
            margin: 0;
            padding: 0;
            height: 100%;
            font-family: 'Inter', sans-serif;
        }

        body {
            overflow-x: hidden;
        }

        .split-container {
            display: flex;
            height: 100vh;
            width: 100vw;
        }

        /* LEFT PANEL */
        .left-panel {
            width: 45%;
            background: #fff;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            /* Push content to top/bottom */
            padding: 40px 60px;
            /* Outer padding for logo/footer */
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
        }

        /* LOGO */
        .logo-container {
            width: 100%;
            height: 56px;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .logo-container img {
            max-height: 100%;
            max-width: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        /* Le repli <h2> site_name a disparu : brand_logo_url() renvoie toujours
           une image, celle du tenant ou le logo ManagTech. */

        /* CENTERED FORM WRAPPER */
        .left-panel-content {
            width: 100%;
            max-width: 400px;
            margin: 0 auto;
            /* Horizontally center the form itself */
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex-grow: 1;
            /* Take up available vertical space */
        }

        h1 {
            font-size: 2rem;
            font-weight: 700;
            color: #000;
            margin: 0 0 0.5rem 0;
        }

        .subtitle {
            font-size: 1rem;
            color: var(--text-light);
            margin-bottom: 2rem;
        }

        /* FORM STYLES */
        .form-group {
            margin-bottom: 1.25rem;
        }

        label {
            display: block;
            font-size: 0.9rem;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 0.5rem;
        }

        .input-wrapper {
            position: relative;
        }

        input[type="text"],
        input[type="password"],
        input[type="email"] {
            width: 100%;
            padding: 12px 16px;
            font-size: 0.95rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: #f8fafc;
            color: var(--text-main);
            box-sizing: border-box;
            transition: all 0.2s;
        }

        input:focus {
            outline: none;
            border-color: var(--accent-color);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .eye-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #64748b; /* WCAG AA pass (was #94a3b8 = 2.86:1, now #64748b = 4.54:1) */
            cursor: pointer;
            background: transparent;
            border: none;
            padding: 6px 8px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, color 0.2s;
        }

        .eye-icon:hover {
            color: var(--primary-color);
            background: rgba(15, 23, 42, 0.05);
        }

        .eye-icon:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
        }

        .form-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            font-size: 0.85rem;
        }

        .checkbox-container {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-main);
            font-weight: 500;
        }

        .remember-label {
            margin: 0;
            font-weight: 500;
        }

        .btn-primary {
            width: 100%;
            padding: 14px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

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

        .btn-primary:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
        }

        .btn-primary:disabled,
        .btn-primary.is-loading {
            opacity: 0.8;
            cursor: not-allowed;
        }

        .btn-spinner {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #fff;
            border-radius: 50%;
            display: none;
            animation: spin 0.7s linear infinite;
        }

        .btn-primary.is-loading .btn-spinner {
            display: inline-block;
        }

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

        /* Global focus-visible for links/buttons */
        a:focus-visible,
        button:focus-visible,
        .btn-secondary:focus-visible,
        .forgot-link:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
            border-radius: 6px;
        }

        /* Forgot password link */
        .forgot-link {
            color: #2563eb;
            font-weight: 600;
            text-decoration: none;
            font-size: 0.85rem;
        }

        .forgot-link:hover {
            text-decoration: underline;
        }

        /* Shared section pieces (were inline styles in the markup) */
        .section-intro {
            text-align: center;
            margin-bottom: 30px;
        }

        .subtitle--tight {
            margin-bottom: 0;
            max-width: 350px;
            margin-left: auto;
            margin-right: auto;
        }

        .helper-text {
            font-size: 0.9rem;
            color: var(--text-light);
            margin-bottom: 20px;
        }

        .btn-primary--spaced {
            margin-top: 25px;
        }

        .btn-secondary--spaced {
            margin-top: 20px;
        }

        .alert--after-btn {
            margin-top: 15px;
        }

        .label-start {
            text-align: start;
        }

        .field-hint {
            display: block;
            color: var(--text-light);
            font-size: 0.8rem;
            margin-top: 6px;
            text-align: start;
        }

        .text-center {
            text-align: center;
        }

        .otp-title {
            font-size: 1.5rem;
            margin-bottom: 10px;
        }

        .panel-title {
            font-size: 1.2rem;
            margin-bottom: 5px;
        }

        .panel-desc {
            color: var(--text-light);
            font-size: 0.9rem;
        }

        .btn-block {
            width: 100%;
        }

        /* NEW STYLES FOR RESET PASSWORD CARD */
        .auth-card {
            background: white;
            border-radius: 24px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
            padding: 40px;
            width: 100%;
            max-width: 450px;
            margin: 0 auto;
            border: 1px solid #f1f5f9;
        }

        .phone-input-group {
            display: flex;
            align-items: center;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: #fff;
            overflow: hidden;
            transition: all 0.2s;
        }

        .phone-input-group:focus-within {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .phone-prefix {
            padding: 12px 16px;
            background: #fff;
            color: #000;
            font-weight: 600;
            border-right: 1px solid #f1f5f9;
        }

        .phone-input-group input {
            border: none;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            padding-left: 12px;
        }

        .phone-input-group input:focus {
            box-shadow: none;
        }

        .back-link-wrapper {
            margin-top: 25px;
            text-align: center;
        }

        .back-link-wrapper a {
            color: #64748b;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: color 0.2s;
        }

        .back-link-wrapper a:hover {
            color: var(--primary-color);
        }

        @media (max-width: 900px) {
            .auth-card {
                padding: 25px;
            }

            .otp-slide-up {
                border-radius: 20px 20px 0 0;
            }
        }

        /* QR CODE SECTION STYLES */
        .auth-card--qr {
            padding: 20px;
            min-height: 450px;
        }

        .camera-error {
            background: #fef2f2;
            color: #991b1b;
            border: 1px solid #fee2e2;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 10px;
            font-size: 0.85rem;
        }

        .camera-error-hint {
            display: block;
            margin-top: 4px;
            color: var(--text-light);
        }

        .scan-result {
            color: #16a34a;
            margin-top: 10px;
        }

        .scan-view,
        .upload-view {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        /* Camera View */
        #qr-reader {
            width: 100%;
            height: 250px;
            background: #000;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            margin: 20px 0;
        }

        #qr-reader video {
            object-fit: cover;
            width: 100%;
            height: 100%;
        }

        .scan-frame {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 180px;
            height: 180px;
            pointer-events: none;
            z-index: 10;
        }

        .scan-frame::before,
        .scan-frame::after,
        .scan-frame-inner::before,
        .scan-frame-inner::after {
            content: '';
            position: absolute;
            width: 30px;
            height: 30px;
            border-color: white;
            /* or dark depending on design, image looks dark/white */
            border-style: solid;
            border-width: 0;
        }

        /* Top Left */
        .scan-frame::before {
            top: 0;
            left: 0;
            border-top-width: 2px;
            border-left-width: 2px;
            border-top-left-radius: 12px;
        }

        /* Top Right */
        .scan-frame::after {
            top: 0;
            right: 0;
            border-top-width: 2px;
            border-right-width: 2px;
            border-top-right-radius: 12px;
        }

        /* Bottom Left */
        .scan-frame-inner::before {
            bottom: 0;
            left: 0;
            border-bottom-width: 2px;
            border-left-width: 2px;
            border-bottom-left-radius: 12px;
        }

        /* Bottom Right */
        .scan-frame-inner::after {
            bottom: 0;
            right: 0;
            border-bottom-width: 2px;
            border-right-width: 2px;
            border-bottom-right-radius: 12px;
        }

        .btn-black {
            background: #0f172a;
            color: white;
            padding: 10px 20px;
            border-radius: 30px;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            display: inline-block;
            cursor: pointer;
            border: none;
            margin-top: 10px;
        }

        .btn-black:hover {
            background: #1e293b;
            color: #fff;
        }

        /* Upload View */
        .file-overlay-input {
            opacity: 0;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }

        .drop-zone-title {
            font-weight: 500;
            margin-bottom: 5px;
        }

        .drop-zone-sub {
            font-size: 0.8rem;
        }

        .drop-zone {
            border: 2px dashed #bfdbfe;
            /* Light blue dashed */
            border-radius: 16px;
            padding: 40px 20px;
            width: 100%;
            margin: 20px 0;
            background: #f8fafc;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .drop-zone:hover {
            border-color: var(--accent-color);
            background: #f1f5f9;
        }

        .drop-zone-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #64748b;
        }

        .upload-icon {
            font-size: 2rem;
            color: #64748b;
            margin-bottom: 10px;
        }

        .close-btn {
            position: absolute;
            top: 0;
            right: 0;
            font-size: 1.5rem;
            color: #64748b; /* WCAG AA pass (was #94a3b8 = 2.86:1, now #64748b = 4.54:1) */
            cursor: pointer;
            padding: 10px;
            background: transparent;
            border: none;
            line-height: 1;
            transition: color 0.2s;
        }

        .close-btn:hover {
            color: var(--primary-color);
        }

        .back-arrow {
            position: absolute;
            top: 0;
            left: 0;
            font-size: 1.2rem;
            color: #333;
            cursor: pointer;
            padding: 10px;
            z-index: 20;
            background: transparent;
            border: none;
            transition: color 0.2s;
        }

        .back-arrow:hover {
            color: var(--accent-color);
        }

        /* OTP SLIDE UP — anchored to left-panel */
        .otp-slide-up {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            background: white;
            border-top-left-radius: 30px;
            border-top-right-radius: 30px;
            padding: 30px;
            box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.2);
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 1000;
            box-sizing: border-box;
            height: auto;
            min-height: auto;
            visibility: hidden;
            pointer-events: none;
        }

        .otp-slide-up.active {
            transform: translateY(0);
            visibility: visible;
            pointer-events: auto;
        }

        .handle-bar {
            width: 50px;
            height: 4px;
            background: #e2e8f0;
            border-radius: 2px;
            margin: 0 auto 30px;
        }

        .otp-inputs {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin: 30px 0;
        }

        input.otp-digit {
            width: 50px !important;
            height: 50px !important;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            text-align: center;
            font-size: 1.25rem;
            font-weight: 600;
            color: #0f172a;
            padding: 0;
            /* Override global padding */
        }

        .otp-digit:focus {
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
        }

        .resend-link {
            text-align: center;
            display: block;
            margin-bottom: 30px;
            font-size: 0.9rem;
            color: #64748b;
        }

        .resend-link a {
            color: #2563eb;
            font-weight: 600;
            text-decoration: none;
        }

        /* DIVIDER */
        .divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 1.5rem 0;
            color: #64748b; /* WCAG AA pass (was #94a3b8 = 2.86:1, now #64748b = 4.54:1) */
            font-size: 0.8rem;
            font-weight: 500;
        }

        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid #e2e8f0;
        }

        .divider span {
            padding: 0 10px;
        }

        /* SECONDARY ACTIONS */
        .secondary-actions {
            display: flex;
            gap: 15px;
        }

        .btn-secondary {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 10px;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-main);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.2s;
        }

        .btn-secondary:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

        /* FOOTER */
        .auth-footer {
            display: flex;
            justify-content: center;
            /* Centered as requested */
            font-size: 0.75rem;
            color: #64748b; /* WCAG AA pass (was #94a3b8 = 2.86:1, now #64748b = 4.54:1) */
            width: 100%;
            padding-top: 20px;
        }

        /* Center Headers for specific sections */
        #phone-login-section,
        #qr-scan-section {
            text-align: center;
        }

        #phone-login-section h1,
        #qr-scan-section h1 {
            margin-bottom: 0.5rem;
        }

        #phone-login-section .subtitle,
        #qr-scan-section .subtitle {
            margin-bottom: 2rem;
            display: block;
            /* Ensure it takes width to center text */
            margin-left: auto;
            margin-right: auto;
        }

        /* Align buttons/inputs back to left if needed, or keep centered? 
           Inputs usually look better left-aligned text, but centered container?
           The input wrapper is 100% width. allow text-align center to inherit to inputs? 
           No, override input text-align to left for usability. */
        #phone-login-section input {
            text-align: left;
        }

        .footer-links a {
            color: #64748b; /* WCAG AA pass (was #94a3b8 = 2.86:1, now #64748b = 4.54:1) */
            text-decoration: none;
            margin-left: 15px;
        }

        /* RIGHT PANEL — CAROUSEL */
        .right-panel {
            width: 55%;
            position: relative;
            overflow: hidden;
            display: flex;
        }

        .right-panel--dark { background-color: #0f172a; }
        .right-panel--light { background-color: #f1f5f9; }

        .carousel-static {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .carousel {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .carousel-track {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .carousel-slide {
            position: absolute;
            inset: 0;
            margin: 0;
            opacity: 0;
            pointer-events: none;
            transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            will-change: opacity;
        }

        .carousel-slide.is-active {
            opacity: 1;
            pointer-events: auto;
            z-index: 1;
            cursor: grab;
            user-select: none;
        }

        .carousel-slide.is-active:active {
            cursor: grabbing;
        }

        .carousel-slide img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 0;
            transform: scale(1.05);
            transition: transform 7000ms ease-out;
            will-change: transform;
        }

        .carousel-slide.is-active img {
            transform: scale(1);
        }

        .carousel-caption {
            position: relative;
            z-index: 2;
            padding: 60px;
            width: 100%;
            box-sizing: border-box;
        }

        .right-panel--dark .carousel-caption {
            color: #fff;
            background: linear-gradient(
                to top,
                rgba(15, 23, 42, 0.92) 0%,
                rgba(15, 23, 42, 0.6) 60%,
                rgba(15, 23, 42, 0) 100%
            );
            padding-top: 120px;
        }

        .right-panel--light .carousel-caption {
            color: #0f172a;
            background: linear-gradient(
                to top,
                rgba(255, 255, 255, 0.94) 0%,
                rgba(255, 255, 255, 0.6) 60%,
                rgba(255, 255, 255, 0) 100%
            );
            padding-top: 120px;
        }

        .carousel-caption h2 {
            font-size: 1.5rem;
            font-weight: 600;
            margin: 0 0 10px 0;
        }

        .carousel-caption p {
            font-size: 1rem;
            margin: 0;
            line-height: 1.5;
            max-width: 80%;
            opacity: 0.9;
        }

        /* Dots */
        .carousel-dots {
            position: absolute;
            bottom: 24px;
            left: 60px;
            display: flex;
            gap: 8px;
            z-index: 3;
        }

        .carousel-dot {
            width: 28px;
            height: 4px;
            border: none;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.35);
            cursor: pointer;
            padding: 0;
            transition: background 0.2s, width 0.3s;
        }

        .right-panel--light .carousel-dot {
            background: rgba(15, 23, 42, 0.25);
        }

        .carousel-dot.is-active {
            background: #fff;
            width: 40px;
        }

        .right-panel--light .carousel-dot.is-active {
            background: #0f172a;
        }

        .carousel-dot:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 3px;
        }

        /* Pause button */
        .carousel-pause {
            position: absolute;
            bottom: 20px;
            right: 24px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            transition: background 0.2s;
            z-index: 3;
        }

        .right-panel--light .carousel-pause {
            background: rgba(15, 23, 42, 0.1);
            color: #0f172a;
        }

        .carousel-pause:hover {
            background: rgba(255, 255, 255, 0.28);
        }

        .right-panel--light .carousel-pause:hover {
            background: rgba(15, 23, 42, 0.2);
        }

        /* When paused, swap icon via class */
        .carousel.is-paused .carousel-pause .fas {
            display: none;
        }

        .carousel.is-paused .carousel-pause::before {
            content: "\f04b";
            /* fa-play */
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
        }

        /* UTILS */
        /* !important so it also wins over display rules declared later
           (e.g. .scan-view / .upload-view { display: flex }). All JS
           show/hide on this page toggles this class — never inline style. */
        .hidden {
            display: none !important;
        }

        .alert {
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 20px;
            font-size: 0.9rem;
        }

        .alert-danger {
            background: #fef2f2;
            color: #dc2626;
            border: 1px solid #fee2e2;
        }

        .alert-success {
            background: #f0fdf4;
            color: #16a34a;
            border: 1px solid #dcfce7;
        }

        /* RESET METHOD TABS (replaces toggle-switch) */
        .reset-tabs {
            display: flex;
            gap: 8px;
            background: #f1f5f9;
            padding: 4px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .reset-tab {
            flex: 1;
            padding: 10px 16px;
            background: transparent;
            border: none;
            border-radius: 8px;
            color: #64748b;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        }

        .reset-tab.active {
            background: #fff;
            color: var(--primary-color);
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
        }

        .reset-tab:hover:not(.active) {
            color: var(--primary-color);
        }

        /* Top back-to-login link */
        .top-back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: #64748b;
            font-size: 0.85rem;
            font-weight: 500;
            text-decoration: none;
            margin-bottom: 20px;
            transition: color 0.2s;
        }

        .top-back-link:hover {
            color: var(--primary-color);
        }

        /* QR scan-line animation.
           Lives on a dedicated .scan-line element — NOT on a .scan-frame-inner
           pseudo-element: those four pseudos draw the frame corners, and
           overriding one of them silently deleted the bottom-left corner. */
        .scan-frame::before,
        .scan-frame::after,
        .scan-frame-inner::before,
        .scan-frame-inner::after {
            z-index: 2;
        }

        .scan-line {
            position: absolute;
            top: 0;
            left: 10%;
            right: 10%;
            height: 2px;
            background: linear-gradient(90deg,
                    transparent,
                    rgba(59, 130, 246, 0.9),
                    transparent);
            box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
            animation: scan-line 2s ease-in-out infinite;
            z-index: 1;
        }

        @keyframes scan-line {
            0% {
                top: 0;
                opacity: 0.4;
            }

            50% {
                top: calc(100% - 2px);
                opacity: 1;
            }

            100% {
                top: 0;
                opacity: 0.4;
            }
        }

        /* Reduced motion — respect user preference */
        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }

            .otp-slide-up {
                transition: none !important;
                transform: translateY(100%);
            }

            .otp-slide-up.active {
                transform: translateY(0);
            }

            .scan-line {
                animation: none;
                top: 50%;
            }

            /* Carousel: show only first slide, no fade, no autoplay */
            .carousel-slide {
                transition: none !important;
            }

            .carousel-pause {
                display: none;
            }
        }

        /* RESPONSIVE */
        @media (max-width: 900px) {
            .split-container {
                flex-direction: column;
                height: auto;
                min-height: 100vh;
                overflow-y: auto;
            }

            .left-panel {
                width: 100%;
                padding: 40px 20px;
                order: 2;
                min-height: 100vh;
                justify-content: flex-start;
                gap: 40px;
            }

            .left-panel-content {
                flex-grow: 0;
            }

            /* Carousel hidden on mobile — form goes full width */
            .right-panel {
                display: none;
            }

            body {
                overflow: auto;
            }

            .auth-footer {
                flex-direction: column;
                align-items: center;
                gap: 10px;
                margin-top: auto;
            }
        }

        /* ─────────────────────────────────────────────────────────────
           RTL overrides (Arabic users).
           Not a full mirror — only the pieces where LTR-centric CSS
           leaks in as visual bugs when dir="rtl" is applied.
           ───────────────────────────────────────────────────────────── */

        /* OTP digit codes are always LTR (a 6-digit number reads the
           same way in every language). Without this, the caret jumps
           right-to-left and digits appear in reverse. */
        [dir="rtl"] .otp-inputs { direction: ltr; }
        [dir="rtl"] .otp-digit  { direction: ltr; text-align: center; }

        /* Phone number + country prefix group is always LTR (+212 6XX …
           doesn't make sense flipped). */
        [dir="rtl"] .phone-input-group { direction: ltr; }
        [dir="rtl"] .phone-input-group input { text-align: left; }

        /* Back-arrow icon: the ← glyph is geographic, mirror it so
           "back" visually points toward the previous screen (RTL users
           expect → to mean "back"). */
        [dir="rtl"] .back-arrow { left: auto; right: 0; }
        [dir="rtl"] .back-arrow .fas,
        [dir="rtl"] .back-arrow .fa,
        [dir="rtl"] .back-arrow svg,
        [dir="rtl"] .back-arrow i { transform: scaleX(-1); }

        /* Close icon (×) is symmetric, but its absolute positioning
           needs to flip so it stays in the top-outer corner. */
        [dir="rtl"] .close-btn { right: auto; left: 0; }

        /* Carousel dots + pause button live in the right-panel whose
           flow reverses in RTL — force LTR on the control bar so the
           dots stay in reading order (slide 1 on the left). */
        [dir="rtl"] .carousel-dots,
        [dir="rtl"] .carousel-pause { direction: ltr; }

        /* Footer links use margin-left; in RTL that creates a weird
           gap on the wrong side. Use logical property. */
        [dir="rtl"] .footer-links a {
            margin-left: 0;
            margin-right: 15px;
        }

        /* ─────────────────────────────────────────────────────────────
           Responsive fixes — tight screens (320/375/414 px).
           Known risks from the backlog:
             - OTP modal overflows under 768px (position:absolute)
             - Phone-input-group wrapping with emoji prefix
             - Reset tabs don't fit at 320px
           ───────────────────────────────────────────────────────────── */

        /* Small phones — 320-414px (oldest common device is iPhone SE 1st-gen) */
        @media (max-width: 414px) {
            .otp-slide-up {
                padding: 20px 16px;
                border-top-left-radius: 20px;
                border-top-right-radius: 20px;
            }
            .otp-inputs {
                gap: 8px;
                margin: 20px 0;
            }
            input.otp-digit {
                width: 40px !important;
                height: 44px !important;
                font-size: 1.1rem;
            }
            .phone-input-group {
                flex-wrap: nowrap; /* prefix + input stay on one line */
            }
            .phone-input-group .phone-prefix {
                flex-shrink: 0;
            }
            .phone-input-group input {
                min-width: 0; /* allow input to shrink inside flex */
            }
            /* Reset tabs (login vs forgot-password) — allow wrap instead of overflow */
            .reset-tabs, .auth-tabs {
                flex-wrap: wrap;
            }
        }

        /* Mid-size phones / small tablets — 415-767px */
        @media (min-width: 415px) and (max-width: 767px) {
            .otp-slide-up {
                padding: 24px;
            }
            input.otp-digit {
                width: 44px !important;
                height: 48px !important;
            }
        }

        /* Tablet landscape breakpoint — make sure carousel dots + pause
           don't overlap the main CTA when the right panel gets narrow */
        @media (min-width: 768px) and (max-width: 1023px) {
            .carousel-dots { bottom: 20px; }
            .carousel-pause { bottom: 18px; }
        }
