        :root {
            --bgColor: #FCF4E3;
            --mainColor: #433222;
            --textColor: black;
            --textWhy: #907263;
            --secbg: #FEFCF8;
            --faqOpenbg: #ffffff;
            --navBorderColor: var(--textColor);
            --indicatorBg: black;
            --iconActive: #FCF4E3;
            --iconInactive: black;
            --avatarBg: #dcd7ca;
            --userNameColor: #333;
            --mainFont: 'Tajawal', sans-serif;
            --card-glass-light: rgba(255, 252, 240, 0.92);
            --border-glow-light: rgba(67, 50, 34, 0.3);
            --shadow-light: rgba(0, 0, 0, 0.08);
            --path-stroke: #433222;
            --circle-stroke: #433222;
            --text-muted-light: #5e4b38;

            --inputBg: #fff;
            --inputBorder: #d4c8b8;
            --inputFocus: var(--mainColor);
            --errorColor: #c0392b;
            --successColor: #2d7d46;
            --cardBg: rgba(255, 252, 240, 0.92);
            --dividerColor: #d4c8b8;
            --btnText: #FCF4E3;
            --toastSuccessBg: #eaf7ee;
            --toastErrorBg: #fdecea;
            --toastInfoBg: #eef5fb;
            --eyeIconColor: #907263;
        }

        body.dark {
            --bgColor: #121211;
            --mainColor: #EEE7D4;
            --textColor: #EEE7D4;
            --textWhy: #E4CAAE;
            --secbg: #191918;
            --faqOpenbg: #3C3C3C;
            --navBorderColor: var(--mainColor);
            --indicatorBg: var(--mainColor);
            --iconActive: #FCF4E3;
            --iconInactive: black;
            --avatarBg: transparent;
            --userNameColor: var(--mainColor);
            --card-glass-light: rgba(18, 18, 17, 0.92);
            --border-glow-light: rgba(238, 231, 212, 0.35);
            --shadow-light: rgba(0, 0, 0, 0.4);
            --path-stroke: #EEE7D4;
            --circle-stroke: #E4CAAE;
            --text-muted-light: #CBB99A;

            --inputBg: #2a2a28;
            --inputBorder: #5a5244;
            --cardBg: rgba(18, 18, 17, 0.92);
            --btnText: #121211;
            --dividerColor: #5a5244;
            --toastSuccessBg: #1a3322;
            --toastErrorBg: #3c1a1a;
            --toastInfoBg: #1a2a3c;
            --eyeIconColor: #CBB99A;
        }

        /* ==================== صفحة Index التجريبية ==================== */
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        body {
            background-color: var(--bgColor);
            color: var(--textColor);
            font-family: var(--mainFont, 'Tajawal', sans-serif);
            min-height: 100vh;
            transition: background-color 0.5s ease, color 0.5s ease;
            cursor: none;
        }

        .demo-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 40px;
            border-bottom: 1px solid var(--border-glow-light);
            background: var(--secbg);
        }

        .logo-dark {
            display: none;
        }

        body.dark .logo-light {
            display: none;
        }

        body.dark .logo-dark {
            display: block;
        }

        .demo-logo {
            font-size: 1.4rem;
            font-weight: 800;
            color: var(--mainColor);
        }

        .demo-btns {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .btn-open-auth {
            padding: 10px 22px;
            border-radius: 12px;
            border: none;
            cursor: pointer;
            font-family: var(--mainFont, 'Tajawal', sans-serif);
            font-size: 0.95rem;
            font-weight: 700;
            transition: all 0.3s ease;
            background: var(--mainColor);
            color: var(--btnText);
        }

        .btn-open-auth:hover {
            opacity: 0.88;
            transform: translateY(-1px);
        }

        .demo-toggle-dark {
            padding: 8px 16px;
            border-radius: 10px;
            border: 2px solid var(--border-glow-light);
            background: transparent;
            color: var(--textColor);
            cursor: pointer;
            font-family: var(--mainFont, 'Tajawal', sans-serif);
            font-size: 0.85rem;
            font-weight: 600;
        }

        .demo-hero {
            padding: 80px 40px;
            text-align: center;
        }

        .demo-hero h1 {
            font-size: 3rem;
            font-weight: 900;
            color: var(--mainColor);
            margin-bottom: 16px;
        }

        .demo-hero p {
            font-size: 1.1rem;
            color: var(--textWhy);
        }

        /* ============================================================
           ✅ الـ MODAL — أنماط الحقول: بورد أسفل فقط + شفاف + بلا راديوس
        ============================================================ */

        /* --- الخلفية الضبابية --- */
        .auth-overlay {
            position: fixed;
            inset: 0;
            z-index: 9000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(14px) saturate(0.85);
            -webkit-backdrop-filter: blur(14px) saturate(0.85);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.35s ease;
        }

        .auth-overlay.open {
            opacity: 1;
            pointer-events: all;
        }

        body.dark .auth-overlay {
            background: rgba(0, 0, 0, 0.6);
        }

        /* --- الكرات الزخرفية داخل الـ Modal --- */
        .auth-bg-blobs {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            border-radius: inherit;
            z-index: 0;
        }

        .auth-blob {
            position: absolute;
            border-radius: 50%;
            opacity: 0.4;
            will-change: transform, left, top, width, height;
            transition: all 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .auth-blob--1 {
            width: 220px;
            height: 220px;
            background: radial-gradient(circle at 30% 30%, #e8d5c4, #d4b896);
            top: -60px;
            right: -40px;
            animation: floatB1 12s ease-in-out infinite;
        }

        .auth-blob--2 {
            width: 260px;
            height: 260px;
            background: radial-gradient(circle at 60% 40%, #f0e0d0, #dbc4a8);
            bottom: -80px;
            left: -60px;
            animation: floatB2 14s ease-in-out infinite;
        }

        body.dark .auth-blob--1 {
            background: radial-gradient(circle at 30% 30%, #3a352c, #2b2419);
        }

        body.dark .auth-blob--2 {
            background: radial-gradient(circle at 60% 40%, #4a4236, #2f281e);
        }

        @keyframes floatB1 {

            0%,
            100% {
                transform: translate(0, 0) scale(1);
            }

            50% {
                transform: translate(-20px, 30px) scale(1.08);
            }
        }

        @keyframes floatB2 {

            0%,
            100% {
                transform: translate(0, 0) scale(1);
            }

            50% {
                transform: translate(25px, -30px) scale(1.06);
            }
        }

        /* --- أنيميشن الانكماش إلى كرة (تبديل الشاشات) --- */
        .auth-bg-blobs.converging .auth-blob--1 {
            top: 50% !important;
            right: auto !important;
            left: 50% !important;
            transform: translate(-50%, -50%) scale(1.6) !important;
            opacity: 0.85 !important;
            width: 300px !important;
            height: 300px !important;
            animation: none !important;
        }

        .auth-bg-blobs.converging .auth-blob--2 {
            bottom: auto !important;
            left: 50% !important;
            top: 50% !important;
            transform: translate(-50%, -50%) scale(1.55) !important;
            opacity: 0.8 !important;
            width: 280px !important;
            height: 280px !important;
            animation: none !important;
        }

        /* --- بطاقة النموذج --- */
        .auth-card {
            position: relative;
            z-index: 10;
            width: 100%;
            max-width: 460px;
            background: var(--cardBg);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-radius: 32px;
            padding: 44px 36px 36px;
            border: 1px solid var(--border-glow-light);
            box-shadow:
                0 32px 64px -20px var(--shadow-light),
                0 0 0 0.5px rgba(67, 50, 34, 0.07) inset;
            transform: translateY(30px) scale(0.97);
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease;
            opacity: 0;
        }

        .auth-overlay.open .auth-card {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        .auth-card::before {
            content: '';
            position: absolute;
            top: -1px;
            left: 20%;
            right: 20%;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--border-glow-light), transparent);
        }

        /* --- زرار الإغلاق --- */
        .auth-close {
            position: absolute;
            top: 16px;
            left: 16px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: transparent;
            color: var(--textWhy);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            transition: all 0.2s ease;
            z-index: 20;
        }

        .auth-close:hover {
            background: var(--border-glow-light);
            color: var(--textColor);
            transform: rotate(90deg);
        }

        /* ==================== Form Header ==================== */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

/* جعل الـ h1 يحتوي على النص والصورة في سطر واحد مع توسيط المجموعة */
.form-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--mainColor);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;  /* لتوسيط المجموعة (الصورة + النص) ككل داخل الـ h1 */
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
}

/* تنسيق الصورة وجعلها على يسار النص دائماً */
.form-header h1 img {
    max-height: 38px;
    width: auto;
    vertical-align: middle;
    order: -1;   /* <-- هذا السطر يجعل الصورة تظهر أولاً (على الشمال) بغض النظر عن ترتيبها في HTML */
}

        .form-header p {
            font-size: 0.92rem;
            color: var(--textWhy);
        }

        /* ==================== أنماط الحقول — بدون خلفية / بدون راديوس / بورد أسفل فقط ==================== */
        .input-group {
            position: relative;
            margin-bottom: 26px;
        }

        /* القاعدة الأساسية: بدون خلفية، بدون حدود جانبية، خط سفلي فقط */
        .input-field {
            width: 100%;
            padding: 14px 12px 8px 12px;
            font-size: 0.97rem;
            font-family: var(--mainFont, 'Tajawal', sans-serif);
            border: none;
            border-bottom: 2px solid var(--inputBorder);
            border-radius: 0 !important;
            background: transparent !important;
            color: var(--textColor);
            outline: none;
            transition: border-bottom-color 0.25s ease;
            text-align: right;
            line-height: 1.5;
        }

        /* حالة التركيز: لون البوردر الأسفل فقط */
        .input-field:focus {
            border-bottom-color: var(--inputFocus);
            box-shadow: none;
        }

        /* أخطاء ونجاح: فقط تغيير لون الخط السفلي */
        .input-field.error {
            border-bottom-color: var(--errorColor) !important;
        }

        .input-field.success {
            border-bottom-color: var(--successColor) !important;
        }

        /* حقل كلمة المرور يحتاج مساحة إضافية لليسار لأيقونة العين */
        .password-field .input-field {
            padding-left: 48px;
            padding-right: 12px;
        }

        /* Floating label — خلفيته شفافة في الوضع الطبيعي */
        .floating-label {
            position: absolute;
            top: 50%;
            right: 12px;
            transform: translateY(-50%);
            font-size: 0.95rem;
            color: var(--textWhy);
            pointer-events: none;
            transition: all 0.25s ease;
            white-space: nowrap;
            background: transparent;
            padding: 0 4px;
        }

        /* حالة الرفع (النص يطفو فوق) — بدون خلفية (شفاف) */
        .input-field:focus~.floating-label,
        .input-field:not(:placeholder-shown)~.floating-label {
            top: -9px;
            right: 12px;
            transform: none;
            font-size: 0.76rem;
            font-weight: 600;
            color: var(--inputFocus);
            background: transparent;
            /* ✅ إزالة أي خلفية */
            padding: 0 3px;
            border-radius: 0;
            backdrop-filter: none;
            /* ✅ إزالة البلور */
        }

        /* حالة الخطأ في الليبل */
        .input-field.error~.floating-label {
            color: var(--errorColor);
        }

        /* أيقونة العين */
        .eye-toggle {
            position: absolute;
            left: 4px;
            top: 50%;
            margin-top: -20px;
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: 10px;
            border: none;
            background: transparent;
            cursor: pointer;
            color: var(--eyeIconColor);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
        }

        .eye-toggle:hover {
            color: var(--mainColor);
            background: rgba(67, 50, 34, 0.05);
        }

        .eye-toggle svg {
            width: 20px;
            height: 20px;
            display: block;
        }

        /* رسائل الخطأ */
        .error-msg {
            font-size: 0.77rem;
            color: var(--errorColor);
            margin-top: 5px;
            margin-right: 6px;
            font-weight: 500;
            display: none;
            align-items: center;
            gap: 4px;
        }

        .error-msg.visible {
            display: flex;
            animation: fadeSlideIn 0.3s ease;
        }

        @keyframes fadeSlideIn {
            from {
                opacity: 0;
                transform: translateY(-5px);
            }

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

        /* قوة كلمة المرور — لا تتأثر بالتعديل */
        .password-strength {
            margin-top: -16px;
            display: flex;
            gap: 5px;
            height: 4px;
            border-radius: 10px;
            width: 100%; 
        }

        .strength-bar {
            flex: 1;
            height: 100%;
            background: #e0d5c8;
            border-radius: 10px;
            transition: all 0.3s;
        }

        body.dark .strength-bar {
            background: #4a4236;
        }

        .strength-bar.active.weak {
            background: #c0392b;
        }

        .strength-bar.active.fair {
            background: #e67e22;
        }

        .strength-bar.active.good {
            background: #f1c40f;
        }

        .strength-bar.active.strong {
            background: #2d7d46;
        }

        .strength-text {
            font-size: 0.74rem;
            margin-top: 3px;
            margin-right: 3px;
            font-weight: 500;
            transition: color 0.3s;
        }

        /* ==================== Options Row ==================== */
        .options-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .remember-me {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 0.88rem;
            color: var(--textColor);
            font-weight: 500;
        }

        .remember-me input[type="checkbox"] {
            display: none;
        }

        .custom-checkbox {
            width: 19px;
            height: 19px;
            border: 2px solid var(--inputBorder);
            border-radius: 6px;
            flex-shrink: 0;
            transition: all 0.25s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--inputBg);
        }

        .remember-me input:checked+.custom-checkbox {
            background: var(--mainColor);
            border-color: var(--mainColor);
        }

        .custom-checkbox::after {
            content: '';
            width: 5px;
            height: 9px;
            border: solid var(--btnText);
            border-width: 0 2px 2px 0;
            transform: rotate(45deg) translate(-1px, -1px);
            opacity: 0;
            transition: opacity 0.2s;
        }

        .remember-me input:checked+.custom-checkbox::after {
            opacity: 1;
        }

        .form-link {
            color: var(--mainColor);
            text-decoration: none;
            font-weight: 600;
            font-size: 0.88rem;
            transition: all 0.2s;
            cursor: pointer;
            border-bottom: 1.5px dashed transparent;
        }

        .form-link:hover {
            border-bottom-color: var(--mainColor);
            opacity: 0.8;
        }

        /* ==================== Buttons ==================== */
        .btn {
            width: 100%;
            padding: 14px;
            font-size: 1rem;
            font-weight: 700;
            font-family: var(--mainFont, 'Tajawal', sans-serif);
            border: none;
            border-radius: 13px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .btn--primary {
            background: var(--mainColor);
            color: var(--btnText);
            box-shadow: 0 8px 22px rgba(67, 50, 34, 0.2);
        }

        .btn--primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 28px rgba(67, 50, 34, 0.3);
        }

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

        .btn--primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-spinner {
            display: none;
            width: 19px;
            height: 19px;
            border: 2.5px solid transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
            margin: 0 auto;
        }

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

        .btn.loading .btn-text {
            display: none;
        }

        .btn.loading .btn-spinner {
            display: block;
        }

        /* ==================== Divider & Social ==================== */
        .divider {
            display: flex;
            align-items: center;
            gap: 14px;
            margin: 20px 0;
            color: var(--textWhy);
            font-size: 0.83rem;
            font-weight: 500;
        }

        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--dividerColor);
            opacity: 0.6;
        }

        .social-btns {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .btn--social {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 2px solid var(--inputBorder);
            background: var(--inputBg);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            font-size: 18px;
            color: var(--textColor);
        }

        .btn--social:hover {
            border-color: var(--mainColor);
            background: var(--secbg);
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
        }

        /* ==================== Switch Text ==================== */
        .switch-text {
            text-align: center;
            margin-top: 18px;
            font-size: 0.88rem;
            color: var(--textWhy);
            font-weight: 500;
        }

        /* ==================== Form Screens ==================== */
        .form-screen {
            display: none;
        }

        .form-screen.active {
            display: block;
            animation: screenIn 0.45s ease forwards;
        }

        .form-screen.fading-out {
            animation: screenOut 0.3s ease forwards;
        }

        @keyframes screenIn {
            from {
                opacity: 0;
                transform: translateY(18px);
            }

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

        @keyframes screenOut {
            from {
                opacity: 1;
                transform: translateY(0);
            }

            to {
                opacity: 0;
                transform: translateY(-16px);
            }
        }

        /* ==================== OTP & Steps ==================== */
        .step-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 22px;
        }

        .step-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--inputBorder);
            transition: all 0.3s ease;
        }

        .step-dot.active {
            background: var(--mainColor);
            width: 12px;
            height: 12px;
            box-shadow: 0 0 8px rgba(67, 50, 34, 0.4);
        }

        .step-dot.done {
            background: var(--successColor);
        }

        .step-line {
            width: 28px;
            height: 2px;
            background: var(--inputBorder);
            border-radius: 2px;
            transition: all 0.3s;
        }

        .step-line.done {
            background: var(--successColor);
        }

        .otp-display {
            background: var(--secbg);
            border: 2px dashed var(--mainColor);
            border-radius: 12px;
            padding: 13px 16px;
            text-align: center;
            margin: 14px 0;
            font-size: 0.83rem;
            color: var(--textWhy);
            letter-spacing: 0.03em;
        }

        .otp-display strong {
            font-size: 1.5rem;
            letter-spacing: 0.15em;
            color: var(--mainColor);
            display: block;
            margin-top: 4px;
            font-weight: 900;
        }

        /* ==================== Toast ==================== */
        .auth-toast-container {
            position: fixed;
            top: 22px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 9px;
            pointer-events: none;
            width: 90%;
            max-width: 420px;
        }

        .auth-toast {
            padding: 13px 18px;
            border-radius: 13px;
            font-weight: 600;
            font-size: 0.88rem;
            text-align: center;
            pointer-events: auto;
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
                toastOut 0.35s ease 3.2s forwards;
        }

        .auth-toast--success {
            background: var(--toastSuccessBg);
            color: #1a5c2a;
            border: 1px solid #b8dcbf;
        }

        .auth-toast--error {
            background: var(--toastErrorBg);
            color: #7b2118;
            border: 1px solid #f0c4bf;
        }

        .auth-toast--info {
            background: var(--toastInfoBg);
            color: #1a4972;
            border: 1px solid #c4daf0;
        }

        body.dark .auth-toast--success {
            color: #a5d6a5;
            border-color: #2d5a2d;
        }

        body.dark .auth-toast--error {
            color: #f4a9a9;
            border-color: #6b2c2c;
        }

        body.dark .auth-toast--info {
            color: #9fc5e8;
            border-color: #2a4a6b;
        }

        @keyframes toastIn {
            from {
                opacity: 0;
                transform: translateY(-28px)
            }

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

        @keyframes toastOut {
            from {
                opacity: 1;
                transform: translateY(0)
            }

            to {
                opacity: 0;
                transform: translateY(-18px)
            }
        }

        /* ==================== Responsive ==================== */
        @media (max-width: 500px) {
            .auth-card {
                padding: 30px 18px 26px;
                border-radius: 22px;
            }

            .form-header h1 {
                font-size: 1.5rem;
            }

            .input-field {
                padding: 12px 8px 6px 8px;
                font-size: 0.92rem;
            }

            .password-field .input-field {
                padding-left: 42px;
            }

            .btn {
                padding: 12px;
                font-size: 0.93rem;
                border-radius: 11px;
            }
        }