﻿/* ════════════════════════════════════════════════════════════════════
   SystemLogin.css  —  JPSC Group Holdings Inc.
   Dark glass redesign — Azure / M365 / Atlassian / Oracle Cloud inspired
   Brand: Gold #C8900A · Blue #1A4F8A
   ════════════════════════════════════════════════════════════════════ */

:root {
    /* Gold */
    --brand-gold: #C8900A;
    --brand-gold-light: #E8A612;
    --brand-gold-pale: #FDF3DC;
    --brand-gold-glow: rgba(200,144,10,0.28);
    /* Blue */
    --brand-blue: #1A4F8A;
    --brand-blue-mid: #2D6EC0;
    --brand-blue-glow: rgba(26,79,138,0.35);
    /* Dark surfaces */
    --login-page-bg: #08111F;
    --login-navy: #0F172A;
    --login-card-bg: rgba(17,25,40,.72);
    --login-card-border: rgba(255,255,255,0.08);
    --login-brand-bg: #0F1C2E;
    --login-text: #EDF2F7;
    --login-text-muted: #8A9AB0;
    --login-input-bg: rgba(255,255,255,0.035);
    --login-input-border: rgba(255,255,255,0.12);
    --login-input-text: #EDF2F7;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* ── Body / page background ────────────────────────────────────── */
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background-color: var(--login-page-bg);
    background-image: radial-gradient(circle at 85% 15%, rgba(26,79,138,.28), transparent 45%), radial-gradient(circle at 5% 80%, rgba(232,166,18,.10), transparent 40%), linear-gradient( 135deg, #08111F, var(--login-navy) 55%, #08111F);
    overflow-x: hidden;
}

/* The WebForms <form> wraps the whole page. Left alone it shrink-wraps
   to its content, so on viewports narrower than the brand+card row the
   form just overflows and the flex items never get to shrink. Pin it to
   the viewport width instead; the container below centers within it. */
#form1 {
    width: 100%;
}

