/* ============================================================
   Admission Portal — Design System
   Palette: ink navy + brass gold (registrar's ledger feel)
   Type: Fraunces (display/serif) + Inter (body/UI) + IBM Plex Mono (data/IDs)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink:        #0A1F47;   /* sidebar / deepest surface — matches logo navy */
  --ink-2:      #122A5C;   /* sidebar hover */
  --navy:       #0F3A78;   /* primary brand blue */
  --navy-light: #2E5FA6;
  --gold:       #C79A42;   /* brass accent — matches logo gold */
  --gold-light: #E8C568;
  --canvas:     #F5F6FA;   /* page background */
  --surface:    #FFFFFF;
  --border:     #E7E9F1;
  --ink-text:   #1C2333;
  --muted:      #6B7280;
  --success:    #1F8A5F;
  --warning:    #B8791F;
  --danger:     #C2483E;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  background: var(--canvas);
  font-family: var(--font-body);
  color: var(--ink-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

a { color: var(--navy-light); }

.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }

/* ---------- App shell ---------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 264px;
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform .28s ease;
  z-index: 1040;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand {
  padding: 24px 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 9px;
  padding: 4px;
}

.sidebar-brand .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #fff;
}

.sidebar-brand .subtitle {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--gold-light);
  display: block;
}

.sidebar-section-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 18px 22px 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0 16px;
}

.sidebar-nav a {
  color: rgba(255,255,255,.72);
  padding: 11px 22px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .89rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-nav a i { width: 18px; text-align: center; font-size: .92rem; }

.sidebar-nav a:hover {
  background: var(--ink-2);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--ink-2);
  color: #fff;
  border-left-color: var(--gold);
}

.sidebar-nav a.logout-link {
  color: #E39C93;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
}

.nav-group-toggle {
  color: rgba(255,255,255,.72);
  padding: 11px 22px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .89rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-group-toggle span { display: flex; align-items: center; gap: 12px; }
.nav-group-toggle span i:first-child { width: 18px; text-align: center; font-size: .92rem; }

.nav-group-toggle:hover { background: var(--ink-2); color: #fff; }

.nav-group-toggle .chevron {
  font-size: .72rem;
  transition: transform .2s ease;
}

.nav-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.nav-sub-link {
  display: block;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  padding: 9px 22px 9px 52px;
  font-size: .84rem;
  border-left: 3px solid transparent;
}

.nav-sub-link:hover {
  background: var(--ink-2);
  color: #fff;
}

.nav-sub-link.active {
  background: var(--ink-2);
  color: #fff;
  border-left-color: var(--gold);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,24,48,.5);
  z-index: 1030;
}

/* ---------- Main content ---------- */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 264px;
  transition: margin .28s ease;
}

.topbar {
  background: var(--surface);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--canvas);
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  font-size: .87rem;
}

.topbar-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .82rem;
}

.topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .82rem;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-content {
  padding: 28px;
  max-width: 1400px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.page-header .eyebrow {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 2px;
  display: block;
}

.page-header h4 { margin: 0; font-size: 1.5rem; }

/* ---------- Cards ---------- */
.stat-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  position: relative;
}

.stat-card .stat-label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.stat-card .stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--border);
  font-size: 1.3rem;
}

.card, .table-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
  display: inline-block;
}

/* ---------- Ledger-style table ---------- */
.table-ledger {
  --bs-table-bg: transparent;
}

.table-ledger thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border) !important;
  background: transparent;
  padding-bottom: 10px;
}

.table-ledger td {
  font-size: .87rem;
  border-color: var(--border);
  vertical-align: middle;
}

.table-ledger .reg-no {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--navy);
  font-weight: 600;
}

.table-ledger tbody tr:hover { background: #FAFAFD; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; font-size: .74rem; padding: .4em .7em; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: #A17F29; border-color: #A17F29; color: #fff; }

/* ---------- Seat capacity bar ---------- */
.seat-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  margin-top: 6px;
}
.seat-bar-fill { height: 100%; background: var(--navy-light); }
.seat-bar-fill.full { background: var(--danger); }
.seat-bar-fill.near { background: var(--warning); }

