/* PPORJ DATA — Emerald Green & Gold responsive login */
:root {
    --emerald: #064e3b;
    --emerald-dark: #023b2c;
    --gold: #f5c400;
    --ivory: #fffdf7;
    --art-ratio: 1.7768; /* 1672 / 941 */
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 105% 27% at 50% 23%,
            rgba(3, 124, 88, .42) 0%,
            rgba(3, 124, 88, 0) 76%),
        radial-gradient(ellipse 105% 30% at 50% 80%,
            rgba(2, 112, 80, .34) 0%,
            rgba(2, 112, 80, 0) 78%),
        linear-gradient(180deg,
            #003b2e 0%,
            #004b39 24%,
            #004b39 76%,
            #003d30 100%);
    color: var(--ivory);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.viewport {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 105% 27% at 50% 23%,
            rgba(3, 124, 88, .42) 0%,
            rgba(3, 124, 88, 0) 76%),
        radial-gradient(ellipse 105% 30% at 50% 80%,
            rgba(2, 112, 80, .34) 0%,
            rgba(2, 112, 80, 0) 78%),
        linear-gradient(180deg,
            #003b2e 0%,
            #004b39 24%,
            #004b39 76%,
            #003d30 100%);
}

/* Desktop: compress the artwork horizontally so the login panel is closer
   to a square proportion, while the emerald page remains full-screen. */
.stage {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max(100vw, calc(100dvh * var(--art-ratio)));
    height: max(100dvh, calc(100vw / var(--art-ratio)));
    aspect-ratio: var(--art-ratio);
    flex: 0 0 auto;
    overflow: hidden;
}

.artwork {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.login-form { position: absolute; inset: 0; z-index: 2; margin: 0; padding: 0; }

.input-wrap {
    position: absolute;
    left: 35.4%;
    width: 28.1%;
    height: 7.35%;
}
.username-wrap { top: 45.8%; }
.password-wrap { top: 54.6%; }

.input-wrap input {
    position: absolute;
    top: 0;
    left: 18%;
    width: 75%;
    height: 100%;
    margin: 0;
    /* Small top padding corrects the browser's high-looking text baseline. */
    padding: 8px 8px 0 0;
    border: 0 !important;
    border-radius: 0;
    outline: none !important;
    background: transparent !important;
    color: #244c3e !important;
    -webkit-text-fill-color: #244c3e !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: clamp(14px, 1.25vw, 22px);
    font-weight: 400;
    line-height: 1.35;
    text-align: left !important;
    text-align-last: left !important;
    text-indent: 0 !important;
    direction: ltr;
    unicode-bidi: plaintext;
    caret-color: #0a6248;
    text-shadow: none !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
}
.input-wrap input::placeholder { color: transparent; opacity: 0; }
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active {
    -webkit-text-fill-color: #244c3e !important;
    transition: background-color 99999s ease-out 0s;
    box-shadow: 0 0 0 1000px transparent inset !important;
    border: 0 !important;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 1.8%;
    width: 9%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
}

.password-toggle:focus-visible,
.login-submit:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 8px;
}

/* One visible native checkbox, vertically centered against the artwork label. */
.remember-wrap {
    position: absolute;
    inset: 67.2% auto auto 36.8%;
    width: 34%;
    height: 4.2%;
    display: block;
    cursor: pointer;
}

/* Prevent transient blue tap/selection flashes on Android Chrome. */
.remember-wrap,
.remember-wrap * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.remember-wrap input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(20px, 2vw, 30px);
    height: clamp(20px, 2vw, 30px);
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 2px solid #71877d;
    border-radius: 5px;
    background: #fff;
    opacity: 1;
    z-index: 3;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.remember-wrap input:checked {
    background: linear-gradient(145deg, #087653, #023b2c);
    border-color: #f5c400;
    box-shadow: 0 0 0 1px rgba(245,196,0,.25);
}
.remember-wrap input:checked::after {
    content: "✓";
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: clamp(13px, 1.25vw, 19px);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.remember-wrap input:focus-visible {
    outline: 2px solid #0b684b;
    outline-offset: 3px;
}
.remember-wrap .custom-checkbox,
.remember-wrap .remember-label { display: none; }

.login-submit {
    position: absolute;
    left: 51.5%;
    top: 67.5%;
    width: 12.5%;
    height: 7.5%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}
.login-error {
    position: absolute;
    left: 34%;
    top: 77.5%;
    width: 32%;
    z-index: 5;
    padding: 8px 12px;
    border: 1px solid #d9a900;
    border-radius: 7px;
    background: rgba(111,20,20,.96);
    color: #fff;
    font-size: clamp(10px, .9vw, 15px);
    line-height: 1.35;
    text-align: center;
}

/* Portrait phones and tablets: keep the artwork's native landscape ratio.
   The previous 600px breakpoint missed some phones reporting a 720px CSS
   viewport, so they incorrectly used the desktop 76vw x 100dvh layout and
   stretched the artwork vertically. */
@media (max-width: 900px) and (orientation: portrait) {
    .stage {
        width: min(220vw, calc(100dvh * var(--art-ratio)));
        height: auto;
        aspect-ratio: 1672 / 941;
    }

    .artwork {
        width: 100%;
        height: 100%;
        object-fit: contain; /* stage now has the exact source-artwork ratio */
    }

    .input-wrap input {
        font-size: clamp(15px, 2.8vw, 20px);
    }

    /* Keep a clear visual gap between the functional checkbox and the
       Remember Me label baked into the artwork on portrait phones. */
    .remember-wrap {
        left: 36.3%;
    }

    .remember-wrap input {
        width: clamp(20px, 3vw, 24px);
        height: clamp(20px, 3vw, 24px);
        border-width: 1.5px;
        border-radius: 4px;
    }

    .remember-wrap input:checked::after {
        font-size: 14px;
    }

    .login-error {
        font-size: 11px;
        padding: 5px 7px;
    }
}

/* Landscape phones and compact tablets: fit the artwork without stretching. */
@media (max-width: 900px) and (orientation: landscape) {
    .stage {
        width: max(100vw, calc(100dvh * var(--art-ratio)));
        height: max(100dvh, calc(100vw / var(--art-ratio)));
        aspect-ratio: 1672 / 941;
    }

    .artwork {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
