/* ============================================================
   ALLOMAPI – Premium Login Page Styles v2
   Glassmorphism · Micro-animations · Immersive branding
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
    --navy-900: #060e1a;
    --navy-800: #0a1628;
    --navy-700: #0f1f3a;
    --navy-600: #162d50;
    --navy-500: #1a3a6a;
    --blue-500: #2B82D4;
    --blue-600: #1a6ebf;
    --blue-700: #1a5fa8;
    --cyan-400: #00d4ff;
    --cyan-500: #00b8d9;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.42);
    --glass-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    --input-border: #e2e5ea;
    --input-focus: var(--blue-500);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body#login {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--navy-800);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------- */
.login-page {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
}

/* ==========================================================
   LEFT: IMMERSIVE BRANDING PANEL
   ========================================================== */
.login-branding {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 56px;
    background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 40%, var(--navy-500) 100%);
    overflow: hidden;
    text-align: center;
}

/* Animated grid pattern */
.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    animation: gridDrift 25s linear infinite;
    pointer-events: none;
}

@keyframes gridDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(48px, 48px) rotate(0.5deg); }
}

/* Primary glow orb */
.login-branding::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 40%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(43, 130, 212, 0.18) 0%, rgba(0, 212, 255, 0.06) 40%, transparent 70%);
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

/* Secondary glow orb (bottom-right) */
.login-branding .branding-glow-2 {
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse2 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse2 {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 0.8; transform: scale(1.12); }
}

/* Floating dots network effect */
.login-branding .network-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--cyan-400);
    border-radius: 50%;
    opacity: 0;
    animation: dotFloat 4s ease-in-out infinite;
    pointer-events: none;
}

.network-dot:nth-child(1) { top: 15%; left: 20%; animation-delay: 0s; }
.network-dot:nth-child(2) { top: 25%; left: 75%; animation-delay: 0.8s; }
.network-dot:nth-child(3) { top: 60%; left: 15%; animation-delay: 1.6s; }
.network-dot:nth-child(4) { top: 70%; left: 82%; animation-delay: 2.4s; }
.network-dot:nth-child(5) { top: 85%; left: 45%; animation-delay: 3.2s; }
.network-dot:nth-child(6) { top: 40%; left: 90%; animation-delay: 0.4s; }
.network-dot:nth-child(7) { top: 10%; left: 55%; animation-delay: 1.2s; }
.network-dot:nth-child(8) { top: 50%; left: 30%; animation-delay: 2s; }

@keyframes dotFloat {
    0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
    20%      { opacity: 0.6; transform: scale(1) translateY(-4px); }
    80%      { opacity: 0.4; transform: scale(0.8) translateY(4px); }
}

/* Branding content */
.branding-content {
    position: relative;
    z-index: 2;
    max-width: 460px;
}

.branding-logo {
    width: 200px;
    margin-bottom: 40px;
    filter: brightness(0) invert(1);
    opacity: 0.92;
    transition: opacity var(--transition-smooth);
}

.branding-logo:hover {
    opacity: 1;
}

.branding-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.branding-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
    margin-bottom: 52px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature list */
.branding-features {
    list-style: none;
    text-align: left;
    padding: 0;
}

.branding-features li {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 400;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color var(--transition-smooth), transform var(--transition-smooth);
}

.branding-features li:last-child {
    border-bottom: none;
}

.branding-features li:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(4px);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.12);
    transition: background var(--transition-smooth), border-color var(--transition-smooth), transform var(--transition-bounce);
}

.branding-features li:hover .feature-icon {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.25);
    transform: scale(1.08);
}

.feature-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--cyan-400);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================
   RIGHT: FORM PANEL – GLASSMORPHISM
   ========================================================== */
