/*
 * auth.arakma.com. Same tokens as the marketing site (apps/www/app/globals.css),
 * kept to what these pages use. Logical properties (margin-inline, text-align:
 * start) so the pages flip correctly once Arabic (dir=rtl) is added.
 */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #0b1d33;
  --text-muted: #5b6b80;
  --border: #dbe0e8;
  --border-strong: #c3cad7;
  --accent: #3355ff;
  --accent-hover: #2744e6;
  --accent-soft: #eaeeff;
  --accent-contrast: #ffffff;
  --good: #15803d;
  --good-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --shadow-card: 0 1px 2px rgba(11, 29, 51, 0.05), 0 4px 12px -4px rgba(11, 29, 51, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1d33;
    --surface: #11263f;
    --text: #ffffff;
    --text-muted: #9aabbf;
    --border: #1e3a5c;
    --border-strong: #2d4f78;
    --accent: #7b93ff;
    --accent-hover: #93a7ff;
    --accent-soft: #1a2c5c;
    --accent-contrast: #0b1d33;
    --good: #4ade80;
    --good-soft: #0f2a1d;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --shadow-card: none;
  }
  .logo-light { display: none; }
  .logo-dark { display: block !important; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
}

.brand { margin-block-end: 28px; }
.brand img { height: 28px; display: block; }
.logo-dark { display: none; }

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.card.wide { max-width: 560px; }

h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 18px; }
h2 { font-size: 15px; margin: 24px 0 10px; }
p { margin: 0 0 14px; }
.muted { color: var(--text-muted); font-size: 13px; }

label { display: block; font-weight: 500; font-size: 13px; margin: 14px 0 6px; }
input, select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 11px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-error { color: var(--warn); font-size: 13px; margin-top: 4px; }

button, .button {
  display: inline-block;
  width: 100%;
  margin-top: 18px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}
button:hover, .button:hover { background: var(--accent-hover); }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.secondary:hover, .button.secondary:hover { background: var(--accent-soft); }
button.inline { width: auto; margin: 0; padding: 5px 12px; font-size: 13px; }

a { color: var(--accent); }
.links { margin-top: 18px; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.notice { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

.divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; margin: 22px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.list li + li { border-top: 1px solid var(--border); }
.tag { font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* Staff console (/admin): wider, with tables. */
.card.console { max-width: 960px; }
.heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.search input { margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table .tag { margin-inline-end: 4px; }
.nowrap { white-space: nowrap; }
.tag.off { color: var(--text-muted); background: var(--bg); }
.product { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 4px; }
@media (max-width: 640px) {
  .row { flex-direction: column; gap: 0; }
  .table { display: block; overflow-x: auto; }
}
.badge-line { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.expired { color: #dc2626; font-size: 13px; font-weight: 600; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 9px 11px; resize: vertical; }
.notes button.inline, .product > button.inline { margin-top: 12px; }
.control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px;
  padding-top: 12px; border-top: 1px dashed var(--border); }
button.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
button.danger:hover { background: #b91c1c; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
dialog.confirm { border: 1px solid var(--border); border-radius: 12px; padding: 24px; width: min(460px, 92vw);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
dialog.confirm::backdrop { background: rgba(11, 29, 51, 0.45); }
dialog.confirm h2 { margin-top: 0; }
dialog.confirm .row { margin-top: 8px; }
.notes-cell { white-space: pre-line; font-size: 13px; max-width: 460px; }
.row-inline { display: flex; gap: 8px; }
tr.retired td { color: var(--text-muted); }
