    /* ═══════════════════════════════════════════════
   Portal Login - Premium Modern Design
   ═══════════════════════════════════════════════ */

    /* Hide portal chrome on login */
    .portal-topbar-public {
        display: none !important;
    }

    /* ── Auto-Login Overlay ───────────────────────── */
    .auto-login-overlay {
        position: absolute;
        inset: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .auto-login-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 40px;
        border-radius: 24px;
        background: rgba(15, 23, 42, 0.6);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(99, 102, 241, 0.15);
    }

    .auto-login-spinner {
        width: 48px;
        height: 48px;
        border: 3px solid rgba(99, 102, 241, 0.15);
        border-top-color: #6366f1;
        border-radius: 50%;
        animation: autoSpin 0.8s linear infinite;
    }

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

    .auto-login-text {
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.95rem;
        font-weight: 500;
    }

    [data-theme="light"] .auto-login-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(0, 0, 0, 0.06);
    }

    [data-theme="light"] .auto-login-text {
        color: rgba(0, 0, 0, 0.7);
    }

    .login-scene {
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        font-family: 'Inter', 'Cairo', sans-serif;
    }

    /* ── Background ────────────────────────────────── */
    .login-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .login-mesh {
        position: absolute;
        inset: 0;
        background:
            radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
        animation: meshShift 12s ease-in-out infinite alternate;
    }

    @keyframes meshShift {
        0% {
            filter: hue-rotate(0deg);
            transform: scale(1);
        }

        100% {
            filter: hue-rotate(30deg);
            transform: scale(1.05);
        }
    }

    /* Floating particles */
    .login-particles {
        position: absolute;
        inset: 0;
    }

    .particle {
        position: absolute;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: rgba(99, 102, 241, 0.5);
        animation: particleDrift linear infinite;
    }

    .p1 {
        top: 20%;
        left: 10%;
        animation-duration: 18s;
        width: 3px;
        height: 3px;
    }

    .p2 {
        top: 60%;
        left: 85%;
        animation-duration: 22s;
        animation-delay: -4s;
    }

    .p3 {
        top: 80%;
        left: 30%;
        animation-duration: 16s;
        animation-delay: -8s;
        width: 5px;
        height: 5px;
    }

    .p4 {
        top: 15%;
        left: 70%;
        animation-duration: 20s;
        animation-delay: -2s;
        width: 3px;
        height: 3px;
    }

    .p5 {
        top: 50%;
        left: 50%;
        animation-duration: 25s;
        animation-delay: -10s;
    }

    @keyframes particleDrift {
        0% {
            transform: translate(0, 0) scale(1);
            opacity: 0;
        }

        10% {
            opacity: 1;
        }

        90% {
            opacity: 1;
        }

        100% {
            transform: translate(120px, -180px) scale(0.5);
            opacity: 0;
        }
    }

    /* Central glow ring */
    .login-glow-ring {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 500px;
        height: 500px;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
        animation: ringPulse 4s ease-in-out infinite;
    }

    @keyframes ringPulse {

        0%,
        100% {
            transform: translate(-50%, -50%) scale(1);
            opacity: 0.6;
        }

        50% {
            transform: translate(-50%, -50%) scale(1.15);
            opacity: 1;
        }
    }

    /* ── Card ──────────────────────────────────────── */
    .login-card {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 420px;
        margin: 20px;
        animation: cardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    @keyframes cardEnter {
        0% {
            opacity: 0;
            transform: translateY(30px) scale(0.96);
        }

        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .login-card-inner {
        position: relative;
        padding: 40px 36px 32px;
        background: var(--glass-bg, rgba(15, 23, 42, 0.7));
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 24px;
        -webkit-backdrop-filter: blur(40px) saturate(1.5);
        backdrop-filter: blur(40px) saturate(1.5);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.05),
            0 20px 60px -12px rgba(0, 0, 0, 0.5),
            0 0 80px rgba(99, 102, 241, 0.05);
        overflow: hidden;
    }

    /* Animated border gradient */
    .login-card-border {
        position: absolute;
        inset: -1px;
        border-radius: 24px;
        padding: 1px;
        background: conic-gradient(from 0deg, transparent 0%, rgba(99, 102, 241, 0.4) 25%, transparent 50%, rgba(139, 92, 246, 0.4) 75%, transparent 100%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        animation: borderSpin 6s linear infinite;
        opacity: 0.5;
    }

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

    /* ── Logo ──────────────────────────────────────── */
    .login-logo-wrap {
        position: relative;
        width: 72px;
        height: 72px;
        margin: 0 auto 24px;
    }

    .login-logo-pulse {
        position: absolute;
        inset: -6px;
        border-radius: 50%;
        border: 2px solid rgba(99, 102, 241, 0.3);
        animation: logoPulse 2s ease-in-out infinite;
    }

    @keyframes logoPulse {

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

        50% {
            transform: scale(1.15);
            opacity: 0;
        }
    }

    .login-logo-circle {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
        border: 1px solid rgba(99, 102, 241, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #818cf8;
    }

    .login-logo-circle i {
        width: 32px;
        height: 32px;
    }

    /* ── Titles ────────────────────────────────────── */
    .login-title {
        text-align: center;
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--text-primary, #f1f5f9);
        margin: 0 0 6px;
        letter-spacing: -0.02em;
    }

    .login-subtitle {
        text-align: center;
        font-size: 0.9rem;
        color: var(--text-secondary, #64748b);
        margin: 0 0 32px;
    }

    /* ── Form Fields ───────────────────────────────── */
    .login-form {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .login-field {
        position: relative;
    }

    .login-field-icon {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        color: var(--text-secondary, #64748b);
        pointer-events: none;
        transition: color 0.3s ease;
        z-index: 2;
    }

    [dir="ltr"] .login-field-icon {
        right: auto;
        left: 14px;
    }

    .login-field-icon i {
        width: 18px;
        height: 18px;
    }

    .login-field input {
        width: 100%;
        padding: 16px 44px 16px 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-primary, #f1f5f9);
        font-size: 0.95rem;
        font-family: inherit;
        outline: none;
        transition: all 0.3s ease;
        box-sizing: border-box;
    }

    [dir="ltr"] .login-field input {
        padding: 16px 16px 16px 44px;
    }

    .login-field input:focus {
        border-color: rgba(99, 102, 241, 0.5);
        background: rgba(99, 102, 241, 0.04);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .login-field input:focus~.login-field-icon {
        color: #818cf8;
    }

    /* Floating label */
    .login-field label {
        position: absolute;
        top: 50%;
        right: 44px;
        transform: translateY(-50%);
        font-size: 0.9rem;
        color: var(--text-secondary, #64748b);
        pointer-events: none;
        transition: all 0.25s ease;
        z-index: 1;
    }

    [dir="ltr"] .login-field label {
        right: auto;
        left: 44px;
    }

    .login-field input:focus~label,
    .login-field input:not(:placeholder-shown)~label {
        top: -8px;
        right: 12px;
        font-size: 0.72rem;
        font-weight: 600;
        color: #818cf8;
        background: var(--glass-bg, rgba(15, 23, 42, 0.9));
        padding: 0 8px;
        border-radius: 4px;
    }

    [dir="ltr"] .login-field input:focus~label,
    [dir="ltr"] .login-field input:not(:placeholder-shown)~label {
        right: auto;
        left: 12px;
    }

    /* Field bottom accent bar */
    .login-field-bar {
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, #6366f1, #a78bfa);
        border-radius: 0 0 14px 14px;
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .login-field input:focus~.login-field-bar {
        width: 100%;
        left: 0;
        transform: translateX(0);
    }

    /* Password toggle */
    .login-eye-toggle {
        position: absolute;
        top: 50%;
        left: 14px;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--text-secondary, #64748b);
        cursor: pointer;
        padding: 4px;
        z-index: 2;
    }

    [dir="ltr"] .login-eye-toggle {
        left: auto;
        right: 14px;
    }

    .login-eye-toggle i {
        width: 18px;
        height: 18px;
    }

    .login-eye-toggle .eye-hide {
        display: none;
    }

    .login-eye-toggle.active .eye-show {
        display: none;
    }

    .login-eye-toggle.active .eye-hide {
        display: block;
    }

    /* ── Error ─────────────────────────────────────── */
    .login-error {
        display: none;
        text-align: center;
        font-size: 0.85rem;
        color: #f87171;
        padding: 10px 14px;
        border-radius: 10px;
        background: rgba(239, 68, 68, 0.08);
        border: 1px solid rgba(239, 68, 68, 0.15);
        animation: shakeIn 0.4s ease;
    }

    .login-error.visible {
        display: block;
    }

    @keyframes shakeIn {

        0%,
        100% {
            transform: translateX(0);
        }

        25% {
            transform: translateX(-6px);
        }

        75% {
            transform: translateX(6px);
        }
    }

    /* ── Submit Button ─────────────────────────────── */
    .login-submit {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px;
        margin-top: 4px;
        border: none;
        border-radius: 14px;
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        color: #fff;
        font-size: 1rem;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .login-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
    }

    .login-submit:active {
        transform: translateY(0);
    }

    .login-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

    .login-submit-icon i {
        width: 18px;
        height: 18px;
    }

    [dir="ltr"] .login-submit-icon {
        transform: rotate(180deg);
    }

    .login-submit-loader {
        display: none;
    }

    .login-submit.loading .login-submit-text,
    .login-submit.loading .login-submit-icon {
        visibility: hidden;
    }

    .login-submit.loading .login-submit-loader {
        display: flex;
        position: absolute;
    }

    .login-spinner {
        width: 22px;
        height: 22px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

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

    /* Shine effect */
    .login-submit::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.15) 50%, transparent 80%);
        transition: left 0.5s ease;
    }

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

    /* ── Footer ────────────────────────────────────── */
    .login-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 28px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .login-footer-text {
        font-size: 0.78rem;
        color: var(--text-secondary, #64748b);
    }

    .login-footer-dot {
        color: rgba(99, 102, 241, 0.5);
        font-size: 0.6rem;
    }

    .login-footer-brand {
        font-size: 0.78rem;
        font-weight: 600;
        background: linear-gradient(135deg, #6366f1, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* ── Light Theme ───────────────────────────────── */
    [data-theme="light"] .login-card-inner {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(0, 0, 0, 0.06);
        box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.15);
    }

    [data-theme="light"] .login-field input {
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.08);
    }

    [data-theme="light"] .login-field input:focus {
        background: rgba(99, 102, 241, 0.03);
    }

    [data-theme="light"] .login-field input:focus~label,
    [data-theme="light"] .login-field input:not(:placeholder-shown)~label {
        background: rgba(255, 255, 255, 0.95);
    }

    [data-theme="light"] .login-mesh {
        background:
            radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    }

    /* ── Responsive ────────────────────────────────── */
    @media (max-width: 480px) {
        .login-card-inner {
            padding: 32px 24px 28px;
            border-radius: 20px;
        }

        .login-title {
            font-size: 1.4rem;
        }

        .login-logo-wrap {
            width: 60px;
            height: 60px;
        }

        .login-logo-circle {
            width: 60px;
            height: 60px;
        }
    }
