/* ============================================================================
   University Academic Platform — "God-mode" login portal
   White & blue, glassmorphism, navy interactive hero. Self-contained (no CDN).
   ========================================================================== */
:root {
  --bg: #f1f5f9;
  --mesh1: rgba(212,175,55,0.14);
  --mesh2: rgba(16,42,67,0.10);
  --card-bg: rgba(255,255,255,0.72);
  --card-border: rgba(255,255,255,0.75);
  --text: #0f172a;
  --sub: #64748b;
  --faint: #94a3b8;
  --input-bg: #ffffff;
  --input-border: #e2e8f0;
  --tabs-bg: #eef2f7;
  --divider: #e2e8f0;
  --ghost-bg: #ffffff;
  --ghost-border: #e2e8f0;
  --ghost-text: #334155;
  --primary: #16324F;
  --primary-d: #0B192C;
  --track: #e2e8f0;
  --shadow: 0 20px 45px -20px rgba(15,23,42,0.25);
}
html[data-theme="dark"] {
  --bg: #020617;
  --mesh1: rgba(22,50,79,0.16);
  --mesh2: rgba(30,58,138,0.22);
  --card-bg: rgba(15,23,42,0.72);
  --card-border: rgba(51,65,85,0.6);
  --text: #f8fafc;
  --sub: #94a3b8;
  --faint: #64748b;
  --input-bg: rgba(30,41,59,0.6);
  --input-border: #334155;
  --tabs-bg: rgba(30,41,59,0.7);
  --divider: #334155;
  --ghost-bg: rgba(30,41,59,0.55);
  --ghost-border: #334155;
  --ghost-text: #e2e8f0;
  --track: #334155;
  --shadow: 0 24px 50px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .5s ease, color .5s ease;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }

/* ---------------- Layout shell ---------------- */
.portal {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

/* Theme toggle */
.theme-toggle {
  position: absolute; top: 16px; right: 16px; z-index: 40;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--ghost-bg); border: 1px solid var(--ghost-border);
  color: var(--primary); box-shadow: var(--shadow);
  transition: transform .3s ease, background .3s ease;
}
.theme-toggle:hover { transform: scale(1.06); }
html[data-theme="dark"] .theme-toggle { color: #fbbf24; }

/* ---------------- LEFT: login ---------------- */
.left {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  overflow: hidden;
}
.left::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px circle at 15% 5%, var(--mesh1), transparent 45%),
    radial-gradient(500px circle at 95% 95%, var(--mesh2), transparent 45%);
}
.left-inner { position: relative; z-index: 2; width: 100%; max-width: 440px; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand .logo {
  width: 48px; height: 48px; border-radius: 15px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 1.3rem;
  background: linear-gradient(135deg, #16324F, #1e40af);
  box-shadow: 0 12px 24px -8px rgba(22,50,79,0.5);
}
.brand .b-name { font-weight: 700; font-size: 1.1rem; line-height: 1; }
.brand .b-sub { color: var(--sub); font-size: .78rem; margin-top: 3px; }

.card {
  border-radius: 26px; padding: 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.card h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
.card .lead { color: var(--sub); font-size: .9rem; margin: 0 0 22px; }

/* Flash / inline error */
.alert {
  border-radius: 12px; padding: 10px 14px; font-size: .85rem; margin-bottom: 14px;
  background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.25);
}
.alert.hidden { display: none; }

/* Segmented tabs */
.tabs {
  position: relative; display: grid; grid-template-columns: repeat(3,1fr);
  background: var(--tabs-bg); border-radius: 16px; padding: 5px; margin-bottom: 22px;
}
.tabs .slider {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px)/3);
  border-radius: 12px;
  background: linear-gradient(135deg, #16324F, #D4AF37);
  box-shadow: 0 8px 18px -6px rgba(22,50,79,0.6);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.tabs button {
  position: relative; z-index: 2; border: 0; background: transparent; cursor: pointer;
  padding: 10px 4px; font-size: .85rem; font-weight: 600; color: var(--sub);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: color .3s ease;
}
.tabs button.active { color: #fff; }
.tab-hint { font-size: .8rem; color: var(--faint); margin: -12px 0 16px; padding-left: 2px; }

/* Fields with floating labels */
.field { position: relative; margin-bottom: 16px; }
.field > i.lead-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: .95rem; transition: color .2s ease; pointer-events: none;
}
.field input {
  width: 100%; height: 56px; border-radius: 16px;
  border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text);
  padding: 18px 44px 4px 44px; font-size: .92rem; font-weight: 500;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder { color: transparent; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(22,50,79,0.15); }
.field input:focus ~ i.lead-icon { color: var(--primary); }
.field label {
  position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: .92rem; pointer-events: none;
  transition: all .18s ease; transform-origin: left;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
  top: 12px; transform: translateY(0); font-size: .68rem; font-weight: 700; color: var(--primary);
}
.field .right-slot {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px;
}
.field .toggle-pw { background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 1rem; padding: 4px; }
.field .toggle-pw:hover { color: var(--primary); }
.valid-check {
  width: 24px; height: 24px; border-radius: 50%; background: #10b981; color: #fff;
  display: grid; place-items: center; font-size: .7rem;
  transform: scale(0); opacity: 0; transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.valid-check.show { transform: scale(1); opacity: 1; }
.hint { font-size: .75rem; color: var(--faint); margin: -10px 0 14px; padding-left: 4px; }
.hint b { color: var(--primary); }

/* Password strength */
.strength { display: flex; align-items: center; gap: 8px; margin: -8px 0 16px; padding: 0 4px; }
.strength .bars { display: flex; gap: 6px; flex: 1; }
.strength .bars span { height: 6px; flex: 1; border-radius: 99px; background: var(--track); transition: background .3s ease; }
.strength .label { width: 58px; text-align: right; font-size: .72rem; font-weight: 700; }

/* Row */
.row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-size: .85rem; color: var(--sub);
}
.check .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--input-border);
  display: grid; place-items: center; color: #fff; font-size: .65rem; transition: all .2s ease;
}
.check.on .box { background: var(--primary); border-color: var(--primary); }
.check .box i { transform: scale(0); transition: transform .2s ease; }
.check.on .box i { transform: scale(1); }
.link-btn { background: none; border: 0; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--primary); }

/* Primary button */
.btn-primary {
  position: relative; width: 100%; height: 52px; border: 0; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: .95rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #16324F, #0B192C);
  box-shadow: 0 14px 28px -10px rgba(22,50,79,0.6);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 18px 34px -10px rgba(22,50,79,0.7); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { cursor: default; filter: saturate(.8); }
.btn-primary i.arr { transition: transform .3s ease; }
.btn-primary:hover i.arr { transform: translateX(4px); }

/* SSO */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: .75rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--divider); }
.sso { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sso button {
  height: 44px; border-radius: 12px; cursor: pointer; font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ghost-bg); border: 1px solid var(--ghost-border); color: var(--ghost-text);
  transition: transform .2s ease;
}
.sso button:hover { transform: scale(1.02); }
.sso button i { color: var(--primary); }

.demo {
  margin-top: 18px; padding: 12px 14px; border-radius: 14px;
  background: rgba(22,50,79,0.06); border: 1px solid rgba(22,50,79,0.12); font-size: .78rem; color: var(--sub);
}
.demo b { color: var(--text); }
.demo code { color: var(--primary); font-weight: 700; }
.foot { text-align: center; font-size: .72rem; color: var(--faint); margin-top: 22px; }

/* Guest entry */
.guest-note {
  display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--sub);
  background: rgba(22,50,79,0.06); border: 1px solid rgba(22,50,79,0.12);
  border-radius: 14px; padding: 14px; margin-bottom: 16px; line-height: 1.5;
}
.guest-note i { color: var(--primary); margin-top: 2px; }

/* Success panel */
.success { display: none; flex-direction: column; align-items: center; text-align: center; padding: 26px 0; }
.success.show { display: flex; }
.success .ring { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 22px; }
.success .ring .halo { position: absolute; inset: 0; border-radius: 50%; background: rgba(16,185,129,0.15); animation: lp-pulse 1.6s ease-out infinite; }
.success .ring .core {
  position: relative; width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669); display: grid; place-items: center;
  box-shadow: 0 14px 28px -8px rgba(16,185,129,0.5); animation: lp-pop .5s cubic-bezier(.34,1.56,.64,1);
}
.success .ring .core svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: lp-check .5s .25s ease forwards; }
.success h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.success p { color: var(--sub); font-size: .9rem; margin: 4px 0 0; }
.success .redir { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: .88rem; margin-top: 20px; }
.success .prog { width: 200px; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 14px; }
.success .prog span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #16324F, #10b981); animation: lp-prog 2.4s ease-out forwards; }

