﻿/* ==============================
   ROOT / RESET
============================== */
:root {
    --text: rgba(234,240,255,.92);
    --muted: rgba(234,240,255,.70);
    --border: rgba(255,255,255,.18);
    --glass: rgba(255,255,255,.10);
    --glass-dark: rgba(0,0,0,.22);
    --shadow: 0 24px 70px rgba(0,0,0,.45);
    --accent1: #8fb0ff;
    --accent2: #a78bfa;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    /* Lock the background to the viewport so that even if the page does
       end up scrolling (e.g. very short viewport + advert + virtual keyboard
       on mobile), the photo still covers the whole screen instead of
       stopping at body height. */
    background-attachment: fixed !important;
    overflow-x: hidden;
    color: var(--text);
}

/* ==============================
   OVERLAY + STAGE
============================== */

.login-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(900px 600px at 20% 10%, rgba(110,168,255,.18), transparent 55%), radial-gradient(900px 600px at 90% 30%, rgba(167,139,250,.14), transparent 55%);
    z-index: 0;
}

.login-stage {
    position: relative;
    min-height: 100vh;
    padding: 100px 16px 24px;       /* 100 px from top — card pinned, not vertically centred */
    display: flex;
    justify-content: flex-start;    /* anchor content to top of padding area */
    align-items: center;            /* horizontally centre the card */
    flex-direction: column;
    gap: 16px;                      /* space between card and the optional LoginAdvert */
    z-index: 1;
    box-sizing: border-box;
}

/* ==============================
   LOGIN CARD
============================== */

/* Default narrow layout — used when SavedLogins is hidden (no .has-saved
   modifier). 360px keeps the single-column form compact. */
.LoginBackground {
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 14px 16px 16px 16px;
    position: relative;
}

/* Wider two-column layout — applied via .has-saved when Model.showAccountBox
   is true, so the SavedLogins panel sits to the RIGHT of the form fields
   instead of underneath them. Total width still fits within calc(100vw - 32px)
   so we never overflow horizontally on smaller laptops. */
.LoginBackground.has-saved {
    width: 660px;
}

    /* subtle glow */
    .LoginBackground::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: linear-gradient( 135deg, rgba(110,168,255,.35), rgba(167,139,250,.25), transparent 70% );
        filter: blur(24px);
        opacity: .55;
        pointer-events: none;
    }

    .LoginBackground > * {
        position: relative;
        z-index: 1;
    }

/* ==============================
   BRAND / LOGO
============================== */

.brand {
    text-align: center;
    margin-bottom: 10px;
}

/* Two-column body wrapper. By default it's a single column; the
   .has-saved modifier on the parent .LoginBackground promotes it to a
   2-up grid so SavedLogins sits to the right of the form fields. */
.login-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}
.LoginBackground.has-saved .login-body {
    grid-template-columns: 1fr 1fr;
}
.login-col-form { display: flex; flex-direction: column; }
.login-col-saved { display: flex; flex-direction: column; }
.saved-title {
    margin: 0 0 6px 2px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* panel stays the same — height trimmed so the card fits in 100vh on
   1080-ish laptop screens once the LoginAdvert sits below. */
#LogoPanel.logo-panel {
    width: 100%;
    height: 96px;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    background: var(--LoginLogoBackColor);
}

/* image fills the panel (cropped/zoomed) */
#LoginLogoImg.login-logo-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* ✅ fills edges */
    object-position: center; /* try: center, top, 50% 35% etc */

    transform: scale(1.001); /* ✅ zoom in a bit */
    transform-origin: center;
}

/* headings */
.brand-title {
    margin: 6px 0 2px 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--muted);
}

.brand-sub {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* ==============================
   FORM FIELDS
============================== */

.field {
    margin-top: 8px;
}
/* When the form sits in the 2-column body, drop the first field's top
   margin so the column visually aligns with the SavedLogins title. */
.login-col-form .field:first-child { margin-top: 0; }

    .field label {
        display: block;
        margin: 0 0 6px 2px;
        font-size: 12px;
        color: var(--muted);
    }

/* existing class, modernized */
.GTText {
    width: 100% !important;
    height: 44px !important;
    padding: 0 14px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: rgba(255,255,255,.12) !important;
    color: var(--text) !important;
    outline: none !important;
}

    .GTText::placeholder {
        color: var(--loginplaceholdercolor)
    }

    .GTText:focus {
        border-color: rgba(110,168,255,.55) !important;
        box-shadow: 0 0 0 4px rgba(110,168,255,.18) !important;
    }

/* ==============================
   ACTION ROW
============================== */

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

#savelogincheckbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent1);
}


/* ==============================
   SAVED LOGINS
============================== */

/* SavedLogins panel. When inside the 2-column body the height matches
   the form column visually; the flex:1 + min-height combo lets it expand
   to fill but never collapse to nothing if the form is short. */
#SavedLogins {
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 200px;
    max-height: 260px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--glass-dark);
    padding: 8px;
    overflow-y: auto;
    color: var(--text);
}

    #SavedLogins > * {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 10px;
        margin-bottom: 6px;
        border-radius: var(--radius-sm);
        background: rgba(255,255,255,.06);
        cursor: pointer;
        font-size: 13px;
    }

        #SavedLogins > *:hover {
            background: rgba(255,255,255,.10);
        }

/* ==============================
   LINKS + ERROR
============================== */

#ForgotPassword label {
    color: rgba(234,240,255,.86);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

#lblError {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,90,122,.35);
    background: rgba(255,90,122,.12);
    color: #ffd2db;
    font-size: 13px;
}

/* ==============================
   ADVERT (OPTIONAL)
============================== */
.LoginAdvert:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 48px rgba(0,0,0,.45);
}
/* LoginAdvert. Sits below the card via the .login-stage column flex.
   Height trimmed so card + advert + paddings comfortably fit inside
   100vh on common laptop screens (~720–900px tall). */
.LoginAdvert {
    display: block;
    object-fit: scale-down;
    max-width: 660px;
    min-width: 320px;
    height: 160px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

@media (max-width: 768px) {
    .LoginAdvert {
        width: 90vw;
        max-width: 90vw;
        height: 130px;
    }
}

.cursorhand {
    cursor: pointer;
}

/* Hide on narrow screens (saved logins column collapses there too via
   the .has-saved media query below). */
@media (max-width: 900px) {
    .LoginAdvert {
        display: none;
    }
}
/* On short viewports the card alone is the priority — drop the advert
   so we never need to scroll to reach the Login button. */
@media (max-height: 760px) {
    .LoginAdvert {
        display: none;
    }
}

/* Below 720px wide, collapse the two-column body back to a single column
   stack so the form stays usable. The saved logins still appear, just
   underneath the form. */
@media (max-width: 720px) {
    .LoginBackground.has-saved {
        width: 360px;
    }
    .LoginBackground.has-saved .login-body {
        grid-template-columns: 1fr;
    }
}
