/* Shared styles for the account pages (log in, sign up, my account, admin, password reset, privacy).
   Same tokens and type as the landing page (doleib-site.html). */
:root {
  --mint: #c6ebd5; --forest: #073f39; --forest-hover: #0a5248; --teal: #0b302f;
  --ivory: #f7faf8; --cream: #edf5f0; --sage: #e2f2e8; --white: #fff;
  --muted: #49645a; --text: #243b34; --line: #d7e6dd; --field-border: #82988a;
  --accent: #d6a24a; --amber: #795012; --amber-bg: #fff2d8;
  --shadow-sm: 0 2px 3px rgba(7, 63, 57, .025), 0 12px 28px -22px rgba(7, 63, 57, .22);
  --shadow-md: 0 4px 6px rgba(7, 63, 57, .035), 0 20px 36px -24px rgba(7, 63, 57, .24);

  --danger: #a3312a; --danger-bg: #fbeeec; --ok: #1d6b43; --ok-bg: #e7f2ea;
  --serif-en: 'DM Serif Display', Georgia, serif; --serif-ar: 'Noto Naskh Arabic', 'Almarai', serif;
  --sans-en: 'Manrope', 'Almarai', system-ui, 'Segoe UI', sans-serif; --sans-ar: 'Almarai', 'Manrope', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --serif: var(--serif-ar); --sans: var(--sans-ar);
}
:root[lang="en"] { --serif: var(--serif-en); --sans: var(--sans-en); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--ivory); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
:root[lang="en"] body { line-height: 1.6; }
h1, h2, h3 { margin: 0; color: var(--teal); font-family: var(--serif); font-weight: 600; line-height: 1.35; }
:root[lang="en"] h1, :root[lang="en"] h2 { font-weight: 400; line-height: 1.15; }
p { margin: 0; }
a { color: var(--forest); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2f7d70; outline-offset: 3px; border-radius: 8px; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wa { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* header */
.app-header { position: sticky; top: 0; z-index: 20; background: var(--ivory); border-bottom: 1px solid var(--line); }
.app-header .container { height: 70px; display: flex; align-items: center; gap: 14px; }
.logo { display: inline-flex; align-items: center; color: var(--forest); text-decoration: none; margin-inline-end: auto; }
.logo svg { display: block; fill: currentColor; }
.logo .logo-mark { width: 120px; height: 42px; }   /* the logo دُليب, 2.86 : 1, the same in both languages */
.lang-btn { height: 38px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--teal); font-weight: 700; font-size: 14px; cursor: pointer; }
.lang-btn:hover { border-color: var(--forest); }
.head-link { color: var(--teal); font-weight: 700; font-size: 14.5px; text-decoration: none; }
.head-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 999px; padding: 12px 24px; font-family: var(--sans); font-weight: 700; font-size: 15px; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.btn-primary { background: var(--forest); color: #fff; box-shadow: 0 10px 22px -12px rgba(7, 63, 57, .7); }
.btn-primary:hover { background: var(--forest-hover); }
.btn-outline { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-outline:hover { background: var(--forest); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8a2822; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.ts-box { min-height: 65px; }   /* Cloudflare Turnstile's box: room kept so the button doesn't jump (2026-10-27) */
.btn[disabled] { opacity: .6; cursor: progress; }
/* "Continue with Google" (Google's own button colours) and the "or" divider under it */
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f8faff; border-color: #c6dafc; }
.btn-google .g { display: inline-grid; place-items: center; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted); font-size: 13.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-btn { border: 0; background: none; padding: 0; color: var(--forest); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* auth cards */
.auth { flex: 1; display: grid; place-items: center; padding: 40px 16px 56px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 30px; }
.auth .card { width: min(480px, 100%); }
.auth h1 { font-size: 2rem; }
.lead { margin-top: 6px; color: var(--muted); }
.form { display: grid; gap: 16px; margin-top: 22px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 700; font-size: 14.5px; color: var(--teal); }
.field small { color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--teal); background: var(--ivory); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; transition: border-color .2s ease, box-shadow .2s ease; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(7, 63, 57, .1); }
input[readonly] { color: var(--muted); }
/* typed text runs in its own direction (Arabic in the English view and the reverse) */
input[type="text"], input[type="search"], textarea { unicode-bidi: plaintext; }
input[dir="ltr"] { text-align: left; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 64px; }
.pw-toggle { position: absolute; inset-block: 0; inset-inline-end: 8px; margin: auto 0; height: 32px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.check { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.check input { width: 18px; height: 18px; margin-top: 4px; flex: none; accent-color: var(--forest); }
.check > span { flex: 1; min-width: 0; }
.check .err { flex-basis: 100%; margin: 0; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14.5px; font-weight: 600; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--cream); color: var(--teal); font-weight: 400; }
.switch { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 15px; }
.switch a { font-weight: 700; }

/* dashboards */
.page { flex: 1; padding: 34px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 24px; align-items: start; }
.stack { display: grid; gap: 22px; }
.card h2 { font-size: 1.35rem; }
.card .lead { font-size: 14.5px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.new, .badge.reviewing { background: var(--amber-bg); color: var(--amber); }
.badge.contacted { background: var(--sage); color: var(--forest); }
.badge.matched { background: var(--ok-bg); color: var(--ok); }
.badge.closed, .badge.completed { background: #eceae4; color: var(--muted); }
.badge.withdrawn { background: #f6e3e1; color: #a3312a; }
.badge.score { background: var(--white); color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--forest); }
.req-list { display: grid; gap: 12px; margin-top: 16px; }
.req { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--ivory); }
.req-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.req b { color: var(--teal); }
.req p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.empty { margin-top: 14px; color: var(--muted); font-size: 15px; }
.danger-zone { border-color: #efd3cf; }
.help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }

/* admin */
.tabs { display: flex; gap: 6px; margin-top: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--forest); border-bottom-color: var(--forest); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.stat b { display: block; font-family: var(--serif-en); font-weight: 400; font-size: 2.2rem; line-height: 1.1; color: var(--forest); }
.stat span { color: var(--muted); font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.toolbar input[type="search"] { width: min(360px, 100%); padding: 9px 14px; border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--white); color: var(--teal); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.toolbar .spacer { flex: 1; }
.table-wrap { margin-top: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 700; background: var(--cream); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fbfaf5; }
.wa-link { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); font-weight: 700; text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.wa-link .wa { width: 15px; height: 15px; }
.row-edit { display: grid; gap: 8px; min-width: 220px; }
.row-edit select, .row-edit input, .row-edit textarea { padding: 7px 10px; font-size: 14px; border-radius: 9px; }
.row-edit textarea { min-height: 60px; }
.saved { color: var(--ok); font-size: 13px; font-weight: 700; }
dialog { border: 0; padding: 0; border-radius: 18px; width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); color: var(--text); }
dialog::backdrop { background: rgba(7, 30, 27, .55); }
.dlg-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; background: var(--white); border-bottom: 1px solid var(--line); }
.dlg-body { padding: 20px 22px 24px; display: grid; gap: 18px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--teal); font-weight: 600; word-break: break-word; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { direction: ltr; font-size: 13.5px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

.app-footer { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); font-size: 13.5px; }
.app-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; }
.app-footer a { color: var(--muted); }

/* privacy page */
.doc { max-width: 760px; }
.doc h2 { font-size: 1.3rem; margin-top: 28px; scroll-margin-top: 84px; }
.doc h2:target { background: var(--cream); border-radius: 10px; padding: 6px 12px; margin-inline: -12px; }   /* a clause opened from /about */
.doc p, .doc li { color: var(--text); margin-top: 8px; }
.doc ul { padding-inline-start: 22px; margin: 8px 0 0; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.has-requests > :last-child { order: -1; }   /* returning students see their requests first */
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .app-header .container { height: 62px; gap: 10px; }
  .logo .logo-mark { width: 101px; height: 35.3px; }
  .card { padding: 22px 18px; }
  .form-2 { grid-template-columns: 1fr; }
  .auth { padding-top: 24px; }
  .auth h1 { font-size: 1.7rem; }
  /* admin tables become stacked cards */
  .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; }
  .table-wrap.cards thead { display: none; }
  .table-wrap.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-wrap.cards td { border: 0; padding: 3px 0; }
  .table-wrap.cards td[data-th]::before { content: attr(data-th); display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
}

/* A consistent tactile finish, with restrained depth and a clear keyboard state. */
.btn { min-height: 46px; border-width: 1px; border-radius: 14px; padding: 12px 24px; line-height: 1.5; text-align: center; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.btn-primary { background: linear-gradient(180deg, #10554b, #073f39); color: #fff; border-color: #073f39; box-shadow: inset 0 1px rgba(255,255,255,.15), 0 4px 7px -3px rgba(7,63,57,.25), 0 10px 20px -14px rgba(7,63,57,.45); }
.btn-primary:hover { background: linear-gradient(180deg, #176354, #094d43); box-shadow: inset 0 1px rgba(255,255,255,.18), 0 7px 16px -7px rgba(7,63,57,.4); }
.btn-outline { background: #fff; border-color: var(--field-border); color: var(--forest); box-shadow: 0 2px 3px rgba(7,63,57,.035); }
.btn-outline:hover { background: var(--cream); color: var(--forest); border-color: #7fae93; }
.btn-light { background: var(--mint); color: var(--forest); border-color: var(--mint); box-shadow: inset 0 1px rgba(255,255,255,.45), 0 4px 10px rgba(0,0,0,.08); }
.btn-light:hover { background: #d9f3e3; color: var(--forest); }
.btn-sm { min-height: 40px; padding: 9px 16px; border-radius: 11px; font-size: 14px; }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(7,63,57,.12); }
.btn:disabled { transform: none; }
.lang-btn { min-height: 44px; border-width: 1px; background: #fff; border-color: var(--line); }
:focus-visible { outline: 3px solid #9a691f; outline-offset: 4px; }
.skip-link { position: fixed; inset-block-start: 12px; inset-inline-start: 16px; z-index: 100; padding: 12px 20px; border-radius: 12px; background: var(--forest); color: #fff; transform: translateY(-180%); text-decoration: none; }
.skip-link:focus { transform: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .btn:hover:not(:disabled) { transform: translateY(-1px); } }
@media (max-width: 480px) { .btn { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* Public pages, forms and policy reading. */
.app-header { background: #fff; box-shadow: 0 2px 12px rgba(7,63,57,.025); }
.head-link { padding-block: 10px; }
.card { border-radius: 22px; box-shadow: var(--shadow-sm); }
.auth { background: radial-gradient(ellipse at 50% 0, #e7f5ed, transparent 65%); padding-block: 48px 64px; }
.auth .card { padding: 36px; border-top: 3px solid var(--mint); }
.auth h1 { text-wrap: balance; }
input, select, textarea { background: #fbfdfb; border-width: 1px; border-color: var(--field-border); border-radius: 12px; min-height: 48px; }
input::placeholder, textarea::placeholder { color: #63786d; opacity: 1; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
.pw-toggle { min-height: 40px; min-width: 44px; }
.alert { border: 1px solid rgba(163,49,42,.14); line-height: 1.7; }
.alert.info { border-color: var(--line); }
.chips button { min-height: 40px; }
.chips button[aria-pressed="true"] { background: var(--mint); color: var(--forest); border-color: var(--forest); }
.doc { max-width: 820px; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.doc h2 { padding-top: 26px; margin-top: 30px; border-top: 1px solid var(--line); font-size: 1.4rem; line-height: 1.5; }
.doc h2:target { background: var(--amber-bg); padding: 12px 16px; margin-inline: -16px; border-top-color: transparent; }
.doc li { padding-inline-start: 4px; margin-top: 12px; line-height: 1.9; }
.doc a { text-underline-offset: 4px; overflow-wrap: anywhere; }
.doc-toc { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); padding: 14px 18px; }
.doc-toc summary { cursor: pointer; color: var(--forest); font-weight: 700; padding-block: 4px; }
.doc-toc nav { display: grid; gap: 4px; margin-top: 12px; }
.doc-toc a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14px; text-decoration: none; }
.doc-toc a:hover { background: var(--sage); }
.app-footer { background: #fff; line-height: 1.8; }
.app-footer a { text-underline-offset: 4px; padding-block: 8px; }
@media (max-width: 640px) { .page { padding-block: 24px 40px; } .auth .card { padding: 28px 20px; } .doc { width: calc(100% - 24px); padding: 24px 20px; border-radius: 18px; } .doc h2 { font-size: 1.25rem; } }
