/*
 * Kiran design language in the Creaitify system (docs/design-language.md): white cards on a warm
 * grey canvas, hairlines instead of shadows, one black pill, lime for warmth. The same tokens as
 * the portal and the department apps; dark follows the device (no script: the CSP allows none
 * inline, and these pages need none).
 */
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --canvas: #F3F3F1; --surface: #FFFFFF; --surface-2: #F2F2F0;
  --hairline: #EBEBE8; --hairline-2: #F0F0ED; --control-border: #8C8C87;
  --ink: #111111; --ink-2: #22221F; --muted: #66665F; --faint: #7A7A73; --navy: #0A2547;
  /* Accent as text is the olive link colour; the fill is the black pill. */
  --accent: #4F6510; --accent-fill: #111111; --accent-hover: #2E2E2E; --on-accent: #FFFFFF; --accent-tint: #EFEFEC;
  --highlight: #C9DB7F; --highlight-soft: #F1F5DF; --on-highlight: #1F2A05;
  --success: #2F7A2A; --success-bg: #E8F3E3; --warning: #B04F0A; --warning-bg: #FDF0E3;
  --danger: #C4321C; --danger-bg: #FDECEA; --neutral: #66665F; --neutral-bg: #F2F2F0;
  --hover: rgba(17, 17, 17, 0.04);
  --glass: rgba(255, 255, 255, 0.9); --glass-edge: rgba(255, 255, 255, 0);
  --shadow-card: none;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0C0C0C; --surface: #171717; --surface-2: #212121;
    --hairline: #2A2A2A; --hairline-2: #242424; --control-border: #6E6E6A;
    --ink: #F2F2F0; --ink-2: #E2E2DE; --muted: #A3A39E; --faint: #8C8C87;
    --accent: #C9DB7F; --accent-fill: #F2F2F0; --accent-hover: #FFFFFF; --on-accent: #111111; --accent-tint: #262626;
    --highlight-soft: #262E12;
    --success: #6CC46A; --success-bg: #142A14; --warning: #F0A35C; --warning-bg: #33220F;
    --danger: #FF7A66; --danger-bg: #3A1712; --neutral: #A3A39E; --neutral-bg: #212121;
    --hover: rgba(255, 255, 255, 0.06);
    --glass: rgba(23, 23, 23, 0.9); --glass-edge: rgba(255, 255, 255, 0);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--canvas); }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--canvas);
  color: var(--ink-2); font: 400 14px/20px "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--highlight) 55%, transparent); }
.mono { font-family: "Geist Mono", ui-monospace, monospace; }

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes mark-in { from { opacity: 0; transform: scale(0.86); } }

/* Glass: the blur sits on a layer behind the bar, never on the bar itself. */
.toolbar {
  position: sticky; top: 0; z-index: 10; isolation: isolate;
  min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 16px;
  box-shadow: inset 0 -0.5px 0 var(--hairline);
}
.toolbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 0.5px 0 var(--glass-edge);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.toolbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.toolbar nav > a { font-weight: 500; }
.toolbar form { margin: 0; }

main { width: 100%; padding: 32px; max-width: 1100px; margin: 0 auto; flex: 1; animation: rise-in 380ms var(--ease) backwards; }
main.narrow { max-width: 440px; padding-top: 56px; text-align: center; }
main.narrow .card { text-align: left; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 34px; color: var(--ink); margin: 0 0 24px; }
main.narrow h1 { font-size: 26px; line-height: 32px; margin-bottom: 20px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 20px; padding: 24px; margin-bottom: 24px;
}
main.narrow .card { border-radius: 28px; padding: 28px; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

/* The brand above a sign-in card: the mark alone; its four lines are the brand colour. */
.hero { display: grid; justify-items: center; gap: 18px; margin-bottom: 26px; }
.hero-mark {
  width: 76px; height: 76px; border-radius: 18px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08), 0 1px 3px rgba(17, 17, 17, 0.05);
  animation: mark-in 520ms var(--ease) backwards;
}

label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 44px; border: 1px solid var(--control-border); border-radius: 12px;
  padding: 0 14px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
select { height: 40px; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
textarea { height: 104px; padding: 10px 12px; resize: vertical; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  font: 600 14px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease);
}
.button:hover { background: var(--surface-2); text-decoration: none; }
.button:active { transform: scale(0.97); }
/* Black means go: one primary pill per screen. */
.button.primary {
  height: 52px; padding: 0 22px; border-radius: 999px; border-color: transparent; background: var(--accent-fill); color: var(--on-accent);
  font-size: 15px; font-weight: 600; box-shadow: 0 1px 2px rgba(17, 17, 17, 0.06);
}
.button.primary:hover { background: var(--accent-hover); }
.button.wide { width: 100%; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { color: var(--success); background: var(--success-bg); }
.pill.amber { color: var(--warning); background: var(--warning-bg); }
.pill.red { color: var(--danger); background: var(--danger-bg); }
.pill.grey { color: var(--neutral); background: var(--neutral-bg); }

.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; animation: rise-in 280ms var(--ease) backwards; }
.notice.error { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--success-bg); color: var(--success); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; }
.card .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--hairline-2); vertical-align: top; transition: background-color 140ms ease; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 160px; }
.filters input[type=search] { height: 40px; font-size: 14px; }
.filters .button { height: 40px; }
select {
  appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366665F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.app {
  display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px;
  padding: 18px; color: var(--ink); font-weight: 600;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
  animation: rise-in 440ms var(--ease) backwards;
}
.app:nth-child(2) { animation-delay: 40ms; } .app:nth-child(3) { animation-delay: 80ms; } .app:nth-child(n + 4) { animation-delay: 120ms; }
.app:hover { background: var(--surface-2); text-decoration: none; }
.app:active { transform: scale(0.98); }
.app small { display: block; color: var(--muted); font-weight: 400; }

dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
dt { color: var(--muted); font-size: 12px; font-weight: 500; }
dd { margin: 0; color: var(--ink); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }

@media (max-width: 640px) {
  .toolbar { padding: 8px 16px; flex-wrap: wrap; }
  main { padding: 16px; }
  main.narrow { padding-top: 40px; }
  main.narrow .card { padding: 22px; }
  dl { grid-template-columns: 1fr; }
  dt { margin-top: 6px; }
  .button.primary { width: 100%; }
  .filters .field { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.stack { margin-top: 16px; }

/* "or use your password" between Google and the password form */
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }
