/* ==========================================================================
   MLIS Portal — Login v2
   Implements the Claude Design "Student Login" comp across all five portals
   (admin / supervisor / teacher / moderator / student). Consumed only by
   application/views/template/login_shell.php.

   Self-contained: local Inter variable font, no vendor CSS/JS.
   oklch() values from the source comp are expressed as their sRGB
   equivalents so older browsers render identically.
   ========================================================================== */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-var.woff2') format('woff2');
}

:root {
    /* brand greens */
    --lg-g600:   #16a34a;
    --lg-g700:   #15803d;
    --lg-deep:   #0e8648;
    --lg-mint:   #4ade80;
    --lg-wash:   #f0fdf4;
    --lg-wash2:  #ecfdf5;

    /* neutrals (sRGB equivalents of the comp's oklch ramp) */
    --lg-ink:    #24262b;   /* oklch(22% .01 260) */
    --lg-ink2:   #35383e;   /* oklch(28% .01 260) */
    --lg-ink3:   #3a3d43;   /* oklch(30% .01 260) */
    --lg-ink4:   #4f535a;   /* oklch(38% .01 260) */
    --lg-ink5:   #64686f;   /* oklch(45% .01 260) */
    --lg-ink6:   #6b6f76;   /* oklch(48% .01 260) */
    --lg-ink7:   #82868f;   /* oklch(58% .01 260) */
    --lg-ink8:   #9096a0;   /* oklch(64% .01 260) */
    --lg-ink9:   #969aa3;   /* oklch(66% .01 260) */
    --lg-hint:   #a5a9b2;   /* oklch(70% .01 260) — placeholders */
    --lg-field:  #f7faf8;   /* oklch(97.5% .004 150) */
    --lg-line:   #dfe5e0;   /* oklch(90% .006 150) */
    --lg-line2:  #e7ebe8;   /* oklch(92% .005 150) */
    --lg-line3:  #edf0ee;   /* oklch(94% .005 150) */

    /* error */
    --lg-err-bg:   #fef2f2;
    --lg-err-line: #fecaca;
    --lg-err-ink:  #b91c1c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.lg-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #052e1c;
}

a { color: var(--lg-g700); text-decoration: none; }
a:hover { color: var(--lg-deep); text-decoration: underline; }

input::placeholder { color: var(--lg-hint); }

/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */
.lg-stage {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(155deg, #0a4a2b 0%, #075733 40%, #04381f 100%);
    display: grid;
    grid-template-rows: auto 1fr auto;
    color: #fff;
}

/* decorative field: drifting blobs, concentric rings, masked grid */
.lg-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lg-blob { position: absolute; border-radius: 50%; filter: blur(10px); }
.lg-blob-a {
    width: 70vw; height: 70vw; left: -18vw; top: -22vw;
    background: radial-gradient(circle, rgba(56,239,125,.30) 0%, rgba(56,239,125,0) 62%);
    animation: lgDrift 26s ease-in-out infinite;
}
.lg-blob-b {
    width: 58vw; height: 58vw; right: -16vw; bottom: -24vw;
    background: radial-gradient(circle, rgba(13,148,136,.34) 0%, rgba(13,148,136,0) 64%);
    animation: lgDrift2 32s ease-in-out infinite;
}
.lg-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; }
.lg-ring-1 { width: 1180px; height: 1180px; margin: -590px 0 0 -590px; border: 1px solid rgba(255,255,255,.055); }
.lg-ring-2 { width: 880px;  height: 880px;  margin: -440px 0 0 -440px; border: 1px solid rgba(255,255,255,.06); }
.lg-ring-3 { width: 600px;  height: 600px;  margin: -300px 0 0 -300px; border: 1px solid rgba(255,255,255,.05); }
.lg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(80% 70% at 50% 40%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000 20%, transparent 78%);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.lg-header {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px;
    padding: 30px 44px;
    animation: lgFade .7s ease both;
}
.lg-id { display: flex; align-items: center; gap: 14px; }
.lg-crest {
    width: 52px; height: 52px; flex: none;
    border-radius: 50%; background: #fff;
    display: grid; place-items: center; overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.lg-crest img { width: 52px; height: 52px; object-fit: cover; display: block; }
.lg-id-text { display: flex; flex-direction: column; gap: 3px; }
.lg-school { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.lg-est {
    font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: rgba(255,255,255,.62);
}
.lg-help {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.88);
    font-size: 13px; font-weight: 600;
    backdrop-filter: blur(6px);
    transition: background .18s ease, border-color .18s ease;
}
.lg-help:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.4);
    color: #fff; text-decoration: none;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.lg-main { position: relative; display: grid; place-items: center; padding: 12px 24px 28px; }
.lg-shell { width: 100%; max-width: 472px; animation: lgRise .62s cubic-bezier(.22,1,.36,1) both; }
.lg-card {
    background: #fff;
    border-radius: 26px;
    padding: 40px 40px 34px;
    box-shadow: 0 40px 90px -28px rgba(2,30,16,.65), 0 2px 6px rgba(2,30,16,.18);
    color: var(--lg-ink);
}