.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 56px;
    position: relative;
    /* Subtle gradient background instead of flat */
    background:
        radial-gradient(ellipse at 20% 80%, rgba(43, 130, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #f0f2f7 0%, #e8eaf0 100%);
}

/* Glass card container */
.login-card,
.login-alt-panel {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow:
        var(--glass-shadow),
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.login-card:hover,
.login-alt-panel:hover {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ---------- Card Header ---------- */
.login-card-header {
    margin-bottom: 32px;
}

.login-card-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.4px;
}

.login-card-header p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---------- Inline Error Banner ---------- */
.login-error-banner {
    display: none;
    background: rgba(254, 242, 242, 0.9);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.login-error-banner.visible {
    display: flex;
    animation: slideDown var(--transition-smooth);
}

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

.login-error-banner svg {
    width: 18px;
    height: 18px;
    stroke: #dc2626;
    fill: none;
    stroke-width: 2;
    min-width: 18px;
}

.login-error-banner span {
    font-size: 13px;
    color: #991b1b;
    line-height: 1.4;
}

/* ---------- Multi-server Select ---------- */
.login-server-select {
    margin-bottom: 20px;
}

.login-server-select label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-server-select .select {
    width: 100%;
}

.registration-closed-banner {
    background: rgba(254, 243, 199, 0.9);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
}

/* ---------- Form Fields ---------- */
.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition-fast);
}

.login-field:focus-within label {
    color: var(--blue-500);
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper .login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    z-index: 1;
    transition: stroke var(--transition-smooth);
}

.login-field:focus-within .login-input-icon {
    stroke: var(--blue-500);
}

.login-input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    border: 1.5px solid var(--input-border);
    border-radius: 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    transition:
        border-color var(--transition-smooth),
        box-shadow var(--transition-smooth),
        background var(--transition-smooth),
        transform var(--transition-fast);
    outline: none;
}

.login-input:hover {
    border-color: #c7cbd1;
    background: rgba(255, 255, 255, 0.85);
}

.login-input:focus {
    border-color: var(--blue-500);
    box-shadow:
        0 0 0 4px rgba(43, 130, 212, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.04);
    background: #fff;
    transform: translateY(-1px);
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* ---------- Password Toggle ---------- */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--transition-smooth);
}

.password-toggle:hover svg {
    stroke: var(--text-secondary);
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle.active .icon-eye { display: none; }
.password-toggle.active .icon-eye-off { display: block; }

/* ---------- Remember Me ---------- */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
    transition: color var(--transition-fast);
}

.login-remember:hover {
    color: var(--text-primary);
}

.login-remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--input-border);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-remember input[type="checkbox"]:hover {
    border-color: #b8bcc2;
}

.login-remember input[type="checkbox"]:checked {
    background: var(--blue-500);
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(43, 130, 212, 0.12);
}

.login-remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---------- Submit Button ---------- */
.login-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-smooth);
    box-shadow:
        0 4px 16px rgba(43, 130, 212, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.3px;
}

/* Shimmer effect on hover */
.login-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    transition: left 0.5s ease;
}

.login-submit:hover::before {
    left: 100%;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(43, 130, 212, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.login-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(43, 130, 212, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ---------- Footer Links ---------- */
.login-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.login-links a {
    font-size: 13px;
    color: var(--blue-500);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.login-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--blue-500);
    transition: width var(--transition-smooth);
}

.login-links a:hover {
    color: var(--blue-700);
}

.login-links a:hover::after {
    width: 100%;
}

.login-links .separator {
    color: #cbd5e1;
    font-size: 10px;
}

/* ---------- Recovery / Register Panels ---------- */
.login-alt-panel {
    display: none;
}

.login-alt-panel.active {
    display: block;
    animation: panelFadeIn var(--transition-smooth);
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-alt-panel .login-card-header {
    margin-bottom: 24px;
}

.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--blue-500);
    text-decoration: none;
    margin-top: 20px;
    transition: color var(--transition-fast);
}

.login-back-link:hover {
    color: var(--blue-700);
}

.login-back-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Page Footer ---------- */
.login-page-footer {
    position: absolute;
    bottom: 24px;
    left: 56px;
    right: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-page-footer .mobile-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.login-page-footer .mobile-link:hover {
    color: var(--text-secondary);
}

.login-page-footer .lang-select {
    float: right;
}

/* ---------- Dialog Notify Override ---------- */
body#login .ui-dialog {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body#login .ui-dialog .ui-dialog-titlebar {
    display: none;
}

body#login .ui-dialog .ui-dialog-content {
    padding: 28px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

body#login .ui-widget-overlay {
    background: rgba(6, 14, 26, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

body#login #dialog_notify .button {
    background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 36px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 14px;
    transition: transform var(--transition-fast), box-shadow var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(43, 130, 212, 0.25);
}

body#login #dialog_notify .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 130, 212, 0.35);
}

/* ---------- Loading Panel ---------- */
#loading_panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--navy-800);
    z-index: 9999;
    transition: opacity 0.4s ease;
}

/* ---------- Status badge – pinned top-left ---------- */
.branding-status {
    position: absolute;
    top: 24px;
    left: 28px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    font-size: 12px;
    font-weight: 500;
    color: var(--cyan-400);
    letter-spacing: 0.3px;
}

