/* =====================================================================
   TOOKA — DESIGN TOKENS (Home_main dashboard synchronized style)
   Rule: 60 / 30 / 10 — Exact design system from Home_main.
   ===================================================================== */
@font-face {
    font-family: 'Inter';
    src: url("../downloaded/fonts/inter/Inter-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url("../downloaded/fonts/inter/Inter-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url("../downloaded/fonts/space-grotesk/SpaceGrotesk-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url("../downloaded/fonts/space-grotesk/SpaceGrotesk-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    background: rgba(30, 27, 75, 0.75);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
}

.lang-switch button {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    letter-spacing: 0.02em;
}

.lang-switch button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.lang-switch button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4fd7;
    --primary-light: #eff6ff;
    --secondary: #818cf8;      /* indigo – neural particle colour */
    --accent-ink: #38bdf8;     /* sky blue – neural link colour */
    --accent: #fbbf24;         /* gold – single highlight */

    --dark: #1e1b4b;
    --light: #f7fafc;
    --gray: rgba(226, 232, 240, 0.78);
    --card-bg: rgba(129, 140, 248, 0.06);   /* faint indigo glass */
    --body-bg: #eff6ff;

    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;

    --text: #e7e9f7;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.26);
    --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
    --shadow-lift: 0 20px 40px -14px rgba(15, 23, 42, 0.18);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--dark);
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    margin: 0;
    line-height: 1.6;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Fixed neural-network background (same system as Home_main) ---------- */
.neural-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 30% 20%, #312e81 0%, var(--dark) 62%);
}
#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Login Wrapper ---- */
.login-outer {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    padding: 2rem 1rem;
}
.login-container {
    background: rgba(30, 27, 75, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
    border-radius: 1.25rem;
    padding: 2.5rem 2.2rem 2.2rem 2.2rem;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    position: relative;
    animation: fadeInDown 0.8s var(--ease);
}

.brand-logo-img {
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 16px rgba(37, 99, 235, 0.25));
    border-radius: 14px;
    object-fit: contain;
}

.brand-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.3px;
    color: var(--accent-ink);
    font-weight: 700;
}

.login-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 2.1rem;
    font-weight: 700;
}

.login-container .subtitle {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ---- Inputs & Forms ---- */
.form-label {
    font-size: 0.9rem;
    color: var(--accent-ink);
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-control {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.98rem;
    padding: 0.85rem 1rem;
    transition: all 0.3s ease;
    box-shadow: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(231, 233, 247, 0.4);
    opacity: 1;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group .form-control {
    padding-right: 42px;
}

/* RTL Specific Input Field Handling */
html[dir="rtl"] .input-group .form-control {
    padding-right: 1rem;
    padding-left: 42px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray);
    padding: 4px;
    z-index: 5;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

html[dir="rtl"] .password-toggle-btn {
    right: auto;
    left: 12px;
}

.password-toggle-btn:hover {
    color: #fff;
}

/* ---- Buttons ---- */
.saas-btn {
    background: var(--primary);
    color: #fff !important;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 2rem;
    font-size: 1.02rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    margin-bottom: 1rem;
    margin-top: 0.6rem;
    position: relative;
    overflow: hidden;
}

.saas-btn:hover, .saas-btn:focus {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.saas-btn:active {
    transform: translateY(0);
}

/* ---- Google Button ---- */
.google-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text) !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    width: 100%;
}

.google-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--line-strong);
    transform: translateY(-2px);
    color: #fff !important;
}

.google-btn img {
    width: 20px;
    height: 20px;
}

/* ---- Divider ---- */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--gray);
    font-size: 0.88rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line);
}

.divider span {
    padding: 0 1rem;
}

/* ---- Alert messages ---- */
.login-alert {
    margin: 0.8rem 0 1.2rem 0;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    font-size: 0.92rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', sans-serif;
    animation: fadeInUp 0.5s var(--ease);
    text-align: left;
    border: 1px solid transparent;
}

html[dir="rtl"] .login-alert {
    text-align: right;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
    color: #86efac;
}

.alert-danger, .alert-error {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.18);
    border-color: var(--warning);
    color: #fde047;
}

.alert-info {
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--accent-ink);
    color: #7dd3fc;
}

/* Signup link & forgot */
.login-meta {
    font-size: 0.94rem;
    color: var(--gray);
    margin-top: 1.4rem;
}

.login-meta a, a.mt-2 {
    color: var(--accent-ink);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s ease;
}

.login-meta a:hover, a.mt-2:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* RTL Helpers */
html[dir="rtl"] .rtl-text-right {
    text-align: right !important;
}

/* Animations */
@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Responsive */
@media (max-width: 575px) {
    .login-container {
        padding: 2rem 1.4rem;
        border-radius: 1rem;
    }
    .login-container h2 {
        font-size: 1.75rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .login-container, .saas-btn, .google-btn, .login-alert {
        animation: none !important;
        transition: none !important;
    }
}