/* Shared base styles for the public site and admin. Uses tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); }
a:hover { color: var(--blue-hover); }

h1, h2, h3 { line-height: 1.2; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--white); color: var(--blue);
  padding: 10px 16px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }

/* Arabic / Urdu text typed into content. Direction comes from dir="auto". */
.ar { font-family: var(--font-arabic); line-height: var(--lh-arabic); }
.ur { font-family: var(--font-urdu); line-height: var(--lh-urdu); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-hover); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink-3); border-color: var(--input-border); }
.btn-secondary:hover { border-color: var(--input-border-strong); color: var(--ink); }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; padding: 0; min-height: var(--tap);
  font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer;
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13.5px; color: var(--muted); margin: 0; }
.input {
  width: 100%; min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--input-border); border-radius: var(--radius);
  font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
}
.input:hover { border-color: var(--input-border-strong); }
.input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.input-code { font-size: 22px; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }

/* Messages */
.alert {
  margin: 0; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--parchment-2); font-size: 15px;
}
.alert-error { background: #FBEDE8; border-color: #E9C3B6; color: var(--danger); }
.alert-success { background: var(--st-new-bg); border-color: #B5E6DF; color: var(--st-new-fg); }
.alert-warning { background: var(--gold-tint); border-color: #E8D7A8; color: var(--gold-tint-text); }
.alert-info { background: var(--blue-tint-2); border-color: #CBD6EE; color: var(--blue); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); }

/* Error pages */
.error-page { max-width: 640px; margin: 0 auto; padding: 72px 16px; text-align: center; }
.error-code { font-family: var(--font-display); font-size: 72px; font-weight: 600; color: var(--gold-text); margin: 0; line-height: 1; }
.error-page h1 { font-family: var(--font-display); font-size: var(--fs-h2); margin: 12px 0; }
.error-trace {
  text-align: left; white-space: pre-wrap; overflow-x: auto;
  font-size: 12.5px; background: var(--parchment-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-top: 24px;
}