/* ---------- Activity feed ---------- */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: .78rem;
  flex-shrink: 0;
}

.activity-item .desc { font-size: .85rem; }
.activity-item .time { font-size: .74rem; color: var(--muted); }

/* ---------- Wizard (multi-step form) ---------- */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 34px;
  list-style: none;
  padding: 0;
  position: relative;
}

.wizard-steps li {
  flex: 1;
  text-align: center;
  position: relative;
  font-size: .78rem;
  color: #9aa4b2;
  font-weight: 500;
}

.wizard-steps li .circle {
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--border);
  color: var(--muted);
  margin: 0 auto 8px;
  font-weight: 600;
  font-family: var(--font-display);
}

.wizard-steps li.active .circle {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.wizard-steps li.done .circle {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.wizard-steps li.active { color: var(--navy); font-weight: 600; }
.wizard-steps li.done { color: var(--gold); }

/* ---------- University picker cards ---------- */
.uni-pick-card {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.uni-pick-card:hover {
  border-color: var(--navy-light);
  box-shadow: 0 6px 20px rgba(22,48,92,.08);
  transform: translateY(-2px);
}

.uni-pick-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 12px;
}

.uni-pick-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.8rem;
}

.uni-pick-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-text);
  line-height: 1.3;
}

.uni-pick-meta {
  font-size: .76rem;
  color: var(--muted);
}

.uni-pick-current {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .68rem;
}

/* ============================================================
   Login page — sliding toggle-panel presentation
   A colored overlay panel (illustration + welcome copy) covers
   the whole screen by default; clicking "Sign In" slides it
   aside to reveal the real sign-in form underneath.
   ============================================================ */
.login-page { background: var(--surface); overflow: hidden; }

.login-shell {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ---- Form panel (revealed once the overlay slides aside) ---- */
.auth-form-panel {
  flex: 0 0 0%;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  transition: flex-basis .65s cubic-bezier(.65,0,.35,1), opacity .4s ease .18s;
}
.login-shell.is-open .auth-form-panel { flex-basis: 56%; opacity: 1; }

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 24px;
}

.login-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1.5rem;
  margin: 0 auto 16px;
  box-shadow: 0 10px 22px rgba(199,154,66,.35);
}

.login-card h4 { font-size: 1.4rem; margin-bottom: 2px; }

.login-card .eyebrow-gold {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 600;
}

.login-field { margin-bottom: 18px; }

.login-field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-group i {
  position: absolute;
  left: 15px;
  color: var(--gold);
  font-size: .85rem;
  pointer-events: none;
}

.login-input-group input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .92rem;
  color: var(--ink-text);
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-input-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199,154,66,.15);
}

.login-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--navy-light), var(--navy) 70%);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .02em;
  margin-top: 6px;
  transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 12px 24px rgba(15,58,120,.25);
}
.login-submit:hover { background: linear-gradient(155deg, var(--navy-light), var(--ink) 70%); transform: translateY(-1px); box-shadow: 0 16px 30px rgba(15,58,120,.32); }
.login-submit:active { transform: translateY(0); }

