/* StudyApp website + account portal. System fonts only (no external request), light and dark, logical properties (Arabic RTL).
   Colours: the Nomanta palette (branding/nomanta_v1, owner 2026-11-04: navy #102F57, turquoise #05C8DB; site and e-mail moved to it 2026-11-10). */
:root {
  --brand: #102F57;
  --brand-2: #1B4F8A;
  --accent: #05C8DB;
  --accent-ink: #102F57; /* navy on turquoise: 6.7:1 */
  --focus: #1B4F8A; /* turquoise on white is 2:1, under the 3:1 a focus ring needs */
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-2: #EEF2F8;
  --ink: #15202E;
  --muted: #5B6676;
  --line: #DCE3EC;
  --ok: #1E7A4C;
  --warn: #9A5B00;
  --danger: #B3261E;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 8px 24px rgba(16, 32, 56, .08);
  --wrap: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9DB8DA;
    --brand-2: #C3D5EC;
    --accent: #05C8DB;
    --focus: #05C8DB;
    --bg: #0E141C;
    --surface: #161E29;
    --surface-2: #1D2735;
    --ink: #E8EDF4;
    --muted: #A2AEBF;
    --line: #2A3647;
    --ok: #5CC795;
    --warn: #F0B45A;
    --danger: #FF8A80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; /* a short page keeps its footer at the bottom of the screen */
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}
a { color: var(--brand-2); }
@media (prefers-color-scheme: light) { a { color: var(--brand); } }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; overflow-wrap: break-word; hyphens: auto; } /* long German and Dutch compounds on small phones */
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
h1, h2 { text-wrap: balance; }
:lang(ar) h1 { letter-spacing: 0; } /* letter-spacing breaks the joins between Arabic letters */
:lang(ar) body, body:lang(ar) { line-height: 1.8; }
p { margin: 0 0 1em; }
main { flex: 1 0 auto; }
.ico { display: block; flex: none; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 8px; }
.nav-toggle > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; place-items: center; border-radius: 10px; display: none; }
.nav-toggle > summary:hover, .nav-toggle[open] > summary { background: var(--surface-2); }
.nav-toggle > summary .ico { width: 24px; height: 24px; }
.nav-toggle > summary::-webkit-details-marker { display: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { color: var(--brand-2); background: var(--surface-2); }
.nav a.nav-account { border: 1px solid var(--line); margin-inline-start: 8px; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-wide { display: none; }
  .nav-toggle { display: block; }
  .nav-toggle > summary { display: grid; }
  .nav-toggle[open] > .nav a { padding: 12px; }
  .nav-toggle[open] > .nav { position: absolute; inset-inline: 0; top: 64px; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; box-shadow: var(--shadow); }
  .nav a.nav-account { margin-inline-start: 0; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* hero */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 38em; }
.hero .note { font-size: .95rem; color: var(--muted); margin-top: 12px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 36px; } }

/* illustration: a stylised tablet with a page, ink and the study dock (no screenshot, no third-party content) */
.device { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 14px; box-shadow: var(--shadow); }
.device-screen { border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.device-screen svg { display: block; width: 100%; height: auto; }

/* sections */
.section { padding: 48px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 46em; margin-bottom: 28px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.section-alt .card { background: var(--bg); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.icon { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); flex: none; }
.cta-band { background: var(--brand); color: #fff; border-radius: 22px; padding: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
@media (prefers-color-scheme: dark) { .cta-band { background: #163C6B; } }
.cta-band p { margin: 0; opacity: .9; }

/* feature lists */
.feature-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { position: relative; padding-inline-start: 28px; margin: 8px 0; }
.check li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--ok); font-weight: 700; }
.check li.no::before { content: "–"; color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-inline-start: 6px; vertical-align: middle; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.plan.featured { border: 2px solid var(--accent); }
.plan .price { font-size: 2.4rem; font-weight: 800; margin: 6px 0 0; }
.plan .per { color: var(--muted); font-size: .95rem; }
.plan .check { margin: 18px 0 22px; flex: 1; }
.plan .badge { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-inline-start: 6px; }
.notice { border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; }
.notice.ok { border-inline-start-color: var(--ok); }
.notice.warn { border-inline-start-color: var(--warn); }
.notice.danger { border-inline-start-color: var(--danger); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 18px; border-radius: 12px; } /* the whole row opens the answer, not only its line of text */
.faq details p { margin: 0; padding: 0 18px 14px; color: var(--muted); }

/* download */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }

/* prose (privacy, terms) */
.prose > * { max-width: 46rem; } /* the text column starts where the header starts; only its lines are kept short */
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }

/* account portal */
.portal { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding-block: 36px 56px; }
.portal > * { min-width: 0; }
@media (max-width: 760px) { .portal { grid-template-columns: minmax(0, 1fr); } }
.portal-nav { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 760px) { .portal-nav { flex-direction: row; flex-wrap: wrap; } }
.portal-nav a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.portal-nav a.active { background: var(--surface-2); color: var(--brand-2); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.auth-box { max-width: 440px; margin: 48px auto 72px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; }
input[type=email], input[type=text] { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 46px; }
input.code { letter-spacing: .35em; font-size: 1.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 600; font-size: .9rem; }
@media (max-width: 900px) { /* stacked rows: the device table is five columns wide */
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.list td { display: flex; justify-content: space-between; border: 0; padding: 4px 0; gap: 12px; text-align: end; overflow-wrap: anywhere; }
  table.list td::before { content: attr(data-label); color: var(--muted); }
}
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.status-ok { color: var(--ok); font-weight: 600; }
.status-off { color: var(--muted); }
pre.mail { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }

/* admin console (docs/ADMIN_CONSOLE_ARCHITECTURE.md §6): the portal's layout, plus figures, forms and states */
.small { font-size: .85rem; }
.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; }
.wrap-anywhere { overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.brand .badge { margin-inline-start: 6px; }
.admin-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.admin-who form { margin: 0; }
body.admin code { direction: ltr; unicode-bidi: isolate; } /* ids, model ids and audit details read left to right in Arabic too */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.title-row h1, .title-row h2 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-l { color: var(--muted); font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; align-items: start; }
.form-grid .field-wide { grid-column: 1 / -1; }
.field-help { color: var(--muted); font-size: .85rem; }
.field-error { color: var(--danger); font-size: .85rem; font-weight: 600; }
.field-error:empty { display: none; }
.field-check label { font-weight: 400; display: flex; align-items: center; gap: 8px; }
select, input[type=number], input[type=search] { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 46px; }
.search-row { display: flex; gap: 10px; margin: 0 0 12px; }
.search-row input { flex: 1; min-width: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 18px; }
.lang-row { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.title-row .lang-row a { color: var(--muted); text-decoration: none; }
.title-row .lang-row a.active { color: var(--ink); font-weight: 600; }
table.list td.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
table.list td.actions form { margin: 0; }
table.list tfoot th, table.list tfoot td { font-weight: 700; border-bottom: 0; }
code.details { display: block; max-width: 36em; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; color: var(--muted); }
meter { width: 140px; max-width: 100%; vertical-align: middle; }
.status-warn, .status-production { color: var(--warn); font-weight: 600; }
.status-danger { color: var(--danger); font-weight: 600; }
.status-internaltesting { color: var(--ok); font-weight: 600; }
.status-disabled { color: var(--muted); }
@media (max-width: 900px) {
  table.list tfoot th { display: none; }
  table.list tfoot tr { display: block; padding: 8px 0; }
  table.list td.actions { justify-content: flex-start; }
  table.list td.actions:empty { display: none; }
  code.details { max-width: none; text-align: start; }
}
@media (max-width: 600px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { flex-direction: column; }
  body.admin .header-row { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  .admin-who { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .admin-who .muted { font-size: .85rem; overflow-wrap: anywhere; min-width: 0; }
  .admin-who .btn { white-space: nowrap; padding-inline: 14px; }
}

/* error page (Status.cshtml) */
.status-page { padding-block: 32px; }
.status-page > * { max-width: 40rem; }
.status-code { font-size: 1rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.status-page .btn-row { margin-top: 24px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 20px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-links, .lang { display: flex; flex-direction: column; gap: 6px; }
.footer-links a, .lang a { color: var(--muted); text-decoration: none; }
.lang a.active { color: var(--ink); font-weight: 600; }
.footer-links a:hover, .lang a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 760px) { /* a finger needs more than a line of text to hit */
  .footer-links, .lang { flex-direction: row; flex-wrap: wrap; gap: 0 4px; margin-inline: -10px; }
  .footer-links a, .lang a { padding: 10px; }
}
.draft-note { color: var(--muted); font-size: .85rem; margin: 18px 0 0; }
.btn-on-dark { color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .12); }
.auth-box .btn-row { margin-top: 14px; }