/* ---------------- RIGHT: hero ---------------- */
.right { position: relative; overflow: hidden; }
.right .bg { position: absolute; inset: 0; background: linear-gradient(135deg, #0f172a, #1e3a8a 55%, #0f172a); }
.right .mesh {
  position: absolute; inset: 0; opacity: .85;
  background:
    radial-gradient(700px circle at 80% 15%, rgba(22,50,79,0.38), transparent 45%),
    radial-gradient(600px circle at 15% 85%, rgba(56,189,248,0.22), transparent 45%);
}
.right .grid-tex {
  position: absolute; inset: 0; opacity: .06;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg,#fff 1px, transparent 1px);
  background-size: 44px 44px;
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); }
.blob.a { width: 300px; height: 300px; right: -80px; top: 40px; background: rgba(59,130,246,0.22); animation: lp-drift 14s ease-in-out infinite; }
.blob.b { width: 260px; height: 260px; left: -60px; bottom: 60px; background: rgba(56,189,248,0.16); animation: lp-drift 18s ease-in-out infinite reverse; }

.hero { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; color: #fff; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 600; color: #dbeafe;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.1); border-radius: 99px; padding: 6px 13px;
  backdrop-filter: blur(6px); width: fit-content;
}
.hero h2 { font-size: 2.6rem; font-weight: 800; line-height: 1.12; margin: 20px 0 0; max-width: 440px; letter-spacing: -.02em; }
.hero h2 .grad { background: linear-gradient(90deg,#7dd3fc,#60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tagline { color: rgba(219,234,254,0.7); font-size: .92rem; margin-top: 16px; max-width: 360px; line-height: 1.6; }

.glass {
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.1);
  border-radius: 18px; backdrop-filter: blur(16px); box-shadow: 0 20px 40px -18px rgba(2,6,23,0.5);
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 16px; }
.stat.float { animation: lp-float 6s ease-in-out infinite; }
.stat.float.delay { animation-delay: 1.5s; }
.stat .head { display: flex; align-items: center; gap: 8px; color: #dbeafe; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.stat .title { font-weight: 700; font-size: .9rem; }
.count { display: flex; gap: 6px; margin-top: 12px; }
.count .u { flex: 1; text-align: center; background: rgba(2,6,23,0.4); border-radius: 9px; padding: 6px 0; }
.count .u b { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 1.05rem; font-weight: 700; display: block; }
.count .u small { font-size: .55rem; color: rgba(191,219,254,0.6); }

.lib { display: flex; align-items: center; gap: 12px; }
.lib .ringwrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.lib .ringwrap span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; font-weight: 700; }
.lib .status { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .9rem; }
.lib .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: lp-pulse2 1.6s ease infinite; }
.lib .cap { display: flex; align-items: center; gap: 5px; font-size: .68rem; color: rgba(191,219,254,0.6); margin-top: 3px; }

/* News carousel */
.news { padding: 20px; }
.news .win { overflow: hidden; }
.news .track { display: flex; transition: transform .5s ease; }
.news .slide { min-width: 100%; padding-right: 4px; }
.news .tag { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700; color: #bfdbfe; background: rgba(22,50,79,0.25); border-radius: 99px; padding: 3px 10px; margin-bottom: 8px; }
.news .slide p { font-weight: 600; font-size: .92rem; line-height: 1.35; margin: 0; }
.news .slide small { color: rgba(191,219,254,0.5); font-size: .72rem; }
.news .controls { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.dots { display: flex; gap: 6px; }
.dots button { height: 6px; width: 6px; border: 0; border-radius: 99px; background: rgba(255,255,255,0.3); cursor: pointer; transition: all .3s ease; padding: 0; }
.dots button.on { width: 24px; background: #60a5fa; }
.arrows { display: flex; gap: 8px; }
.arrows button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: #fff; cursor: pointer; }
.arrows button:hover { background: rgba(255,255,255,0.15); }

/* Forgot modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.5); backdrop-filter: blur(4px); }
.modal .dialog {
  position: relative; width: 100%; max-width: 380px; border-radius: 24px; padding: 28px;
  background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow);
  backdrop-filter: blur(18px); transform: translateY(16px) scale(.96); transition: transform .3s ease;
}
.modal.open .dialog { transform: translateY(0) scale(1); }
.modal .x { position: absolute; right: 14px; top: 14px; border: 0; background: none; cursor: pointer; color: var(--faint); font-size: 1.1rem; padding: 6px; border-radius: 8px; }
.modal .m-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(22,50,79,0.1); color: var(--primary); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 16px; }
.modal h3 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.modal p { color: var(--sub); font-size: .85rem; margin: 4px 0 0; }
.modal .m-ok { display: none; flex-direction: column; align-items: center; text-align: center; }
.modal .m-ok.show { display: flex; }
.modal .m-ok .ic { width: 56px; height: 56px; border-radius: 16px; background: rgba(16,185,129,0.15); color: #10b981; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 14px; }

/* Animations */
@keyframes lp-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes lp-drift { 0%{transform:translate(0,0)} 50%{transform:translate(24px,-24px)} 100%{transform:translate(0,0)} }
@keyframes lp-pulse { 0%{transform:scale(1);opacity:.6} 100%{transform:scale(1.5);opacity:0} }
@keyframes lp-pulse2 { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes lp-pop { 0%{transform:scale(.4);opacity:0} 100%{transform:scale(1);opacity:1} }
@keyframes lp-check { to { stroke-dashoffset: 0; } }
@keyframes lp-prog { 0%{width:0} 100%{width:100%} }
@keyframes lp-shake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }
.shake { animation: lp-shake .45s ease; }

/* Responsive */
@media (max-width: 991px) {
  .portal { grid-template-columns: 1fr; }
  .right { display: none; }
  .left { padding: 28px 18px; }
}


/* ---------- AIU brand ---------- */
body { font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; letter-spacing: -0.01em; }
