/*
 * theme.css — visual layer added by patch ui_modernization_2026-11d (version 1.0.0-alpha.5)
 *
 * Loaded AFTER app.css. It only restyles; it never changes behaviour or markup semantics.
 * To switch the new look off completely, delete the <link ... theme.css> line in templates/base.html.
 *
 * Palette is taken from the University of Kurdistan seal:
 *   crimson #d62652   ·   blue #30539f
 */

/* ---------- Fonts (self-hosted, so the page looks the same without internet access) ---------- */
@font-face {
  font-family: "Vazirmatn Local";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn Local";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #f4f6fb;
  --bg-accent: #e9eef8;
  --surface: #ffffff;
  --ink: #161c2d;
  --muted: #566077;
  --line: #dce3ef;
  --brand: #30539f;
  --brand-2: #3d65bd;
  --brand-dark: #1d366f;
  --brand-soft: #e7edf9;
  --accent: #d62652;
  --accent-soft: #fdecef;
  --shadow: 0 1px 2px rgba(22, 28, 45, 0.05), 0 10px 28px rgba(22, 28, 45, 0.07);
  --shadow-hover: 0 2px 4px rgba(22, 28, 45, 0.06), 0 16px 36px rgba(48, 83, 159, 0.16);
  --radius: 14px;
  --font: "Vazirmatn Local", "Vazirmatn", "Tahoma", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  line-height: 1.75;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(48, 83, 159, 0.10), transparent 70%),
    radial-gradient(700px 360px at 100% 0%, rgba(214, 38, 82, 0.07), transparent 70%),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 45%, #eef2f9 100%);
}
.shell { max-width: 1200px; }
a { transition: color .15s ease; }
h1, h2, h3 { line-height: 1.4; }