.branding-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {
    .login-branding {
        padding: 40px 32px;
    }
    .login-form-panel {
        padding: 40px 32px;
    }
    .login-card,
    .login-alt-panel {
        padding: 32px 28px;
    }
    .login-page-footer {
        left: 32px;
        right: 32px;
    }
}

@media (max-width: 768px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-branding {
        padding: 40px 24px 28px;
        min-height: auto;
    }

    .branding-logo {
        width: 150px;
        margin-bottom: 20px;
    }

    .branding-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .branding-subtitle {
        font-size: 13px;
        margin-bottom: 0;
    }

    .branding-features {
        display: none;
    }

    .branding-status {
        margin-bottom: 16px;
        font-size: 11px;
    }

    .login-branding .network-dot,
    .login-branding .branding-glow-2 {
        display: none;
    }

    .login-form-panel {
        padding: 32px 20px 80px;
        background: linear-gradient(180deg, #eef0f5 0%, #e4e7ed 100%);
    }

    .login-card,
    .login-alt-panel {
        padding: 28px 24px;
        border-radius: 16px;
    }

    .login-card-header h2 {
        font-size: 22px;
    }

    .login-input {
        height: 48px;
    }

    .login-submit {
        height: 48px;
        font-size: 14px;
    }

    .login-page-footer {
        left: 20px;
        right: 20px;
        bottom: 16px;
    }
}

@media (max-width: 400px) {
    .login-form-panel {
        padding: 24px 16px 80px;
    }

    .login-card,
    .login-alt-panel {
        padding: 24px 20px;
    }

    .login-page-footer {
        left: 16px;
        right: 16px;
    }
}

/* ---------- jQuery UI Overrides for Login ---------- */
body#login .ms-choice {
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    height: 40px;
    line-height: 38px;
    background: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    transition: border-color var(--transition-fast);
}

body#login .ms-choice:focus,
body#login .ms-choice.selected {
    border-color: var(--blue-500);
}

body#login .ms-drop {
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ---------- Entrance Animation ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-card,
.login-alt-panel.active {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.branding-content {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

/* ==========================================================
   EID OVERLAY
   ========================================================== */
.eid-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
    z-index: 999999; /* Force above all elements including autocomplete suggestions if possible */
    pointer-events: auto; /* Capture all clicks */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.eid-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Block background interaction when active */
body.eid-active .login-page {
    pointer-events: none;
}

/* Subtle background stars */
.eid-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,0.5), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 60px 80px, rgba(255,255,255,0.3), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 100px 40px, rgba(255,255,255,0.2), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 150px 150px;
    opacity: 0.8;
    animation: eidStars 25s linear infinite;
}
@keyframes eidStars {
    from { background-position: 0 0; }
    to { background-position: -150px -150px; }
}

.eid-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 650px;
    width: 90%;
    padding: 50px 40px;
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.04) inset;
    animation: eidContentEnter 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes eidContentEnter {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.eid-icon {
    margin-bottom: 24px;
    animation: eidGlowPulse 4s ease-in-out infinite;
}
.eid-icon svg {
    width: 56px;
    height: 56px;
    stroke: var(--cyan-400);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@keyframes eidGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3)); transform: translateY(0); }
    50% { filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.7)); transform: translateY(-4px); }
}

.eid-title {
    color: #ffffff;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
    text-shadow: 0 4px 12px rgba(0,0,0,0.4);
    letter-spacing: -0.5px;
}

.eid-body p {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 12px;
}
.eid-body p:last-child {
    margin-bottom: 32px;
    color: var(--cyan-400);
    font-weight: 500;
}

.eid-brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 32px;
    text-transform: uppercase;
}

.eid-close {
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--cyan-400);
    padding: 12px 36px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-smooth);
}
.eid-close:hover {
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
    color: #ffffff;
    border-color: rgba(0, 212, 255, 0.5);
}

@media (max-width: 768px) {
    .eid-content {
        padding: 40px 24px;
        border-radius: 20px;
    }
    .eid-title {
        font-size: 26px;
    }
    .eid-body p {
        font-size: 15px;
    }
}

/* ==========================================================
   PREMIUM TYPOGRAPHY (Inter + Tajawal)
   ========================================================== */
:root {
  --font-latin: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Tajawal', 'Inter', system-ui, sans-serif;
}

html, body, body#login {
  font-family: var(--font-latin);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[lang="ar"], html[lang="ar"] body {
  font-family: var(--font-arabic);
  direction: rtl;
}

