﻿/* =========================================
   User/Login page (Scoped)
   Theme: Red / White / Black
   Responsive: min 320px
   IMPORTANT:
   - Everything is scoped under .login-page to avoid affecting Layout
   ========================================= */

.login-page {
    /* Scoped design tokens */
    --bg: #0b0b0f;
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.68);
    --red: #ff2a2a;
    --red2: #ff4b4b;
    --border: rgba(255,255,255,.12);
    --card: rgba(255,255,255,.05);
    --shadow: 0 18px 55px rgba(0,0,0,.45);
    --shadow2: 0 12px 35px rgba(0,0,0,.38);
    --ease: cubic-bezier(.2,.8,.2,1);
    --ease-fast: cubic-bezier(.2,.9,.2,1);
    position: relative;
    padding: clamp(56px, 7vw, 84px) 0;
    overflow: hidden;
    min-height: calc(100vh - 120px); /* safe in most layouts */
    display: grid;
    place-items: center;
    isolation: isolate;
}

/* Background */
.login-page__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-page__orb {
    position: absolute;
    border-radius: 999px;
    opacity: .92;
    filter: blur(1px);
}

.login-page__orb--1 {
    width: 360px;
    height: 360px;
    left: -110px;
    top: 12%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,42,42,.22), transparent 62%);
}

.login-page__orb--2 {
    width: 420px;
    height: 420px;
    right: -160px;
    bottom: -140px;
    background: radial-gradient(circle at 30% 30%, rgba(255,42,42,.28), rgba(255,255,255,.12), transparent 64%);
}

.login-page__ring {
    position: absolute;
    width: 520px;
    height: 520px;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 0 0 1px rgba(255,42,42,.10);
    opacity: .45;
}

/* Container */
.login-page__container {
    width: min(980px, calc(100% - 32px));
    margin-inline: auto;
    z-index: 1;
    display: grid;
    place-items: center;
}

/* Card */
.login-card {
    width: min(520px, 100%);
    border-radius: 22px;
    padding: clamp(16px, 2.6vw, 22px);
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

    .login-card::before {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: 24px;
        background: radial-gradient(900px 320px at 20% 0%, rgba(255,42,42,.18), transparent 60%);
        opacity: .9;
        pointer-events: none;
    }

.login-card__top,
.login-form,
.login-card__bottom {
    position: relative;
    z-index: 1;
}

.login-card__top {
    margin-bottom: 14px;
}

/* Title */
.login-title {
    margin: 14px 0 8px;
    font-size: clamp(26px, 4.2vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: rgba(255,255,255,.94);
}

.login-accent {
    background: linear-gradient(90deg, #fff, #ffd6d6, var(--red2), var(--red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-subtitle {
    margin: 0 0 10px;
    color: rgba(255,255,255,.70);
    line-height: 1.65;
    font-size: clamp(13.5px, 1.8vw, 16px);
}

/* Alerts */
.login-alert {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.18);
    color: rgba(255,255,255,.86);
    font-weight: 800;
}

.login-alert__dot {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    background: radial-gradient(circle at 30% 30%, #fff, var(--red));
    box-shadow: 0 0 0 4px rgba(255,42,42,.14);
}

.login-alert--success {
    border-color: rgba(255,255,255,.14);
}

/* Validation summary */
.login-validation {
    min-height: 20px; /* prevents layout shift */
    margin: 6px 0 12px;
    color: rgba(255,120,120,.95);
    font-weight: 800;
    font-size: 12.5px;
}

/* Grid */
.login-grid {
    display: grid;
    gap: 12px;
}

/* Fields */
.login-field {
    min-width: 0;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .2px;
    color: rgba(255,255,255,.88);
}

.login-inputWrap {
    position: relative;
}

.login-input {
    width: 100%;
    height: 46px;
    border-radius: 16px;
    padding: 0 44px 0 44px; /* icon space */
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(255,255,255,.92);
    outline: none;
    transition: border-color 160ms var(--ease-fast), box-shadow 160ms var(--ease-fast), background 160ms var(--ease-fast);
}

    .login-input::placeholder {
        color: rgba(255,255,255,.45);
    }

    .login-input:focus {
        border-color: rgba(255,255,255,.18);
        box-shadow: 0 0 0 4px rgba(255,42,42,.16);
        background: rgba(0,0,0,.22);
    }

/* Input icons (no external libs) */
.login-inputIcon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.80), rgba(255,42,42,.20), rgba(0,0,0,.12));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 10px 20px rgba(0,0,0,.25);
}

