/*
 * HRIS login — glass card over a particle field.
 *
 * Design copied from the legacy Yii2 sign-in page:
 *   navy #1d243d backdrop · translucent card · 10px blue top rule + 10px gold
 *   bottom rule · dark slate inputs · light-blue pill button that turns purple
 *   on hover.
 *
 * The legacy sheet positioned the button and error bar absolutely inside a
 * fixed 400x400 box. That is reproduced here as normal flow instead — Filament
 * injects its own form markup and validation nodes, and absolute offsets would
 * break the moment an error message appears.
 *
 * Loaded only on the login route (render hook scoped to the Login page), and
 * everything is namespaced under .fi-simple-layout / .hris-glass-card so it
 * cannot leak into the authenticated panel.
 */

:root {
    --hris-navy: #1d243d;
    --hris-accent: #79a6fe;   /* legacy top rule + button */
    --hris-gold: #ffc312;     /* legacy bottom rule */
    --hris-hover: #5d33e6;    /* legacy button hover */

    /* Measured off the live legacy page (dtr.informatics.edu.ph/auth/login):
       .container = rgba(41,39,39,.3) with backdrop-filter: NONE. The absence
       of blur is the whole trick — it is what keeps the particle dots and
       link lines crisp behind the card instead of smearing them into a wash.
       Do not reintroduce a backdrop-filter here. */
    --hris-glass-bg: rgba(41, 39, 39, 0.3);
    --hris-glass-border: rgba(121, 166, 254, 0.18);

    /* Also unblurred and kept well under 50% so particles travel through the
       fields too, not just the gaps between them. */
    --hris-field-bg: rgba(38, 46, 73, 0.42);
    --hris-field-bg-focus: rgba(38, 46, 73, 0.6);
    --hris-field-border: rgba(121, 166, 254, 0.22);

    --hris-text-muted: #a1a4ad;
    --hris-placeholder: #565f79;
}

/* ── Background ─────────────────────────────────────────────────────────── */

.fi-simple-layout {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--hris-navy);
    /* Source Sans Pro if the OS has it, else Filament's Inter. No extra
       webfont request just for the login screen. */
    font-family: 'Source Sans Pro', 'Source Sans 3', Inter, ui-sans-serif, system-ui, sans-serif;
    overflow: hidden;
}

/* Filament paints a sheet on the simple layout — clear it so the particle
   field and navy backdrop show through. */
.fi-simple-layout .fi-simple-main,
.fi-simple-layout .fi-simple-main-ctn {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    max-width: 27rem;
    width: 100%;
}

/* Stock Filament header (brand + "Sign in" heading) — replaced by our own. */
.fi-simple-layout .fi-simple-header {
    display: none !important;
}

#hris-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

#hris-particles canvas {
    display: block;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.hris-glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.75rem 1.75rem 2rem;
    border-radius: 9px;
    background: var(--hris-glass-bg);
    /* no backdrop-filter — see the note on --hris-glass-bg */

    /* legacy signature: blue rule on top, gold rule on the bottom */
    border: 1px solid var(--hris-glass-border);
    border-top: 10px solid var(--hris-accent);
    border-bottom: 10px solid var(--hris-gold);

    box-shadow: 0 5px 30px #000;
    text-shadow: 0 1px 3px rgba(6, 10, 26, 0.7);
    animation: hris-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hris-card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