.eid-overlay, .eid-overlay * {
  font-family: var(--font-arabic);
}

/* --- ARABIC OVERLAY --- */
.eid-title {
  font-family: var(--font-arabic);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
}

.eid-body p {
  font-family: var(--font-arabic);
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 2;
  letter-spacing: 0;
  text-align: center;
}

.eid-body p:last-child {
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 2;
}

.eid-brand {
  font-family: var(--font-latin);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eid-close {
  font-family: var(--font-latin);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- LATIN (FRENCH/ENGLISH) HIERARCHY --- */
.branding-title, .login-card-header h2 {
  font-family: var(--font-latin);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.branding-subtitle, .login-card-header p, .branding-features li, .login-links a, .login-remember span {
  font-family: var(--font-latin);
  font-weight: 400;
  line-height: 1.6;
}

label, input, select, button, .login-submit {
  font-family: var(--font-latin);
}

.login-submit {
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 768px) {
  .eid-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    line-height: 1.45;
  }
  .eid-body p {
    line-height: 1.9;
  }
  .branding-title, .login-card-header h2 {
    line-height: 1.1;
  }
}

/* --- FESTIVE EID DECORATIONS --- */
.eid-corner {
    position: absolute;
    width: 140px;
    height: 140px;
    color: var(--cyan-400);
    opacity: 0.12;
    pointer-events: none;
    z-index: 1;
}
.eid-corner.top-left { top: 24px; left: 24px; }
.eid-corner.top-right { top: 24px; right: 24px; }
.eid-corner.bottom-left { bottom: 24px; left: 24px; }
.eid-corner.bottom-right { bottom: 24px; right: 24px; }

.eid-lantern {
    position: absolute;
    top: -50px;
    width: 28px;
    color: var(--cyan-400);
    opacity: 0.7;
    animation: swingLantern 4s ease-in-out infinite alternate;
    transform-origin: top center;
}
.eid-lantern.left { left: 40px; animation-delay: 0.5s; }
.eid-lantern.right { right: 40px; animation-duration: 4.5s; }
.lantern-chain {
    width: 1px;
    height: 50px;
    background: currentColor;
    margin: 0 auto;
    opacity: 0.4;
}
@keyframes swingLantern {
    0% { transform: rotate(-6deg); }
    100% { transform: rotate(6deg); }
}

.eid-rosette {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    color: var(--cyan-400);
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
    animation: rotateRosette 80s linear infinite;
}
@keyframes rotateRosette {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.eid-halo {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,0.2) 0%, rgba(0,212,255,0) 70%);
    animation: pulseHalo 3s ease-in-out infinite alternate;
    z-index: -1;
}
@keyframes pulseHalo {
    0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

.eid-icon {
    position: relative;
    display: inline-block;
    animation: none;
    margin-bottom: 24px;
}
.eid-crescent {
    fill: var(--cyan-400);
    stroke: none;
    filter: drop-shadow(0 0 15px rgba(0,212,255,0.5));
    width: 56px;
    height: 56px;
}
.eid-star {
    position: absolute;
    width: 14px;
    height: 14px;
    color: #ffffff;
    filter: drop-shadow(0 0 6px #ffffff);
    animation: twinkleStar 2s infinite alternate;
}
.eid-star.star-1 { top: -8px; right: -12px; animation-delay: 0.3s; }
.eid-star.star-2 { bottom: 8px; left: -16px; width: 10px; height: 10px; animation-delay: 1.1s; }
@keyframes twinkleStar {
    0% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
    100% { opacity: 1; transform: scale(1.2) rotate(10deg); }
}

.eid-frieze {
    position: absolute;
    bottom: 0px; left: 0; right: 0;
    height: 10px;
    color: var(--cyan-400);
    opacity: 0.25;
    pointer-events: none;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    overflow: hidden;
}

.eid-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}
.eid-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255,255,255,0.6);
    animation: floatUp 15s linear infinite;
    opacity: 0;
}
@keyframes floatUp {
    0% { transform: translateY(110vh) scale(0); opacity: 0; }
    20% { opacity: 0.8; transform: translateY(80vh) scale(1); }
    80% { opacity: 0.5; transform: translateY(20vh) scale(1.2); }
    100% { transform: translateY(-10vh) scale(0); opacity: 0; }
}

@media (max-width: 768px) {
    .eid-lantern { display: none; }
    .eid-rosette { width: 250px; height: 250px; }
    .eid-corner { width: 80px; height: 80px; }
}