.login-inputIcon--lock {
    background: radial-gradient(circle at 30% 30%, rgba(255,42,42,.65), rgba(255,255,255,.12), rgba(0,0,0,.12));
}

/* Password button */
.login-inputWrap--pw .login-input {
    padding-right: 92px; /* room for Show button */
}

.login-pwBtn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.88);
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms var(--ease-fast), background 160ms var(--ease-fast), border-color 160ms var(--ease-fast);
}

    .login-pwBtn:hover,
    .login-pwBtn:focus-visible {
        outline: none;
        transform: translateY(-50%) translateY(-1px);
        background: rgba(255,255,255,.09);
        border-color: rgba(255,255,255,.18);
    }

/* Field errors */
.login-err {
    display: block;
    min-height: 18px; /* no shift */
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 800;
    color: rgba(255,120,120,.95);
}

/* Login button */
.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,42,42,.52);
    cursor: pointer;
    user-select: none;
    font-weight: 950;
    letter-spacing: .2px;
    color: #0b0b0f;
    background: radial-gradient(120% 140% at 20% 20%, #ffffff 0%, #ffe8e8 12%, #ff8080 40%, #ff2a2a 75%, #b10000 110%);
    box-shadow: 0 18px 42px rgba(255,42,42,.22), 0 12px 28px rgba(0,0,0,.38);
    transition: transform 180ms var(--ease-fast), box-shadow 180ms var(--ease-fast), filter 180ms var(--ease-fast);
    will-change: transform;
}

    .login-btn:hover {
        transform: translateY(-1px);
        filter: saturate(1.05) contrast(1.03);
        box-shadow: 0 22px 58px rgba(255,42,42,.28), 0 14px 32px rgba(0,0,0,.44);
    }

    .login-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(255,42,42,.18), 0 22px 58px rgba(255,42,42,.28), 0 14px 32px rgba(0,0,0,.44);
    }

/* Button loading */
.login-btn__spin {
    width: 16px;
    height: 16px;
    border-radius: 99px;
    border: 2px solid rgba(0,0,0,.25);
    border-top-color: rgba(0,0,0,.65);
    display: none;
    animation: loginSpin 800ms linear infinite;
}

@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

.login-btn.is-loading {
    pointer-events: none;
    opacity: .92;
}

    .login-btn.is-loading .login-btn__spin {
        display: inline-block;
    }

/* Footer */
.login-foot {
    margin: 0;
    text-align: center;
    font-size: 13.5px;
    font-weight: 850;
    color: rgba(255,255,255,.80);
}

.login-muted {
    color: rgba(255,255,255,.70);
}

.login-link {
    color: rgba(255,255,255,.92);
    text-decoration: none;
    margin-left: 6px;
}

    .login-link:hover {
        text-decoration: underline;
    }

/* Reveal */
.login-page [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

    .login-page [data-reveal].is-in {
        opacity: 1;
        transform: translateY(0);
    }

/* Responsive */
@media (max-width: 520px) {
    .login-card {
        border-radius: 20px;
    }

    .login-input {
        height: 44px;
    }

    .login-btn {
        height: 42px;
    }

    .login-inputWrap--pw .login-input {
        padding-right: 88px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .login-page [data-reveal],
    .login-btn,
    .login-input,
    .login-pwBtn {
        transition: none !important;
        animation: none !important;
    }
}
