@font-face{font-family:'Rabar_008';src:url('../home/assets/Rabar_008.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:'SFPro';src:url('../fonts/sfpro-regular.woff') format('woff');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:'SFPro';src:url('../fonts/sfpro-medium.woff') format('woff');font-style:normal;font-weight:500;font-display:swap}
@font-face{font-family:'SFPro';src:url('../fonts/sfpro-bold.woff') format('woff');font-style:normal;font-weight:700;font-display:swap}

/* ==========================================================================================
   Sign in.

   One photograph — the sunrise terrace — for both themes. Dark mode takes that same frame
   down to night with a filter rather than swapping in a second image, so the two themes are
   the same place at two times of day. The card is a single glass panel centred on it.

   The theme comes from the same localStorage 'theme' key the app and the public site use, so
   a choice made in any of the three follows you into the others.
   ========================================================================================== */

:root {
  color-scheme: dark;
  /* The brand, the same one the application's primary button carries. The names stayed
     gold because a dozen rules below read them. */
  --gold: #DB5227;
  --gold-bright: #F4714B;

  /* SF Pro, the same face the application uses, self-hosted here as it is there.
 
     This page used to fetch Cormorant Garamond and Inter from Google on every load — the
     one place in the whole app still reaching outside, on the single page that is served
     before anybody has signed in. That is gone: the sign-in screen now renders with no
     third-party request at all, which also means it keeps its face on a network that blocks
     Google and inside the installed app when it is offline.
 
     The display serif went with it. It was the thing that made this page feel like a
     different product from the one behind it, and consistency is worth more here than the
     flourish. Kurdish still overrides all three below, as it always did. */
  --font-display: 'SFPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'SFPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui: 'SFPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Everything below is re-stated for the light theme further down. */
  --scene: url("../home/assets/login-day.webp");
  /* Onyx uses the same photograph in neutral grayscale, behind a near-black card. */
  --scene-filter: brightness(0.36) saturate(0) contrast(1.2);
  --card-bg: rgba(10, 12, 18, 0.86);
  --card-border: rgba(210, 210, 210, 0.26);
  --card-shadow: 0 28px 70px rgba(0, 0, 0, 0.58);
  --ink: #f0f0f0;
  --ink-soft: rgba(230, 230, 230, 0.62);
  --field-bg: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.09);
  --field-focus: rgba(210, 210, 210, 0.55);
  --btn-bg: #DB5227;
  --btn-border: #DB5227;
  --btn-ink: #0A0C12;
  --scrim: linear-gradient(180deg, rgba(2, 2, 2, 0.42), rgba(2, 2, 2, 0.68));
}

/* Kurdish (Sorani). The Latin faces carry no Arabic-script glyphs, so without this the
   browser silently substitutes whatever it has and the page looks nothing like the rest. */
html[lang="ku"] {
  --font-display: 'Rabar_008', "Noto Naskh Arabic", Tahoma, serif;
  --font-body: 'Rabar_008', "Noto Sans Arabic", Tahoma, sans-serif;
  --font-ui: 'Rabar_008', "Noto Sans Arabic", Tahoma, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --scene-filter: none;                 /* the photograph as shot */
  --card-bg: rgba(255, 255, 255, 0.74);
  --card-border: rgba(255, 255, 255, 0.75);
  --card-shadow: 0 28px 70px rgba(22, 48, 84, 0.22);
  --ink: #10294a;
  --ink-soft: rgba(16, 41, 74, 0.58);
  --field-bg: rgba(255, 255, 255, 0.66);
  --field-border: rgba(16, 41, 74, 0.12);
  --field-focus: rgba(16, 41, 74, 0.4);
  --btn-bg: #DB5227;
  --btn-border: #DB5227;
  --btn-ink: #0A0C12;
  --scrim: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(20, 50, 90, 0.12));
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: #0A0C12; color: var(--ink); font-family: var(--font-body); }
html[data-theme="light"] body { background: #cfe2f6; }
button, input { font: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- the scene ---------- */
.login-shell {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
  background-image: var(--scene);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
/* A wash so the card's edge always has something to sit against, whatever part of the scene
   the crop happens to land on — and, in dark mode, the layer that turns the sunrise into
   night. The filter goes on the backdrop rather than on .login-shell itself so it reaches the
   photograph alone and leaves the card and its text untouched. */
.scene-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--scrim);
  backdrop-filter: var(--scene-filter);
  -webkit-backdrop-filter: var(--scene-filter);
}
/* Without backdrop-filter there is nothing to darken the photograph with, so the wash has to
   carry dark mode on its own. */
@supports not ((backdrop-filter: brightness(1)) or (-webkit-backdrop-filter: brightness(1))) {
  :root { --scrim: linear-gradient(180deg, rgba(2, 2, 2, 0.76), rgba(2, 2, 2, 0.88)); }
}

/* ---------- the card ---------- */
.login-card {
  position: relative;
  width: min(404px, 100%);
  padding: 30px 30px 26px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow: var(--card-shadow);
  text-align: center;
}

/* A soft halo under the card. It lifts the panel off the scene, and it happens to blend the
   seam of the patch the card sits on — see the note in the asset build. */
.login-card::before {
  content: "";
  position: absolute;
  inset: -70px -54px;
  border-radius: 50%;
  background: radial-gradient(60% 55% at 50% 50%, rgba(4, 12, 24, 0.42), rgba(4, 12, 24, 0) 72%);
  filter: blur(26px);
  z-index: -1;
  pointer-events: none;
}
html[data-theme="light"] .login-card::before {
  background: radial-gradient(60% 55% at 50% 50%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 72%);
}

.brand { display: block; margin: 0 auto 22px; }
.brand img { display: block; width: 186px; max-width: 74%; height: auto; margin: 0 auto; }
/* Written as `.brand img.x` so these beat the `.brand img { display: block }`
   above — a bare `.brand-light` loses that cascade and both lockups show. */
.brand img.brand-light { display: none; }
html[data-theme="light"] .brand img.brand-dark { display: none; }
html[data-theme="light"] .brand img.brand-light { display: block; }

/* ---------- messages ---------- */
.flash-list { margin: 0 0 14px; display: grid; gap: 8px; }
.flash-message {
  margin: 0; padding: 9px 13px; border-radius: 9px; font-size: 13px; line-height: 1.45;
  text-align: start;
  background: rgba(190, 60, 52, 0.16); border: 1px solid rgba(190, 60, 52, 0.38); color: #ffc9c3;
}
.flash-success { background: rgba(40, 140, 100, 0.16); border-color: rgba(40, 140, 100, 0.4); color: #b8ecd3; }
html[data-theme="light"] .flash-message { background: rgba(179, 38, 30, 0.08); border-color: rgba(179, 38, 30, 0.28); color: #8d211a; }
html[data-theme="light"] .flash-success { background: rgba(16, 116, 90, 0.08); border-color: rgba(16, 116, 90, 0.3); color: #0b5d47; }

/* ---------- fields ---------- */
.login-form { display: grid; gap: 11px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  transition: border-color .18s ease, background .18s ease;
}
.field:focus-within { border-color: var(--field-focus); }
.field > svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: var(--ink-soft); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; color: var(--ink);
  font-size: 14.5px; outline: none;
}
.field input::placeholder { color: var(--ink-soft); }
/* Chrome paints its own tint over an autofilled input; hold the field's own colours. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 8000s;
}

.password-toggle {
  flex: none; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: none; color: var(--ink-soft); cursor: pointer;
}
.password-toggle:hover { color: var(--ink); }
.password-toggle svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

/* ---------- sign in ---------- */
.sign-in {
  margin-top: 5px;
  height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer;
  transition: filter .18s ease, transform .12s ease, box-shadow .18s ease;
}
html[lang="ku"] .sign-in { letter-spacing: .06em; }
.sign-in:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(219, 82, 39, 0.28); }
.sign-in:active { transform: translateY(1px); }
.sign-in-arrow {
  width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
html[dir="rtl"] .sign-in-arrow { transform: scaleX(-1); }

/* ---------- signing in with the device ----------
   These three classes are also defined in app.css, but this page does not load app.css —
   it loads only this file. So the passkey button added to the sign-in screen has been
   rendering as a bare browser button since the day it went in. It is styled here, against
   the glass card rather than against a panel, which is why it is not a copy of the app's
   version: on this card a solid fill would compete with Sign in, so it is outlined. */
.login-alt { margin-top: 16px; }
.login-alt-or {
  display: block; text-align: center; margin-bottom: 12px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
}
.passkey-btn {
  width: 100%; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--ink);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, opacity .18s ease;
}
.passkey-btn:hover:not(:disabled) { border-color: var(--field-focus); }
.passkey-btn:disabled { opacity: .6; cursor: progress; }
.passkey-btn svg { width: 18px; height: 18px; flex: none; }
.pk-note {
  margin: 9px 0 0; text-align: center; line-height: 1.45;
  font-size: 12.2px; color: var(--ink-soft);
}
.pk-note.is-bad { color: #FF9DB0; }
html[data-theme="light"] .pk-note.is-bad { color: #B62949; }

/* ---------- remember / forgot ---------- */
.form-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 9px; font-size: 12.5px;
}
.remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); }
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember .box {
  width: 15px; height: 15px; flex: none; border-radius: 3px;
  border: 1px solid var(--ink-soft); display: grid; place-items: center;
  transition: background .15s ease, border-color .15s ease;
}
.remember .box::after {
  content: ""; width: 7px; height: 4px;
  border-inline-start: 2px solid var(--btn-bg); border-bottom: 2px solid var(--btn-bg);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0; transition: opacity .12s ease;
}
.remember input:checked + .box { background: var(--gold); border-color: var(--gold); }
.remember input:checked + .box::after { opacity: 1; }
.remember input:focus-visible + .box { outline: 2px solid var(--field-focus); outline-offset: 2px; }

.forgot {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 12.5px; text-decoration: underline;
  text-underline-offset: 3px;
}
.forgot:hover { color: var(--ink); }
.forgot-note {
  margin: 10px 0 0; padding: 9px 12px; border-radius: 9px;
  background: var(--field-bg); border: 1px solid var(--field-border);
  color: var(--ink-soft); font-size: 12px; line-height: 1.5; text-align: start;
}
.forgot-note[hidden] { display: none; }

/* ---------- preferences gear ---------- */
.pref-wrap { position: fixed; top: 18px; inset-inline-end: 20px; z-index: 20; }
.pref-btn {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 50%;
  background: rgba(6, 14, 26, 0.35); color: #f3ece0; cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: .85;
  transition: transform .25s ease, opacity .2s ease;
}
.pref-btn:hover, .pref-btn[aria-expanded="true"] { opacity: 1; transform: rotate(20deg); }
html[data-theme="light"] .pref-btn { border-color: rgba(16, 41, 74, 0.3); background: rgba(255, 255, 255, 0.6); color: #10294a; }
.pref-gear { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.pref-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  min-width: 218px; padding: 12px 14px 13px;
  border-radius: 13px; border: 1px solid var(--card-border);
  background: var(--card-bg); backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow); color: var(--ink); text-align: start;
}
.pref-menu[hidden] { display: none; }
.pref-head { margin: 0 0 9px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 13px; }
.pref-row + .pref-row { border-top: 1px solid var(--field-border); }
.pref-row span { color: var(--ink); }

.theme-toggle {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0; flex: none;
  border: 1px solid var(--field-border); border-radius: 50%;
  background: var(--field-bg); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--field-focus); }
.theme-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* The icon shows the mode you would switch TO, which is what the label says. */
.icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }

.lang-btn {
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--field-border); background: var(--field-bg);
  color: var(--ink); font-size: 12.5px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--field-focus); }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  .login-card { padding: 24px 20px 22px; border-radius: 16px; }
  .brand img { width: 156px; }
  .form-foot { font-size: 12px; }
  .pref-wrap { top: 12px; inset-inline-end: 12px; }
}
/* A tall phone crops the scene so hard that it lands on the middle of the frame — the very
   strip the card was painted out of. Pull the framing left, onto the statue and the sunset,
   so the crop is untouched scenery. */
@media (max-width: 520px) and (orientation: portrait) {
  .login-shell { background-position: 12% center; }
}

@media (prefers-reduced-motion: reduce) {
  .sign-in, .pref-btn { transition: none; }
  .pref-btn:hover { transform: none; }
}
