/* ============================================================
   LOGIN PAGE — Full-screen standalone authentication screen
   ============================================================ */

/* ── Outer container: covers the entire viewport ──────────── */
.login-page {
    position: fixed;
    inset: 0;
    z-index: 10000;           /* sits above sidebar and everything else */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    pointer-events: none;     /* prevent the transparent overlay from blocking clicks on other pages */
}

/* re-enable pointer events only for interactive elements inside the card */
.login-page .login-card input,
.login-page .login-card button {
    pointer-events: auto;
}

/* ── Background: animated dark gradient ──────────────────── */
.login-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        #0b1221 0%,
        #0d2232 35%,
        #112234 65%,
        #0b1221 100%
    );
    background-size: 400% 400%;
    animation: loginGradientShift 14s ease infinite;
}

@keyframes loginGradientShift {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

/* ── Background: moving grid mesh ────────────────────────── */
.login-bg-mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(45, 84, 99, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 84, 99, 0.18) 1px, transparent 1px);
    background-size: 48px 48px;
    animation: loginMeshMove 22s linear infinite;
}

@keyframes loginMeshMove {
    from { transform: translateY(0); }
    to   { transform: translateY(48px); }
}

/* ── Background: soft glowing orbs ───────────────────────── */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.login-orb-1 {
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(45, 84, 99, 0.45) 0%, transparent 70%);
    top: -160px;
    right: -160px;
    animation: loginOrbFloat 11s ease-in-out infinite;
}

.login-orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(45, 156, 219, 0.25) 0%, transparent 70%);
    bottom: -120px;
    left: -120px;
    animation: loginOrbFloat 9s ease-in-out infinite reverse;
    animation-delay: -3s;
}

.login-orb-3 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(198, 245, 170, 0.12) 0%, transparent 70%);
    top: 60%;
    right: 8%;
    animation: loginOrbFloat 13s ease-in-out infinite;
    animation-delay: -6s;
}

@keyframes loginOrbFloat {
    0%, 100% { transform: translateY(0)    scale(1);    }
    50%       { transform: translateY(-28px) scale(1.06); }
}

/* ── Card: frosted glass panel ───────────────────────────── */
.login-card {
    position: relative;
    z-index: 1;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(45, 84, 99, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 48px 44px 38px;
    box-shadow:
        0 0 0 1px rgba(45, 156, 219, 0.08),
        0 28px 72px rgba(0, 0, 0, 0.55),
        0 0 100px rgba(45, 84, 99, 0.12) inset;
    animation: loginCardAppear 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardAppear {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Subtle top shimmer line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(45, 156, 219, 0.5) 50%,
        transparent 100%
    );
    border-radius: 100%;
}

/* ── Logo ─────────────────────────────────────────────────── */
.login-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(45, 156, 219, 0.45));
    animation: loginLogoPulse 4s ease-in-out infinite;
}

@keyframes loginLogoPulse {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(45, 156, 219, 0.4)); }
    50%       { filter: drop-shadow(0 0 20px rgba(45, 156, 219, 0.7)); }
}

/* ── Title & subtitle ─────────────────────────────────────── */
.login-title-group {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-size: 21px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 7px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.38);
    margin: 0;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

/* ── Error banner ─────────────────────────────────────────── */
.login-error {
    display: flex;             /* toggled to 'flex' by callback */
    align-items: center;
    gap: 8px;
    background: rgba(255, 77, 77, 0.11);
    border: 1px solid rgba(255, 77, 77, 0.32);
    border-radius: 10px;
    color: #ff8888;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    margin-bottom: 20px;
    animation: loginShake 0.42s ease;
}

.login-error::before {
    content: '⚠';
    font-size: 13px;
    flex-shrink: 0;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%, 60%  { transform: translateX(-7px); }
    40%, 80%  { transform: translateX(7px); }
}

/* ── Form fields ──────────────────────────────────────────── */
.login-field {
    margin-bottom: 18px;
}

.login-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.48);
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 8px;
}

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

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.22);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}

/* Lift icon colour when sibling input is focused */
.login-input-wrapper:focus-within .login-input-icon {
    color: rgba(45, 156, 219, 0.7);
}

.login-input {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.055) !important;
    border: 1px solid rgba(45, 84, 99, 0.65) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    padding: 16px 14px 16px 42px !important;
    min-height: 50px !important;
    outline: none !important;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s !important;
    box-sizing: border-box !important;
    caret-color: #2d9cdb;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.22) !important;
}

.login-input:focus {
    border-color: rgba(45, 156, 219, 0.65) !important;
    background: rgba(45, 156, 219, 0.07) !important;
    box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.13) !important;
}

/* ── Submit button ────────────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 13px 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, #2D5463 0%, #2d9cdb 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow:
        0 4px 20px rgba(45, 156, 219, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow:
        0 7px 28px rgba(45, 156, 219, 0.38),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.login-btn:active {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 2px 10px rgba(45, 156, 219, 0.2);
}

/* ── Footer ───────────────────────────────────────────────── */
.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 26px;
}

.login-footer-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
}

.login-footer-sep {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.12);
}

/* ── Responsive: smaller cards on mobile ─────────────────── */
@media screen and (max-width: 480px) {
    .login-card {
        padding: 36px 28px 30px;
        border-radius: 16px;
    }
    .login-title {
        font-size: 18px;
    }
}