/* ── Decorative corner elements (dot grids + diagonal light streaks) ─── */
/* ── Decorative background (dot grids + glowing golden streaks) ── */
.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

    /* Dot grids — rectangular fade like the reference, not circular */
    .bg-decor .dot-grid {
        position: absolute;
        width: 150px;
        height: 170px;
        background-image: radial-gradient(circle, rgba(232,166,18,1) 1.4px, transparent 2px);
        background-size: 19px 19px;
        -webkit-mask-image: linear-gradient(135deg, #000 30%, transparent 90%);
        mask-image: linear-gradient(135deg, #000 30%, transparent 90%);
        opacity: .8;
    }

        .bg-decor .dot-grid.top-left {
            top: 28px;
            left: 26px;
        }

        .bg-decor .dot-grid.bottom-left {
            bottom: 60px;
            left: 26px;
        }

    /* ── Golden streaks — long crisp 2px line + soft box-shadow glow.
         No filter:blur on the line itself (that's what causes jagged edges). ── */
    .bg-decor .diag-line {
        position: absolute;
        width: 2px;
        background: linear-gradient(180deg, transparent 0%, rgba(200,144,10,.5) 18%, rgba(232,166,18,.95) 42%, #fff6e0 50%, rgba(232,166,18,.95) 58%, rgba(200,144,10,.5) 82%, transparent 100%);
        box-shadow: 0 0 18px 1.5px rgba(232,166,18,.38);
        transform: rotate(45deg);
        transform-origin: center;
        backface-visibility: hidden;
    }

        /* Two thin parallel companion lines, offset to one side (image 3) */
        .bg-decor .diag-line::before {
            content: '';
            position: absolute;
            top: 10%;
            bottom: 10%;
            left: -20px;
            width: 16px;
            background: linear-gradient(180deg, transparent, rgba(148,180,230,.45) 30%, rgba(148,180,230,.45) 70%, transparent) left center / 1px 100% no-repeat, linear-gradient(180deg, transparent, rgba(148,180,230,.22) 35%, rgba(148,180,230,.22) 65%, transparent) right center / 1px 100% no-repeat;
        }

        /* Elongated lens-flare hotspot at the midpoint (image 3) —
           an ellipse gradient along the line axis, not a round dot */
        .bg-decor .diag-line::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 12px;
            height: 180px;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            background: radial-gradient(50% 50% at 50% 50%, rgba(255,255,255,.95) 0%, rgba(255,226,168,.8) 14%, rgba(232,166,18,.4) 42%, transparent 75%);
            box-shadow: 0 0 26px 7px rgba(232,166,18,.28);
        }

        /* Top-left: long streak entering top edge ~25% and exiting left edge ~38% */
        .bg-decor .diag-line.one {
            top: -160px;
            left: 12%;
            height: 800px;
        }

        /* Right side: passes behind the card's right edge (image 5) */
        .bg-decor .diag-line.two {
            right: -60px;
            bottom: -160px;
            height: 640px;
            opacity: .85;
        }

            .bg-decor .diag-line.two::before {
                display: none;
            }

            .bg-decor .diag-line.two::after {
                height: 140px;
            }

        /* Bottom-left: short hot streak crossing the chevron base (image 4) */
        .bg-decor .diag-line.three {
            left: 9%;
            bottom: -210px;
            height: 430px;
        }

            .bg-decor .diag-line.three::before {
                display: none;
            }

            .bg-decor .diag-line.three::after {
                height: 150px;
            }

    .bg-decor .blue-line {
        position: absolute;
        width: 1px;
        background: linear-gradient(180deg, transparent 0%, rgba(140,170,220,.25) 30%, rgba(140,170,220,.25) 70%, transparent 100%);
        transform: rotate(45deg);
        backface-visibility: hidden;
    }

        .bg-decor .blue-line.far {
            top: -140px;
            left: 5%;
            height: 900px;
        }
    /* ── Big dark chevron/arrow at the bottom (image 4) ── */
    .bg-decor .accent-chevron {
        position: absolute;
        bottom: -60px;
        left: 30%;
        width: 340px;
        height: 300px;
        opacity: .85;
        background: linear-gradient(115deg, rgba(26,42,66,.9) 0%, rgba(13,24,40,.55) 55%, rgba(10,18,32,.15) 100%);
        clip-path: polygon(0% 78%, 50% 0%, 100% 78%, 100% 100%, 50% 26%, 0% 100%);
        transform: rotate(90deg); /* apex points right, like the reference */
    }

@media (max-width: 920px) {
    .bg-decor .accent-chevron {
        display: none;
    }

    .bg-decor .diag-line.one {
        height: 520px;
        left: 4%;
    }

    .bg-decor .diag-line.two {
        display: none;
    }
}
/* ── Layout ─────────────────────────────────────────────────────── */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(48px, 6vw, 120px);
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(24px, 4vh, 48px) 32px;
}

/* ════════════════════════════════════════════════════════════════
   LEFT — brand panel (sits directly on page background, no card)
   ════════════════════════════════════════════════════════════════ */
.login-brand {
    flex: 0 1 auto;
    width: 480px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

    .login-brand .brand-icon {
        position: relative;
        /* Logo scales with viewport HEIGHT so short laptop screens get a
           proportionally smaller mark and the whole brand block always
           fits without overlapping the corner streaks. */
        width: clamp(180px, 32vh, 320px);
        height: clamp(180px, 32vh, 320px);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: clamp(20px, 4vh, 40px);
        filter: drop-shadow(0 0 34px rgba(232,166,18,.50)) drop-shadow(0 18px 50px rgba(200,144,10,.35));
    }

        .login-brand .brand-icon::before {
            content: "";
            position: absolute;
            width: 88%;
            height: 88%;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(232,166,18,.22) 0%, rgba(26,79,138,.16) 40%, transparent 70%);
            z-index: -1;
        }

        .login-brand .brand-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

.login-brand .eyebrow {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--login-text);
    opacity: 0.85;
    margin-bottom: 8px;
}

.login-brand h1 {
    font-size: clamp(2.75rem, 4.2vw, 4rem);
    font-weight: 800;
    color: var(--login-text);
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

    .login-brand h1 .accent {
        color: var(--brand-gold-light);
    }

.login-brand .divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-gold), transparent);
    border-radius: 2px;
    margin-bottom: 20px;
}

.login-brand p {
    font-size: 0.98rem;
    color: var(--login-text-muted);
    line-height: 1.65;
    max-width: 360px;
}

/* ════════════════════════════════════════════════════════════════
   RIGHT — floating glass card
   ════════════════════════════════════════════════════════════════ */
.login-card {
    flex: 0 1 auto;
    width: 560px;
    max-width: 100%;
    min-width: 0;
    background: var(--login-card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--login-card-border);
    border-radius: 26px;
    padding: clamp(36px, 3.6vw, 56px) clamp(28px, 3.4vw, 52px);
    box-shadow: 0 35px 80px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.03);
}

.login-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--login-text);
    text-align: center;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

    .login-title .accent {
        color: var(--brand-gold-light);
    }

.login-subtitle {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--login-text-muted);
    text-align: center;
    margin-bottom: 36px;
}

