/* ⚡ ABSOLUTE INSTANT DIR FLIP — ZERO DELAY */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #00f0ff;
    --secondary: #7b2ff7;
    --accent: #00ff88;
    --darker: #030308;
    --dark: #0a0a1a;
    --card-bg: rgba(8, 12, 20, 0.9);
    --border: rgba(0, 240, 255, 0.2);
    --text: #e0e0e0;
    --text-muted: #a0a0c0;
    --text-heading: #ffffff;
    --font-heading: 'Orbitron', sans-serif;
}

html.light-theme {
    --darker: #f0f2f5;
    --dark: #ffffff;
    --card-bg: #ffffff;
    --border: rgba(0, 100, 255, 0.1);
    --text: #1a1a2e;
    --text-muted: #5e5e7a;
    --text-heading: #030014;
}

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: visible; /* Prevent second scrollbar */
}

.auth-container.switching-dir,
.auth-container.switching-dir *,
.auth-container.switching-dir *::before,
.auth-container.switching-dir *::after {
    transition: none !important;
    transition-duration: 0ms !important;
    animation: none !important;
    animation-duration: 0ms !important;
    pointer-events: none !important;
}

.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #030308;
    position: relative;
    padding: 60px 0;
}

.auth-dir-toggle {
    position: fixed;
    top: 25px;
    right: 20px;
    /* LTR: Top Right */
    z-index: 100;
    border: 1.5px solid rgba(0, 240, 255, 0.4);
    background: rgba(0, 5, 20, 0.8);
    color: #00f0ff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s ease-in-out;
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
}

html[dir="rtl"] .auth-dir-toggle {
    right: auto !important;
    left: 20px !important;
}

.auth-dir-toggle.theme-toggle {
    right: 60px;
}

html[dir="rtl"] .auth-dir-toggle.theme-toggle {
    right: auto !important;
    left: 60px !important;
}

.auth-dir-toggle.theme-toggle .fa-sun {
    display: none;
}

html.light-theme .auth-dir-toggle.theme-toggle .fa-sun {
    display: block;
}

html.light-theme .auth-dir-toggle.theme-toggle .fa-moon {
    display: none;
}

.auth-dir-toggle:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

/* Removed RTL shift for the globe to keep the "form" static */

.auth-container {
    width: 95%;
    max-width: 480px;
    min-width: 280px;
    /* Safe minimum */
    box-sizing: border-box !important;
    background: rgba(8, 12, 20, 0.9);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 24px;
    padding: 45px;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    margin: 0 auto;
    /* Static centering */
    display: flex;
    flex-direction: column;
    text-align: center;
    /* Default LTR Alignment: Center */
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-logo {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 30px;
    transition: var(--transition);
}

.auth-logo .logo-icon {
    width: 45px;
    height: 45px;
}

.auth-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.auth-logo .logo-text .cyber {
    color: var(--text-heading);
}

.auth-logo .logo-text .x {
    color: var(--primary, #00f0ff);
}

.auth-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: #a0a0c0;
    font-weight: 500;
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    /* LTR: Centered Labels */
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    text-align: center;
    /* LTR: Centered Text/Placeholder */
    transition: 0.1s ease-in-out;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary, #00f0ff);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.form-options {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.checkbox-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
}

.checkbox-group input {
    cursor: pointer;
    accent-color: var(--primary, #00f0ff);
}

.forgot-link {
    color: var(--primary, #00f0ff);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary, #00f0ff);
}

.auth-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #00f0ff, #7b2ff7);
    color: #000;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.1s ease-in-out;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.3);
    filter: brightness(1.1);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: #444466;
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.social-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.social-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn i {
    font-size: 1.1rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #a0a0c0;
}

.auth-footer a {
    color: var(--primary, #00f0ff);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Background Effects */
.auth-bg-shapes {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.15;
    border-radius: 50%;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #00f0ff;
    top: -100px;
    left: -100px;
    animation: float 20s infinite alternate;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #7b2ff7;
    bottom: -50px;
    right: -50px;
    animation: float 15s infinite alternate-reverse;
}

@keyframes float {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 50px);
    }
}

/* RTL Support - Full RTL Performance */
.auth-container[dir="rtl"] .auth-form label,
.auth-container[dir="rtl"] .auth-header h2,
.auth-container[dir="rtl"] .auth-footer {
    text-align: right;
    /* Aligned Right for RTL */
}

.auth-container[dir="rtl"] .auth-form input {
    text-align: right;
    /* Aligned Right for RTL */
    direction: ltr;
    /* Keeps data entry logic clean */
    padding-right: 18px;
}

/* Internal content logic only */
.auth-container[dir="rtl"] .form-options {
    flex-direction: row-reverse;
}

.auth-container[dir="rtl"] .checkbox-group {
    flex-direction: row-reverse;
}

.auth-container[dir="rtl"] .social-btn {
    flex-direction: row-reverse;
}

.auth-container[dir="rtl"] .auth-footer a {
    margin-left: 0;
    margin-right: 5px;
}

/* ---- Light Theme Auth Support ---- */
html.light-theme .auth-page {
    background: var(--darker);
}

html.light-theme .auth-container {
    background: var(--card-bg);
    border-color: var(--border);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

html.light-theme .auth-logo .logo-text,
html.light-theme .auth-form label,
html.light-theme .checkbox-group {
    color: var(--text-heading);
}

html.light-theme .auth-header h2,
html.light-theme .auth-footer {
    color: var(--text-muted);
}

html.light-theme .auth-form input {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

html.light-theme .auth-form input:focus {
    background: rgba(0, 240, 255, 0.04);
}

html.light-theme .social-btn {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

html.light-theme .social-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
}

html.light-theme .auth-dir-toggle {
    background: var(--dark);
    border-color: var(--border);
}

@media (max-width: 500px) {
    .auth-container {
        padding: 40px 20px;
        width: 90%;
    }

    .form-options {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .auth-container[dir="rtl"] .form-options {
        align-items: center;
    }
}