/* ---------- Top bar ---------- */
.topbar {
  border-radius: 20px;
  padding: 0.6rem 1rem 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.92);
}
.brand { gap: 0.8rem; color: var(--brand-dark); }
.brand:hover { color: var(--brand); }
.brand-logo {
  width: 46px; height: 46px; flex: 0 0 auto; display: block;
  filter: drop-shadow(0 2px 4px rgba(22, 28, 45, 0.18));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-title { font-weight: 800; font-size: 1.02rem; }
.brand-sub { font-weight: 500; font-size: 0.76rem; color: var(--muted); }
.alpha-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-inline-start: 0.2rem;
  padding: 0.1rem 0.55rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(214, 38, 82, 0.25);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.alpha-pill::before {
  content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--accent);
}
.chip { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { border-radius: 11px; box-shadow: 0 1px 2px rgba(29, 54, 111, 0.22); }
.btn.secondary { box-shadow: none; border-color: var(--line); }
.btn.secondary:hover { background: var(--brand-soft); border-color: #c5d2ec; }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand-dark); transform: none; }
.btn.danger, .btn.danger:hover { box-shadow: 0 1px 2px rgba(161, 40, 40, 0.3); }
.btn.danger:hover { filter: brightness(0.94); }

/* ---------- Landing hero ---------- */
.hero {
  min-height: 54vh;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 2rem;
  background:
    radial-gradient(520px 320px at 12% 110%, rgba(214, 38, 82, 0.55), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23ffffff12' d='M0 80h160v2H0zM80 0v160h2V0z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #1b3270 0%, #30539f 62%, #4a6fc2 100%);
  padding: 2.5rem 2.75rem;
}
.hero h1 { max-width: 22ch; text-wrap: balance; }
.hero-logo {
  width: clamp(120px, 17vw, 190px); height: auto; aspect-ratio: 1; display: block;
  padding: 0.55rem; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18), 0 18px 40px rgba(8, 16, 40, 0.35);
}
.hero .btn:hover { background: #fff; color: var(--brand-dark); box-shadow: 0 6px 18px rgba(8, 16, 40, 0.28); }
.hero .btn.secondary:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 1.6rem; min-height: 0; }
  .hero-logo { order: -1; width: 96px; }
}

/* ---------- Panels, cards, dashboard tiles ---------- */
.panel, .card { border-radius: var(--radius); border-color: var(--line); }
.panel h2, .panel h3 { color: var(--brand-dark); }
a.panel { color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.panel h3 { color: var(--brand); }
a.panel:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #bccaea; color: inherit; }
a.panel:focus-visible { outline-offset: 3px; }
.grid > .panel, .grid > a.panel { margin-bottom: 0; }  /* the grid gap already spaces the tiles */

/* ---------- Forms ---------- */
/* :not() matches app.css specificity so text fields keep theme radius/border (radios/checkboxes excluded). */
input:not([type=radio]):not([type=checkbox]), select, textarea { border-radius: 10px; border-color: #cfd8e8; transition: border-color .15s ease, box-shadow .15s ease; }
input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------- Tabs / steps ---------- */
.tabs { background: var(--bg-accent); padding: 0.3rem; border-radius: 14px; }
.tab { background: transparent; border-radius: 11px; transition: background .15s ease, color .15s ease; }
.tab:hover { color: var(--brand-dark); }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(22, 28, 45, 0.12); }
.steps a.active { background: var(--brand); }

/* ---------- Tables ---------- */
.table th { background: #f5f8fd; color: var(--muted); border-bottom: 2px solid var(--line); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #f9fbfe; }

/* ---------- Login / auth heading ---------- */
.auth-head { text-align: center; margin-bottom: 1.25rem; }
.auth-head h2 { margin: 0.6rem 0 0.15rem; }
.auth-head p { margin: 0; font-size: 0.88rem; }
.auth-logo { width: 72px; height: 72px; display: inline-block; filter: drop-shadow(0 3px 6px rgba(22, 28, 45, 0.2)); }

/* ---------- Footer ---------- */
.footer-note { display: none; }  /* the old one-line footer; replaced by .site-footer */
.site-footer {
  margin: 2.25rem 0 0.75rem;
  border-radius: 22px; overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(135deg, #172b5e 0%, #1f3a7a 60%, #26448f 100%);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow);
  font-size: 0.9rem; line-height: 1.9;
}
.site-footer a { color: #fff; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.1fr 1.7fr 1fr; gap: 1.75rem;
  padding: 1.75rem 2rem 1.4rem;
}
.site-footer__org { display: flex; align-items: center; gap: 0.9rem; }
.site-footer__logo {
  width: 64px; height: 64px; flex: 0 0 auto; padding: 4px; border-radius: 50%; background: #fff;
}
.site-footer__org strong { display: block; color: #fff; font-size: 1rem; }
.site-footer__org span { display: block; font-size: 0.82rem; opacity: 0.85; }
.site-footer h2 { margin: 0 0 0.35rem; font-size: 0.98rem; color: #fff; }
.site-footer p { margin: 0 0 0.6rem; }
.site-footer__mail {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 600; direction: ltr; unicode-bidi: isolate;
  transition: background .15s ease;
}
.site-footer__mail:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.site-footer__dev dt { font-size: 0.78rem; opacity: 0.75; margin: 0; }
.site-footer__dev dd { margin: 0 0 0.55rem; font-weight: 700; color: #fff; }
.site-footer__ver {
  display: inline-flex; align-items: center; gap: 0.4rem; direction: ltr; unicode-bidi: isolate;
  padding: 0.1rem 0.6rem; border-radius: 8px;
  background: rgba(214, 38, 82, 0.22); border: 1px solid rgba(255, 138, 163, 0.5);
  font-family: Consolas, "Courier New", monospace; font-size: 0.82rem; font-weight: 700; color: #fff;
}
.site-footer__bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding: 0.7rem 2rem; background: rgba(8, 16, 40, 0.28);
  font-size: 0.8rem; color: rgba(255, 255, 255, 0.75);
}
@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.4rem 1.25rem 1.1rem; }
  .site-footer__bar { padding: 0.7rem 1.25rem; }
}

/* ---------- Accessibility & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-footer, .alpha-pill { display: none !important; }
  body { background: #fff !important; }
}

/* Apply page: radio list */
.fac-heading { margin: 1.25rem 0 .5rem; font-size: 1.05rem; color: var(--brand-dark); }
.radio-list { display: grid; gap: .25rem; }

.radio-row,
.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .45rem .25rem;
  cursor: pointer;
  color: var(--ink);
  font-size: .95rem;
}

fieldset .radio-row input[type="radio"],
.check-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  border: initial;
  background: initial;
  accent-color: var(--brand);
}

.radio-row:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* Compact radios/checkboxes outside .radio-row / .check-row (dept service radios,
   course picks, wizard edu-include, grid-2, supervision/academic lists). */
input[name="is_service"][type="radio"],
input[name="course_ids"][type="checkbox"],
input[name="app_ids"][type="checkbox"],
input.edu-include[type="checkbox"],
.grid-2 input[type="checkbox"],
.grid-2 input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  max-width: 1.1rem;
  flex: 0 0 auto;
  justify-self: start;
  align-self: center;
  padding: 0;
  margin: 0;
  border: initial;
  background: initial;
  accent-color: var(--brand);
}