/* ── Error panel ────────────────────────────────────────────────── */
.error-msg {
    background: rgba(220,38,38,0.12);
    border: 1px solid rgba(220,38,38,0.35);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.825rem;
    color: #fca5a5;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Fields ─────────────────────────────────────────────────────── */
.form-field {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--login-text);
    margin-bottom: 8px;
}

    .form-label i {
        color: var(--brand-gold-light);
        font-size: 0.95rem;
    }

input.form-control,
textarea.form-control {
    display: block;
    width: 100%;
    height: 60px;
    border-radius: 14px;
    border: 1px solid var(--login-input-border);
    background: var(--login-input-bg);
    color: #EDF2F7 !important; /* Forces text color to white/light gray */
    -webkit-text-fill-color: #EDF2F7 !important; /* Fixes overrides from browser extensions */
    padding: 0 18px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .25s, background-color .25s, box-shadow .25s;
}

    /* Make sure the placeholder text stays muted */
    input.form-control::placeholder {
        color: #8A9AB0 !important;
        opacity: 1;
    }

.form-control:focus {
    outline: none;
    border-color: var(--brand-gold-light);
    background: rgba(255,255,255,.055);
    box-shadow: 0 0 0 3px rgba(232,166,18,.18);
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #EDF2F7 !important; /* Ensures autofill text is also white */
    -webkit-box-shadow: 0 0 0 1000px rgba(16,28,46,0.95) inset;
    box-shadow: 0 0 0 1000px rgba(16,28,46,0.95) inset;
    caret-color: #EDF2F7;
    transition: background-color 9999s ease-in-out 0s;
}

.pw-field-wrap {
    position: relative;
}

    .pw-field-wrap .form-control {
        padding-right: 46px;
    }

.btn-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--login-text-muted);
    padding: 8px 10px;
    cursor: pointer;
    transition: color 0.2s;
}

    .btn-toggle-pw:hover {
        color: var(--brand-gold-light);
    }

    .btn-toggle-pw:focus-visible {
        outline: 2px solid var(--brand-gold-light);
        outline-offset: 2px;
        border-radius: 6px;
    }

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none !important;
}

/* ── Validator messages ─────────────────────────────────────────── */
.validator-msg {
    font-size: 0.75rem;
    color: #fca5a5;
    margin-top: 5px;
    display: block;
}

/* ── Remember me / forgot password row ─────────────────────────── */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

    .remember-row .remember-check {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .remember-row input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: var(--brand-gold);
        cursor: pointer;
    }

    .remember-row label {
        font-size: 0.815rem;
        color: var(--login-text-muted);
        cursor: pointer;
        margin: 0;
    }

    .remember-row .forgot-link {
        font-size: 0.815rem;
        color: var(--brand-gold-light);
        text-decoration: none;
        font-weight: 600;
    }

        .remember-row .forgot-link:hover {
            text-decoration: underline;
        }

        .remember-row .forgot-link:focus-visible {
            outline: 2px solid var(--brand-gold-light);
            outline-offset: 3px;
            border-radius: 4px;
        }

        /* Not implemented yet — visibly inert instead of a live-looking
           dead link. See the `title` attribute in the markup for the
           user-facing explanation. */
        .remember-row .forgot-link[aria-disabled="true"] {
            color: var(--login-text-muted);
            opacity: .6;
            cursor: not-allowed;
            pointer-events: none;
        }

            .remember-row .forgot-link[aria-disabled="true"]:hover {
                text-decoration: none;
            }

/* ── Sign in button (renders as an <a> — asp:LinkButton) ──────────
   Text is centered in the button; the arrow icon is pinned to the
   right edge independently via absolute positioning, so it doesn't
   push the label off-center. ────────────────────────────────────── */
.btn-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    padding: 0 60px;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(95deg, #F0D089 0%, #E8B54A 48%, #DB9C27 100%);
    color: #221503;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: box-shadow .25s;
    box-shadow: 0 10px 30px rgba(200,144,10,.22);
}

    .btn-login span {
        color: #221503;
    }

    .btn-login i {
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        color: #221503;
        font-size: 1.05rem;
    }

    .btn-login:hover {
        box-shadow: 0 15px 35px rgba(200,144,10,.35);
    }

    .btn-login:focus-visible {
        outline: 2px solid var(--brand-gold-light);
        outline-offset: 3px;
    }

    .btn-login[aria-disabled="true"] {
        opacity: .7;
        cursor: default;
    }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer-text {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--login-text-muted);
    margin-top: 28px;
    opacity: 0.75;
    width: 100%;
}

