/* =====================================================================
   signin-pro.css — professional staff login + OTP for Evandy UNHMS.

   A secure institutional admin portal, not a consumer app. Split layout:
   a branded purple panel (crest + reassurance) beside a clean white form.
   Collapses to a single centered card on mobile. Shared by /signin and
   /otpverify so the two-step flow feels like one continuous experience.

   Brand accent: #563d7c (the app's existing header purple).
   ===================================================================== */

:root {
    --brand: #563d7c;
    --brand-700: #472f6a;
    --brand-900: #35234f;
    --ink: #1f2430;
    --muted: #6b7280;
    --line: #e4e7ec;
    --field: #f7f8fa;
    --paper: #ffffff;
    --danger: #b3261e;
    --danger-bg: #fdecea;
    --success: #1a7f37;
    --success-bg: #e7f4ec;
    --focus: rgba(86, 61, 124, 0.28);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #eef0f4;
    -webkit-font-smoothing: antialiased;
}

/* Full-viewport split shell */
.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}
/* Grid/flex children must be allowed to shrink below content min-width,
   otherwise a long field/label forces the column wider than the viewport. */
.auth-shell > * { min-width: 0; }

/* ---------- Left: brand panel ---------- */
.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(1200px 500px at 15% -10%, rgba(255,255,255,0.14), transparent 60%),
        radial-gradient(900px 600px at 110% 110%, rgba(0,0,0,0.28), transparent 55%),
        linear-gradient(155deg, var(--brand) 0%, var(--brand-700) 48%, var(--brand-900) 100%);
    padding: 56px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Centered brand mark — clean, no marketing copy */
.auth-brand-center { position: relative; text-align: center; }
.auth-brand-center img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 0 auto 18px;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.3));
}
.auth-brand-center .name {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.auth-brand-center .sys {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.82;
}
/* faint grid texture */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(700px 500px at 30% 20%, #000, transparent 75%);
    pointer-events: none;
}
/* ---------- Right: form panel ---------- */
.auth-main {
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card { width: 100%; max-width: 380px; }

/* Mobile-only compact brand header (hidden on desktop) */
.auth-mobilebrand { display: none; }

.auth-head { margin-bottom: 26px; }
.auth-head h2 {
    margin: 0 0 6px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.auth-head p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* Result banner (JS toggles display + badge-success/badge-danger classes) */
#form-result { margin-bottom: 16px; }
#form-result label {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    white-space: normal;
    background: var(--field);
    color: var(--ink);
    border: 1px solid var(--line);
}
#form-result label.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #f3c9c5; }
#form-result label.badge-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cc; }
#form-result label.badge-primary { background: var(--field); color: var(--muted); border-color: var(--line); }

/* Fields — Bootstrap input-group markup is preserved but restyled */
.auth-card .input-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--field);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.auth-card .input-group:focus-within {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px var(--focus);
}
.auth-card .input-group-prepend { display: flex; }
.auth-card .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
}
.auth-card .input-group:focus-within .input-group-text { color: var(--brand); }
.auth-card .form-control {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 13px 14px 13px 0;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    min-width: 0;
}
.auth-card .form-control::placeholder { color: #9aa1ac; }

/* Submit button (and the reset-flow action buttons, which are type="button"
   so they don't submit the sign-in form — they get the same brand look). */
.auth-card button[type="submit"],
.auth-card #reset-panel button,
.auth-card .btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    border: 0;
    border-radius: 11px;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 13px 16px;
    margin-top: 4px;
    cursor: pointer;
    transition: background .16s ease, transform .06s ease, box-shadow .16s ease;
    box-shadow: 0 6px 16px rgba(86, 61, 124, 0.28);
}
.auth-card button[type="submit"]:hover,
.auth-card #reset-panel button:hover { background: var(--brand-700); }
.auth-card button[type="submit"]:active,
.auth-card #reset-panel button:active { transform: translateY(1px); }
.auth-card button[type="submit"]:focus-visible,
.auth-card #reset-panel button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.auth-card button[type="submit"]:disabled,
.auth-card #reset-panel button:disabled { opacity: 0.75; cursor: default; }
.auth-card .img-loader { display: none; height: 18px; width: 18px; }

/* OTP: larger, spaced code entry */
.auth-card .otp-field .form-control {
    padding-left: 14px;
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 20px;
    font-weight: 700;
}
.auth-card .otp-field .input-group-text { width: 40px; }

/* Secondary link / footer */
.auth-alt {
    margin-top: 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}
.auth-alt a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.auth-foot {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #9aa1ac;
    line-height: 1.5;
}

/* Legacy .container-fluid / .card / .footer wrappers left by old markup:
   neutralise so they don't fight the new layout if still present. */
.auth-shell .card { background: transparent; border: 0; box-shadow: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .auth-shell { display: block; width: 100%; }
    .auth-brand { display: none; }
    .auth-main {
        display: block;
        width: 100%;
        padding: 44px 18px;
        background: #eef0f4;
    }
    .auth-card {
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 30px 24px 26px;
        box-shadow: 0 12px 34px rgba(20, 24, 34, 0.08);
    }
    .auth-mobilebrand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 22px;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--line);
    }
    .auth-mobilebrand img { width: 44px; height: 44px; object-fit: contain; }
    .auth-mobilebrand .name { font-size: 16px; font-weight: 800; color: var(--ink); }
    .auth-mobilebrand .sys { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
}

@media (max-width: 420px) {
    .auth-main { padding: 22px 14px; }
    .auth-card { border-radius: 14px; padding: 24px 18px; }
    .auth-head h2 { font-size: 21px; }
}