.lg-wordmark { width: 262px; max-width: 100%; display: block; margin: 0 0 26px; }
.lg-title { margin: 0 0 8px; font-size: 36px; line-height: 1.06; font-weight: 800; letter-spacing: -.032em; }
.lg-blurb { margin: 0 0 26px; font-size: 14.5px; line-height: 1.5; color: var(--lg-ink6); }

/* error */
.lg-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin: 0 0 18px;
    border-radius: 12px;
    background: var(--lg-err-bg);
    border: 1px solid var(--lg-err-line);
    color: var(--lg-err-ink);
    font-size: 13px; line-height: 1.45; font-weight: 500;
    animation: lgUp .28s ease both;
}
.lg-alert svg { flex: none; margin-top: 1px; }

/* form */
.lg-form { display: flex; flex-direction: column; gap: 16px; }
.lg-field { display: flex; flex-direction: column; gap: 7px; }
.lg-label {
    font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--lg-ink5);
}
.lg-control { position: relative; display: flex; align-items: center; }
.lg-control > .lg-ico { position: absolute; left: 14px; color: var(--lg-ink8); pointer-events: none; }
.lg-input {
    width: 100%;
    padding: 14px 14px 14px 43px;
    font: inherit; font-size: 15px; font-weight: 500;
    color: var(--lg-ink);
    background: var(--lg-field);
    border: 1.5px solid var(--lg-line);
    border-radius: 13px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.lg-input.has-eye { padding-right: 46px; }
.lg-input:focus {
    border-color: var(--lg-g600);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22,163,74,.16);
}
.lg-eye {
    position: absolute; right: 8px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border: 0; background: transparent; border-radius: 9px;
    color: var(--lg-ink7); cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.lg-eye:hover { background: var(--lg-line3); color: var(--lg-ink5); }

.lg-caps { display: none; font-size: 12px; font-weight: 500; color: #92610a; }
.lg-caps.on { display: block; }

.lg-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 2px 0 4px; }
.lg-row a { font-size: 13.5px; font-weight: 600; color: var(--lg-g700); }

.lg-submit {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    padding: 16px 20px;
    border: 0; border-radius: 14px;
    background: linear-gradient(135deg, var(--lg-g600) 0%, var(--lg-deep) 100%);
    color: #fff;
    font: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: -.005em;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px rgba(14,134,72,.85);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.lg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px -12px rgba(14,134,72,.95);
    filter: saturate(1.08);
}
.lg-submit:active { transform: translateY(1px); box-shadow: 0 8px 16px -8px rgba(14,134,72,.8); }
.lg-submit[disabled] { cursor: default; }
.lg-spin {
    display: none;
    width: 17px; height: 17px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: lgSpin .7s linear infinite;
}
.lg-submit.busy .lg-spin { display: block; }

/* secondary CTA (student register) */
.lg-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; }
.lg-divider span.rule { flex: 1; height: 1px; background: var(--lg-line2); }
.lg-divider span.cap {
    font-size: 11px; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--lg-ink9);
}
.lg-ghost {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 13px;
    border: 1.5px solid var(--lg-line);
    background: #fff;
    color: var(--lg-ink3);
    font-size: 14.5px; font-weight: 650;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.lg-ghost:hover {
    border-color: var(--lg-g600);
    background: var(--lg-wash);
    color: var(--lg-g700);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.lg-footer {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    padding: 24px 44px 30px;
    animation: lgFade .9s ease both;
}
.lg-motto {
    display: flex; align-items: center; gap: 14px;
    font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
    color: rgba(255,255,255,.9);
}
.lg-motto i { width: 4px; height: 4px; border-radius: 50%; background: var(--lg-mint); }
.lg-copy { font-size: 12px; color: rgba(255,255,255,.42); }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes lgRise  { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lgFade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lgUp    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lgSpin  { to { transform: rotate(360deg); } }
@keyframes lgDrift  { 0% { transform: translate3d(0,0,0) scale(1); }    50% { transform: translate3d(3%,-4%,0) scale(1.08); } 100% { transform: translate3d(0,0,0) scale(1); } }
@keyframes lgDrift2 { 0% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(-4%,3%,0) scale(1); }    100% { transform: translate3d(0,0,0) scale(1.05); } }

@media (prefers-reduced-motion: reduce) {
    .lg-shell, .lg-header, .lg-footer, .lg-alert, .lg-blob-a, .lg-blob-b { animation: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .lg-header { padding: 20px 20px 12px; gap: 14px; }
    .lg-school { font-size: 14px; }
    .lg-crest, .lg-crest img { width: 44px; height: 44px; }
    .lg-help { display: none; }
    .lg-main { padding: 8px 16px 22px; }
    .lg-card { padding: 30px 24px 26px; border-radius: 22px; }
    .lg-wordmark { width: 220px; margin-bottom: 22px; }
    .lg-title { font-size: 28px; }
    .lg-blurb { font-size: 14px; margin-bottom: 22px; }
    .lg-ring-1, .lg-ring-2, .lg-ring-3 { display: none; }
    .lg-footer { padding: 18px 20px 24px; justify-content: center; text-align: center; }
    .lg-motto { font-size: 12.5px; gap: 10px; }
}
