:root {
    --bg: #0f172a; /* matches home */
    --accent: #22d3ee; /* cyan accent (home) */
    --txt: #e5e7eb;
    --txt-dim: #9ca3af;
    --primary: #1e3a8a; /* blue-800 */
    --primary-2: #2563eb; /* blue-600 */
    --ink: #0b1224;
    --card: #0b1224; /* deep navy card */
    --ring: rgba(34, 211, 238, 0.35);
    --shadow: 0 12px 40px rgba(2, 6, 23, .35);
}

html {
    direction: rtl;
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 100% -10%, rgba(30,58,138,.30), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(37,99,235,.25), transparent 60%), linear-gradient(180deg, #0a1120 0%, #0a1020 60%, #0b1224 100%);
    color: var(--txt);
}

/* Shell centers the panel */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Card/Panel */
.login-panel {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)), linear-gradient(180deg, #0b1224, #0a1120 70%, #0b1328);
    border-radius: 18px;
    padding: 36px 28px 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,.06);
}

/* Brand */
.brand-logo {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 18%;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.brand h3 {
    color: #eaf2ff;
}

.text-dim {
    color: var(--txt-dim);
}

/* Inputs */
.form-control {
    background: #0a152e;
    border: 1px solid rgba(255,255,255,.08);
    color: var(--txt);
    border-radius: 12px;
    padding: 0.95rem 3rem 0.95rem 1rem; /* room for icon on right (RTL) */
    transition: .25s ease;
}

    .form-control::placeholder {
        color: #93a4bf;
    }

    .form-control:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 4px var(--ring);
        background: #0a1734;
        color: #fff;
    }

/* Icons inside inputs (RTL -> right side) */
.form-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    color: #cbd5e1;
    pointer-events: none;
}

/* Big blue button */
.btn-login {
    background: linear-gradient(90deg, var(--primary-2), var(--accent));
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    color: #081224;
    text-shadow: 0 1px 0 rgba(255,255,255,.25);
    transition: transform .12s ease, box-shadow .25s ease, filter .25s ease;
    letter-spacing: .3px;
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 28px rgba(37, 99, 235, .35);
        filter: saturate(1.1);
    }

    .btn-login:active {
        transform: translateY(0);
    }

/* Alerts */
.alert {
    border-radius: 10px;
    padding: 12px 16px;
    animation: fadeIn .35s ease;
    background-color: #dc3545;
    color: #fff;
    border: 0;
}

.fade-out {
    opacity: 0;
    transform: translateY(-8px);
    transition: .5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Small screens */
@media (max-width: 480px) {
    .login-panel {
        padding: 28px 18px 20px;
    }

    .btn-login {
        font-size: 1.05rem;
    }
}

/* ===== Page-level toast (outside the card) ===== */
.toast-alert {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; /* above the card */
    pointer-events: none; /* clicks only on inner content */
    animation: toastIn .35s ease;
}

    .toast-alert.is-hiding {
        animation: toastOut .35s ease forwards;
    }

.toast-alert__content {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(220,53,69,.12), rgba(220,53,69,.10));
    border: 1px solid rgba(220,53,69,.35);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    color: #fff;
    backdrop-filter: blur(6px);
}

    .toast-alert__content i.mdi-alert-octagon {
        font-size: 1.35rem;
        color: #ffd1d6;
    }

.toast-alert__close {
    background: transparent;
    border: none;
    color: #fff;
    opacity: .85;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: background .2s ease, opacity .2s ease;
    margin-inline-start: 6px; /* RTL-friendly */
}

    .toast-alert__close:hover {
        background: rgba(255,255,255,.08);
        opacity: 1;
    }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
}
