/*
 * Saudagar standalone pages (sign-in, not found, error, message): values from
 * docs/design-system/tokens/tokens.css, fonts self-hosted by iaw_theme.
 * These pages load no framework CSS/JS.
 */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/iaw_theme/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  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+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/iaw_theme/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Baloo Bhaijaan 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/iaw_theme/fonts/baloo-bhaijaan-2-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Noto Nastaliq Urdu"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/iaw_theme/fonts/noto-nastaliq-urdu-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

:root {
  color-scheme: light;
  --canvas: #f7f3ec; --surface: #fffdf9; --surface-sunken: #f1ebe1; --surface-hover: #f5f0e7;
  --line: #e7dfd2; --line-strong: #8a8070;
  --ink: #0f172a; --ink-soft: #475569; --ink-muted: #5c687a;
  --brand: #0f766e; --brand-strong: #0f4c46; --brand-soft: #e0f2ee; --on-brand: #ffffff;
  --marigold: #f2a91e;
  --success: #15703f; --success-soft: #e2f4e9;
  --danger: #b42318; --danger-soft: #fdeceb;
  --shadow-md: 0 2px 4px #3b2a140f, 0 8px 20px -4px #3b2a141f;
  --shadow-sheet: 6px 6px 0 0 #0f766e1f;
  --focus-ring: 0 0 0 2px #fffdf9, 0 0 0 5px #0f766e;
  --radius-md: 12px; --radius-lg: 18px; --radius-xl: 28px;
  --control-md: 44px; --control-lg: 52px;
  --font-display: "Baloo Bhaijaan 2", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0d1615; --surface: #142120; --surface-sunken: #0a1211; --surface-hover: #1a2a28;
    --line: #263633; --line-strong: #6f817d;
    --ink: #eef4f2; --ink-soft: #bccac6; --ink-muted: #95a6a2;
    --brand: #3cc3b0; --brand-strong: #86e0d2; --brand-soft: #113a35; --on-brand: #03201c;
    --success: #62d496; --success-soft: #0f3322;
    --danger: #ff8f85; --danger-soft: #431715;
    --shadow-md: 0 8px 20px -4px #000000a6;
    --shadow-sheet: 6px 6px 0 0 #3cc3b026;
    --focus-ring: 0 0 0 2px #142120, 0 0 0 5px #3cc3b0;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--canvas); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 24px;
  font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: 32px 16px;
}
main { width: 100%; max-width: 420px; }
.brand { text-align: center; margin-bottom: 24px; }
.brand .wordmark { display: block; width: 300px; max-width: 80%; height: auto; margin: 0 auto; }
.brand .darkname { display: none; align-items: center; justify-content: center; gap: 12px; }
.brand .darkname img { width: 44px; height: 44px; border-radius: var(--radius-md); box-shadow: 4px 4px 0 0 var(--brand-soft); }
.brand .darkname span { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 40px; }
@media (prefers-color-scheme: dark) {
  .brand .wordmark { display: none; }
  .brand .darkname { display: flex; }
}
.tagline { margin: 12px 0 0; color: var(--ink-soft); font-size: 17px; }
.tagline .ur { font-family: var(--font-urdu); font-size: 15px; line-height: 32px; margin-inline-start: 8px; color: var(--ink-muted); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), var(--shadow-sheet); padding: 28px 24px;
}
h1 { font-family: var(--font-display); font-size: 26px; line-height: 34px; font-weight: 700; margin: 0 0 4px; }
.lead { margin: 0 0 20px; color: var(--ink-soft); }
.field { margin-bottom: 16px; }
label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; margin-bottom: 6px; }
label .ur { font-family: var(--font-urdu); font-weight: 400; color: var(--ink-muted); margin-inline-start: 6px; }
.control { position: relative; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; height: var(--control-lg); padding: 0 14px; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--ink-muted); }
input:focus-visible { box-shadow: var(--focus-ring); border-color: var(--brand); }
input[aria-invalid=true] { border-color: var(--danger); }
.control.has-toggle input { padding-inline-end: 84px; }
.toggle {
  position: absolute; inset-inline-end: 4px; top: 4px; height: 44px; min-width: 72px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.toggle:hover { background: var(--surface-hover); }
.toggle:focus-visible, .btn:focus-visible, .link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: var(--control-lg); border: 0; border-radius: var(--radius-md);
  background: var(--brand); color: var(--on-brand); font: inherit; font-size: 17px; font-weight: 700;
  cursor: pointer; transition: background-color .15s ease;
}
.btn:hover { background: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .btn:hover { background: var(--brand-strong); color: var(--on-brand); } }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn.busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2s; } * { transition: none !important; } }
.row { display: flex; justify-content: center; margin-top: 16px; }
.link {
  background: none; border: 0; padding: 10px 12px; min-height: 44px; border-radius: 10px;
  color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.link:hover { background: var(--surface-hover); }
.alert { display: none; border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; font-size: 15px; line-height: 22px; }
.alert.show { display: flex; gap: 10px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 2px; }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert p { margin: 0; color: var(--ink); }
[hidden] { display: none !important; }
footer { margin-top: 24px; color: var(--ink-muted); font-size: 13px; line-height: 18px; text-align: center; }
@media (max-width: 420px) { .card { padding: 24px 18px; border-radius: var(--radius-lg); } h1 { font-size: 24px; } }

/* message / error pages */
.page-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--brand-soft); color: var(--brand); }
.page-icon.danger { background: var(--danger-soft); color: var(--danger); }
.page-icon.success { background: var(--success-soft); color: var(--success); }
.message-body { color: var(--ink-soft); margin: 0 0 20px; overflow-wrap: anywhere; }
.message-body a { color: var(--brand); font-weight: 600; }
.status { color: var(--ink-muted); font-size: 13px; line-height: 18px; margin: -8px 0 20px; }
a.btn { text-decoration: none; }
.actions { display: grid; gap: 8px; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--line-strong); }
.btn.secondary:hover { background: var(--surface-hover); color: var(--brand); }
details.trace { margin-top: 16px; font-size: 13px; color: var(--ink-muted); }
details.trace pre { white-space: pre-wrap; max-height: 320px; overflow: auto; background: var(--surface-sunken); padding: 12px; border-radius: var(--radius-md); }