/* ── SweetAlert2 (dark, matches JPSCTheme.js BrandSwal mixin) ────── */
.swal-login-popup {
    border-radius: 16px !important;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #2D6EC0, #1A4F8A) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
}

    .swal2-confirm:focus {
        box-shadow: 0 0 0 3px var(--brand-blue-glow) !important;
    }

/* ── Responsive ─────────────────────────────────────────────────── */

/* Narrow desktop — the corner streaks and dot grids keep fixed pixel
   geometry, so on screens below ~1400px the brand block drifts left
   toward them. Pull the decorations toward the corner (and shorten the
   long streak) so they stay clear of the logo and heading. */
@media (max-width: 1400px) {
    .bg-decor .diag-line.one {
        left: 2%;
        height: 520px;
    }

    .bg-decor .blue-line.far {
        left: 1%;
        height: 620px;
    }

    .bg-decor .dot-grid {
        width: 120px;
        height: 140px;
    }
}

/* Desktop sizes below 1440px no longer snap to new values — the gap,
   brand column, card width and card padding all scale fluidly with
   the viewport (clamp() above), so the logo and heading stay put
   instead of jumping at a breakpoint. */

/* Tablet — logo/brand block moves on top, card centered below it */
@media (max-width: 920px) {
    .login-container {
        flex-direction: column;
        gap: 40px;
        padding: 40px 28px;
    }

    .login-brand {
        align-items: center;
        text-align: center;
        flex: none;
    }

        .login-brand .brand-icon {
            width: 220px;
            height: 220px;
            margin-bottom: 28px;
        }

            .login-brand .brand-icon::before {
                width: 190px;
                height: 190px;
            }

        .login-brand .divider {
            margin-left: auto;
            margin-right: auto;
        }

        .login-brand p {
            max-width: 420px;
        }

    .login-card {
        flex: none;
        width: 100%;
        max-width: 480px;
    }
}

/* Mobile — single column, full-width card, no overflow */
@media (max-width: 560px) {
    .login-container {
        padding: 32px 18px;
        gap: 32px;
    }

    .login-brand .brand-icon {
        width: 160px;
        height: 160px;
        margin-bottom: 22px;
    }

        .login-brand .brand-icon::before {
            width: 140px;
            height: 140px;
        }

    .login-brand h1 {
        font-size: 2.1rem;
        margin-bottom: 18px;
    }

    .login-brand p {
        font-size: 0.9rem;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        padding: 36px 24px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.7rem;
    }

    .form-control {
        height: 54px;
    }

    .btn-login {
        min-height: 54px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .form-control {
        transition: none;
    }
}


/* ── Login success overlay ─────────────────────────────────────────
   Timing contract: the ring-fill duration is set from JS (inline
   --success-duration custom property) so there is exactly ONE place
   (the `delay` constant in showLoginSuccessOverlay) that controls
   how long the success state is shown before redirecting. The CSS
   default below (900ms) only applies if JS never set the variable. */
.login-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8,17,31,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity .35s ease, visibility .35s ease;
}

    .login-success-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.success-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    animation: successPop .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes successPop {
    0% {
        transform: scale(.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon-wrap {
    position: relative;
    width: 128px;
    height: 128px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-logo {
    width: 78px;
    height: 78px;
    object-fit: contain;
    filter: drop-shadow(0 0 22px rgba(232,166,18,.55));
}

.success-ring {
    position: absolute;
    inset: 0;
    width: 128px;
    height: 128px;
    transform: rotate(-90deg);
}

.success-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,.08);
    stroke-width: 4;
}

.success-ring-progress {
    fill: none;
    stroke: var(--brand-gold-light);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    filter: drop-shadow(0 0 6px rgba(232,166,18,.6));
    animation: ringFill var(--success-duration, 900ms) ease forwards;
}

@keyframes ringFill {
    to {
        stroke-dashoffset: 0;
    }
}

.success-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--login-text);
    margin-bottom: 8px;
}

.success-subtitle {
    font-size: .95rem;
    color: var(--login-text-muted);
}

.success-hint {
    font-size: .78rem;
    color: var(--login-text-muted);
    opacity: .6;
    margin-top: 18px;
}

/* Reduced motion: skip the pop-in and the ring sweep. The overlay
   still fades in (opacity-only, not a translate/scale), which is
   generally fine under reduced-motion guidance; the ring simply
   appears already complete rather than animating to that state. */
@media (prefers-reduced-motion: reduce) {
    .success-box {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .success-ring-progress {
        animation: none;
        stroke-dashoffset: 0;
    }
}
