/* ===== Tokens ===== */
:root {
  --green-900: #0B3B29;
  --green-700: #0F5C3E;
  --maroon-700: #7A2E2E;
  --gold-500: #C9A75C;
  --paper: #F7F5EF;
  --paper-white: #FFFFFF;
  --ink-900: #1B211D;
  --ink-600: #57605A;
  --ink-400: #8A928C;
  --line: #E4E0D5;
  --error: #B3261E;

  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 8px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over a component's own
   display:flex/grid rule — otherwise elements like the upload spinner
   can appear "stuck visible" even when JS correctly sets hidden=true. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper);
}

button { font-family: inherit; }

/* ===== University site nav (WordPress main-site bridge) ===== */
.logo-img {
  object-fit: contain;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: var(--paper-white);
  border-bottom: 1px solid var(--line);
}

.site-nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.site-nav__menu {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.site-nav__menu a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-600);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav__menu a:hover { color: var(--green-700); }

.site-nav__menu a.site-nav__active {
  color: var(--green-700);
  border-bottom-color: var(--gold-500);
}

@media (max-width: 700px) {
  .site-nav__menu { display: none; }
}

/* ===== Layout ===== */
.login-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
}

@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }
}

/* ===== Brand panel ===== */
.brand {
  position: relative;
  background: var(--green-900);
  color: var(--paper);
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  overflow-y: auto;
}

/* Ledger-line texture: nods to a pay-advice document */
.brand__ledger {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(244, 239, 227, 0.05) 0px,
    rgba(244, 239, 227, 0.05) 1px,
    transparent 1px,
    transparent 40px
  );
  pointer-events: none;
}

.brand__content {
  position: relative;
  max-width: 440px;
}

.brand__crest { margin-bottom: 4px; }

.brand__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin: 0 0 10px;
}

.brand__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.brand__desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(247, 245, 239, 0.78);
  margin: 0;
  max-width: 380px;
}

.brand__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand__points li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
  color: rgba(247, 245, 239, 0.9);
  padding-top: 10px;
  border-top: 1px solid rgba(244, 239, 227, 0.14);
}

.brand__points li:first-child { border-top: none; padding-top: 0; }

.brand__points span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-500);
  min-width: 20px;
}

.brand__footer {
  position: relative;
  font-size: 12px;
  color: rgba(247, 245, 239, 0.55);
  margin: 0;
}

/* ===== Form panel ===== */
.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper-white);
  overflow-y: auto;
}

.panel__inner {
  width: 100%;
  max-width: 380px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-600);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.is-active {
  background: var(--paper-white);
  color: var(--green-900);
  box-shadow: 0 1px 2px rgba(11, 59, 41, 0.08);
}

.tab:focus-visible,
.btn-primary:focus-visible,
.field input:focus-visible,
.field__toggle:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 2px;
}

/* Forms */
.form { display: none; flex-direction: column; }
.form.is-active { display: flex; }

.form__title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink-900);
}

.form__sub {
  font-size: 13.5px;
  color: var(--ink-600);
  margin: 0 0 20px;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-600);
}

.field input {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-white);
  color: var(--ink-900);
  width: 100%;
  transition: border-color 0.15s ease;
}

.field input::placeholder { color: var(--ink-400); font-family: var(--font-body); }

.field input:focus {
  border-color: var(--green-700);
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__control input { padding-right: 60px; }

.field__toggle {
  position: absolute;
  right: 10px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
  cursor: pointer;
  padding: 4px 6px;
}

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 13px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-600);
  cursor: pointer;
}

.checkbox input { accent-color: var(--green-700); }

.link-muted {
  color: var(--ink-600);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.link-muted:hover { color: var(--green-700); border-color: var(--green-700); }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--green-700);
  color: var(--paper-white);
  border: none;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: var(--green-900); }

.form__note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-400);
  margin: 12px 0 0;
}

.form__error {
  background: #FBEAE9;
  color: var(--error);
  border: 1px solid #F3C6C3;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin: -4px 0 18px;
}

.form__success {
  background: #E9F3EC;
  color: var(--green-900);
  border: 1px solid #BFDBC9;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin: -4px 0 18px;
  line-height: 1.5;
}

/* ===== Change password (shared: staff dashboard header + admin panel view) ===== */
.change-password-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 32px;
}

.change-password-card__inner {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 16px;
}

.change-password-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}

.change-password-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.change-password-card__actions .btn-secondary { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