.login-foot {
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

/* ---- Overlay panel: colored, illustrated, slides to reveal the form ---- */
.auth-overlay {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  overflow: hidden;
  transition: flex-basis .65s cubic-bezier(.65,0,.35,1);
}
.login-shell.is-open .auth-overlay { flex-basis: 44%; }

.auth-overlay-shape {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(232,197,104,.22), transparent 42%),
    radial-gradient(circle at 15% 92%, rgba(46,95,166,.5), transparent 48%),
    linear-gradient(150deg, #0A1F47 0%, #0F3A78 78%, #133F82 100%);
  /* flush by default — the panel spans the full screen, so its left edge
     sits on the screen boundary and has nothing to curve against yet */
  clip-path: url(#authEdgeFlush);
}
.login-shell.is-open .auth-overlay-shape {
  /* once shrunk aside, the edge meets the form panel — curve it here */
  clip-path: url(#authEdgeWave);
  filter: drop-shadow(-18px 0 42px rgba(6,20,48,.4));
}

/* film-grain texture for a tactile, non-flat surface */
.auth-overlay-shape::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: overlay;
  pointer-events: none;
  clip-path: url(#authEdgeFlush);
}
.login-shell.is-open .auth-overlay-shape::before { clip-path: url(#authEdgeWave); }

.auth-overlay-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 40px 48px;
  color: #fff;
}

.auth-brand {
  position: absolute;
  top: 40px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand img { width: 32px; height: auto; }
.auth-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
}
.auth-brand-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 500;
  margin-top: 2px;
}

/* illustration + copy centered together as one cohesive group */
.auth-overlay-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-illustration {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .65s cubic-bezier(.65,0,.35,1), opacity .5s ease, margin .5s ease;
  margin-bottom: 8px;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.28));
}
.auth-illustration svg { width: 100%; height: 100%; max-height: 300px; }
.login-shell.is-open .auth-illustration { transform: scale(.6); margin-bottom: -6px; opacity: .95; }

.auth-overlay-text { flex: 0 0 auto; text-align: center; }

.auth-headline {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 10px;
}

.auth-sub {
  font-size: .88rem;
  line-height: 1.55;
  color: rgba(255,255,255,.7);
  max-width: 320px;
  margin: 0 auto 22px;
}

.auth-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 30px;
  border: 1.5px solid rgba(232,197,104,.6);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .15s;
}
.auth-toggle-btn:hover { background: rgba(232,197,104,.14); border-color: var(--gold-light); transform: translateY(-1px); }

.auth-state-open { display: none; }
.login-shell.is-open .auth-state-closed { display: none; }
.login-shell.is-open .auth-state-open { display: block; }
.login-shell.is-open .auth-headline { font-size: 1.5rem; }
.login-shell.is-open .auth-sub { margin-bottom: 14px; }

.auth-back-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  padding: 4px 0;
}
.auth-back-btn:hover { color: #fff; }

@media (max-width: 991.98px) {
  .login-shell { flex-direction: column; height: auto; min-height: 100vh; }
  .auth-form-panel,
  .login-shell.is-open .auth-form-panel { flex: 1 1 auto; opacity: 1; padding: 32px 20px 44px; order: 2; }
  .auth-overlay,
  .login-shell.is-open .auth-overlay { flex: 0 0 auto; order: 1; }
  .auth-overlay-shape,
  .auth-overlay-shape::before,
  .login-shell.is-open .auth-overlay-shape,
  .login-shell.is-open .auth-overlay-shape::before { clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); }
  .auth-overlay-shape,
  .login-shell.is-open .auth-overlay-shape { filter: none; }
  .auth-overlay-inner { padding: 26px 24px 34px; }
  .auth-brand { top: 26px; left: 24px; }
  .auth-overlay-content { height: auto; gap: 2px; padding-top: 30px; }
  .auth-illustration,
  .login-shell.is-open .auth-illustration { max-height: 150px; transform: none; opacity: 1; margin-bottom: 4px; filter: none; }
  .auth-illustration svg { max-height: 150px; }
  .auth-sub { display: none; }
  .auth-toggle-btn,
  .auth-back-btn { display: none; }
  .auth-headline,
  .login-shell.is-open .auth-headline { font-size: 1.3rem; margin-bottom: 4px; }
  .auth-state-open { display: none !important; }
  .auth-state-closed { display: block !important; }
  .login-card { padding: 0; max-width: 420px; }
}

@media (max-width: 575.98px) {
  .auth-overlay-inner { padding: 20px 20px 28px; }
  .auth-illustration { max-height: 110px; }
  .auth-illustration svg { max-height: 110px; }
}

/* ---------- Print (admission slip) ---------- */
@media print {
  .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; }
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* Tablet: collapse sidebar to a drawer */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.2); }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .topbar-search { max-width: 220px; }
}

/* Mobile */
@media (max-width: 575.98px) {
  .page-content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .topbar-search { display: none; }
  .stat-card .stat-value { font-size: 1.6rem; }
  .wizard-steps li { font-size: 0; }
  .wizard-steps li.active { font-size: .72rem; }
  .wizard-steps li .circle { width: 28px; height: 28px; line-height: 28px; font-size: .8rem; }
  .page-header h4 { font-size: 1.25rem; }
}