.hris-glass-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hris-glass-logo {
    display: block;
    width: 78%;
    max-width: 250px;
    height: auto;
    margin: 0.5rem auto 0;
    /* the mark is light-on-transparent; a soft shadow lifts it off the
       translucent card when a particle drifts behind it */
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.hris-glass-subtitle {
    margin: 1.15rem 0 0;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: var(--hris-text-muted);
}

/* ── Form fields ────────────────────────────────────────────────────────── */

/* The legacy design showed no field labels — the placeholder carries the
   meaning. That is done in PHP via ->hiddenLabel() on each TextInput (which
   keeps the label for screen readers), NOT with a blanket CSS rule here: the
   "Remember me" label wraps its own checkbox, so hiding every
   .fi-fo-field-wrp-label would clip the checkbox out of the page too. */

.hris-glass-card .fi-input-wrp {
    background: var(--hris-field-bg) !important;
    border: 1px solid var(--hris-field-border) !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.hris-glass-card .fi-input-wrp:focus-within {
    background: var(--hris-field-bg-focus) !important;
    border-color: var(--hris-accent) !important;
    box-shadow: 0 0 0 3px rgba(121, 166, 254, 0.2) !important;
}

.hris-glass-card .fi-input {
    background: transparent !important;
    color: #d6d6d6 !important;
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
    font-size: 0.95rem;
}

.hris-glass-card .fi-input::placeholder {
    color: var(--hris-placeholder) !important;
}

/* Kill Chrome's yellow autofill wash — it destroys the glass effect. */
.hris-glass-card .fi-input:-webkit-autofill,
.hris-glass-card .fi-input:-webkit-autofill:hover,
.hris-glass-card .fi-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #d6d6d6 !important;
    -webkit-box-shadow: 0 0 0 1000px #262e49 inset !important;
    caret-color: #d6d6d6;
    transition: background-color 9999s ease-out 0s;
}

/* Prefix (envelope / lock) + suffix (password reveal) icons — the legacy
   design put the same glyphs in the same positions. */
.hris-glass-card .fi-input-wrp-icon,
.hris-glass-card .fi-icon-btn-icon {
    color: #5b6a8f !important;
}

.hris-glass-card .fi-input-wrp-suffix .fi-icon-btn:hover .fi-icon-btn-icon {
    color: var(--hris-accent) !important;
}

/* Remember me — the label element wraps the checkbox itself. */
.hris-glass-card .fi-fo-field-wrp-label:has(input[type='checkbox']),
.hris-glass-card .fi-fo-field-wrp-label:has(input[type='checkbox']) span {
    color: #dfdeee !important;
    font-size: 13px;
    font-weight: 400;
}

.hris-glass-card input[type='checkbox'] {
    background-color: rgba(38, 46, 73, 0.7);
    border: 2px solid #464d64;
    border-radius: 2px;
}

.hris-glass-card input[type='checkbox']:checked {
    background-color: var(--hris-accent);
    border-color: var(--hris-accent);
}

/* ── Submit button (legacy pill) ────────────────────────────────────────── */

.hris-glass-card .fi-btn {
    background: var(--hris-accent) !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 100px !important;
    min-height: 49px;
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50 !important;
    box-shadow: 0 6px 18px -6px rgba(121, 166, 254, 0.55) !important;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.15s ease;
}

.hris-glass-card .fi-btn-label {
    color: #2c3e50 !important;
    transition: color 0.3s ease;
}

.hris-glass-card .fi-btn:hover:not(:disabled) {
    background: var(--hris-hover) !important;
    transform: translateY(-1px);
}

.hris-glass-card .fi-btn:hover:not(:disabled),
.hris-glass-card .fi-btn:hover:not(:disabled) .fi-btn-label {
    color: #fff !important;
}

.hris-glass-card .fi-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ── Validation + session errors (legacy red bar) ───────────────────────── */

.hris-glass-card .fi-fo-field-wrp-error-message {
    display: block;
    margin-top: 0.4rem;
    padding: 3px 8px;
    border-radius: 5px;
    background: #ff3333;
    color: #fff !important;
    font-size: 12.5px;
    text-align: center;
    text-shadow: none;
}

.hris-glass-card .fi-input-wrp.fi-invalid {
    border-color: #ff3333 !important;
}

/* ── Accessibility / responsive ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .hris-glass-card {
        padding: 1.5rem 1.15rem 1.75rem;
    }
    .hris-glass-logo { width: 85%; }
    .hris-glass-subtitle { font-size: 12px; letter-spacing: 1px; }
    .hris-glass-card .fi-btn { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .hris-glass-card { animation: none; }
    #hris-particles { display: none; }
}

/* No backdrop-filter is used anywhere on this page, so there is no
   unsupported-browser fallback to write — the card is plain alpha compositing,
   which every browser handles. */
