/* ============================================================
   Ms. Noor — account pages (sign in, create account, password)
   Served by the ABP host. Tokens and layout are ported from the
   UI prototype (docs/prototypes/ms-noor-ui: app/globals.css and
   components/Login/*.module.css) so these pages read as the same
   product as apps/web. Keep the two in step.
   ============================================================ */

:root {
  --bg: #F6F3FC;
  --surface: #FFFFFF;
  --surface-2: #F0EBFA;
  --surface-3: #E7E0F7;
  --ink: #211B33;
  --ink-2: #564C70;
  --ink-3: #8A80A6;
  --line: #E2DAF2;
  --line-strong: #CFC3EA;
  --violet: #6B46E5;
  --violet-ink: #4B2CBF;
  --violet-soft: #EDE7FF;
  --violet-grad-end: #B06CE8;
  --coral: #E8523C;
  --coral-soft: #FDE7E3;
  --mint: #0E9E79;
  --mint-soft: #DAF5EC;
  --amber: #B2720A;
  --amber-soft: #FCEFD6;
  --on-accent: #FFFFFF;
  --shadow: 0 1px 2px rgba(33, 27, 51, .06), 0 8px 24px -12px rgba(75, 44, 191, .22);
  --radius: 14px;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --av-bg: #EFE9FF;
  --av-hair: #3B2418;
  --av-hair-shine: #5A3826;
  --av-skin: #F3CDB4;
  --av-skin-line: #D9A183;
  --av-eye: #FFFFFF;
  --av-pupil: #2B1C42;
  --av-mouth: #C9606F;
  --av-cheek: #F0948A;
  --av-body: #6B46E5;
  --av-collar: #FFFFFF;
  --av-glass: #6B46E5;

  color-scheme: light;
}

:root[lang="ar"] {
  --font-display: 'Cairo', system-ui, sans-serif;
  --font-body: 'Cairo', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141024;
    --surface: #1D1832;
    --surface-2: #262041;
    --surface-3: #302850;
    --ink: #F0EBFC;
    --ink-2: #B7ACD4;
    --ink-3: #8378A3;
    --line: #332B52;
    --line-strong: #463B6B;
    --violet: #A186FF;
    --violet-ink: #C4B2FF;
    --violet-soft: #2C2352;
    --coral: #FF8E7A;
    --coral-soft: #3A2119;
    --mint: #3FDCB0;
    --mint-soft: #12352C;
    --amber: #F0B44E;
    --amber-soft: #3A2C12;
    --on-accent: #160F2B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
  text-wrap: balance;
}

p { margin: 0; }
a { color: var(--violet-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2.5px solid var(--violet);
  outline-offset: 2px;
  border-radius: 6px;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- page + top bar ---------- */
/* the copyright line at the bottom of the page */
/* the staging server's testing notice (decision 0051) */
.acc-testing { margin: 0 0 12px; padding: 9px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--ink); font-size: 13px; font-weight: 500; text-align: center; }
.acc-footer { margin-block-start: auto; padding-block-start: 14px; border-block-start: 1px solid var(--line); text-align: center; font-size: 12px; color: var(--ink-3); }
.acc-page {
  min-height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block-end: 32px;
  display: flex;
  flex-direction: column;
}

.acc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
  border-block-end: 1px solid var(--line);
}

.acc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }

.acc-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
  background: linear-gradient(145deg, var(--violet), var(--violet-grad-end));
  display: grid;
  place-items: center;
  color: #FFFFFF;
  font-family: 'Cairo', system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.acc-name { font-family: var(--font-display); font-size: 18px; display: block; line-height: 1.2; }

.acc-tag {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* language switch: the prototype's segmented control, as links */
.acc-seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line);
}
.acc-seg a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  text-decoration: none;
}
.acc-seg a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ---------- two-column shell ---------- */
.acc-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 20px;
  align-items: stretch;
  padding-block-start: 20px;
}

/* ---------- Ms. Noor's stage ---------- */
.acc-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--violet-soft);
  border: 1px solid var(--line);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  isolation: isolate;
}

.acc-hero { display: flex; align-items: center; gap: 16px; }

.acc-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  flex: none;
  overflow: hidden;
  background: var(--av-bg);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 3px var(--violet);
}

.acc-app-title { font-size: 40px; line-height: 1.05; letter-spacing: -.01em; }
.acc-app-sub { font-size: 15px; color: var(--violet-ink); font-weight: 500; margin-block-start: 4px; }
.acc-tagline { font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }

.acc-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
}

.acc-feature {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  min-width: 0;
}
.acc-feature > span { padding-inline: 6px; }

.acc-curricula { margin-block-start: auto; font-size: 12px; color: var(--ink-3); }

/* ---------- form card ---------- */
.acc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}

.acc-title { font-size: 26px; }
.acc-sub { font-size: 14px; color: var(--ink-2); margin-block-start: -10px; }

/* role choice: two large radio tiles */
.acc-roles {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.acc-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.acc-role:hover { border-color: var(--line-strong); color: var(--ink); }
.acc-role:has(input:checked),
.acc-role:has(input:checked):hover {
  border-color: var(--violet);
  background: var(--violet-soft);
  color: var(--violet-ink);
}
.acc-role:has(input:focus-visible) { outline: 2.5px solid var(--violet); outline-offset: 2px; }
.acc-role-icon { font-size: 18px; line-height: 1; }

/* the hint under the role tiles follows the selected tile */
.acc-role-hint { font-size: 12.5px; color: var(--ink-2); margin-block-start: -6px; }
.acc-role-hint [data-for] { display: none; }
.acc-form:has(input[value="student"]:checked) .acc-role-hint [data-for="student"],
.acc-form:has(input[value="parent"]:checked) .acc-role-hint [data-for="parent"] { display: inline; }

.acc-form { display: flex; flex-direction: column; gap: 14px; }
.acc-field { display: flex; flex-direction: column; gap: 6px; }
.acc-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.acc-label { font-size: 13px; font-weight: 500; color: var(--ink); padding: 0; }

.acc-input,
.form-control,
.form-select {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.acc-input::placeholder, .form-control::placeholder { color: var(--ink-3); }
.acc-input:focus, .form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.acc-input.input-validation-error,
.form-control.input-validation-error { border-color: var(--coral); }
.acc-input.input-validation-error:focus,
.form-control.input-validation-error:focus { box-shadow: 0 0 0 3px var(--coral-soft); }

/* input and Show button share one grid cell, so anything added after them (hints) can't stretch the button */
.acc-pw { display: grid; }
.acc-pw > .acc-input { grid-area: 1 / 1; padding-inline-end: 70px; }
.acc-reveal {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: stretch;
  margin: 5px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
}
.acc-reveal:hover { color: var(--violet-ink); }

.acc-hint { font-size: 12px; color: var(--ink-3); }
.acc-warn { font-size: 12.5px; color: var(--amber); }
.acc-warn[hidden] { display: none; }

/* jQuery unobtrusive validation messages */
.field-validation-error,
.text-danger { font-size: 12.5px; color: var(--coral); font-weight: 500; }
.field-validation-valid { display: none; }
.validation-summary-valid { display: none; }

.acc-link {
  color: var(--violet-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.acc-link:hover { text-decoration: underline; }

.acc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.acc-check input { accent-color: var(--violet); width: 17px; height: 17px; margin: 0; }

.acc-btn,
.btn-primary {
  border: 0;
  background: var(--violet);
  color: var(--on-accent);
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.acc-btn:hover, .btn-primary:hover { background: var(--violet-ink); }
.acc-btn:disabled, .btn-primary:disabled {
  background: var(--surface-3);
  color: var(--ink-3);
  box-shadow: none;
  cursor: not-allowed;
}
.acc-submit { width: 100%; padding-block: 13px; font-size: 15px; }

.btn-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--surface-2); }

.acc-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
}
.acc-divider::before,
.acc-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.acc-sso { display: flex; flex-direction: column; gap: 8px; }
.acc-sso-btn {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
}
.acc-sso-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }

.acc-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
  font-size: 13.5px;
}
.acc-legal { font-size: 11.5px; color: var(--ink-3); }

/* ---------- alerts (ABP page alerts and Bootstrap .alert) ---------- */
.acc-alerts { display: flex; flex-direction: column; gap: 8px; }
.alert {
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  margin: 0;
}
.alert-danger { background: var(--coral-soft); color: var(--coral); }
.alert-warning { background: var(--amber-soft); color: var(--amber); }
.alert-success { background: var(--mint-soft); color: var(--mint); }
.alert-info, .alert-primary { background: var(--violet-soft); color: var(--violet-ink); }
.alert-heading { font-size: 15px; margin-block-end: 4px; }

/* ---------- other ABP account pages (Bootstrap markup) ----------
   Forgot / reset password, logged out, etc. keep ABP's markup;
   these rules give it the same look as the custom pages. */
.acc-card .card { background: none; border: 0; box-shadow: none; margin: 0 !important; }
.acc-card .card-body { padding: 0 !important; display: flex; flex-direction: column; gap: 14px; }
.acc-card .card-body > h4, .acc-card .card-body > h1 { font-size: 26px; }
.acc-card form { display: flex; flex-direction: column; gap: 14px; margin: 0 !important; }
.acc-card .mb-3, .acc-card .mb-4 { display: flex; flex-direction: column; gap: 6px; margin: 0 !important; }
.acc-card .form-label { font-size: 13px; font-weight: 500; }
.acc-card .form-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.acc-card .form-check-input { accent-color: var(--violet); width: 17px; height: 17px; margin: 0; }
.acc-card .d-grid { display: grid; gap: 8px; }
.acc-card .btn-lg { padding-block: 13px; font-size: 15px; width: 100%; }
.acc-card .mt-2, .acc-card .mt-3, .acc-card .mt-4 { margin-block-start: 0 !important; }
.acc-card .text-decoration-none { text-decoration: none; }
.acc-card .text-muted { color: var(--ink-3); }

/* ---------- Ms. Noor avatar (static pose of the prototype's rig) ---------- */
.av svg { display: block; width: 100%; height: 100%; }
.av-bg { fill: var(--av-bg); }
.av-hair { fill: var(--av-hair); }
.av-skin { fill: var(--av-skin); }
.av-eye { fill: var(--av-eye); }
.av-pupil { fill: var(--av-pupil); }
.av-mouth { fill: var(--av-mouth); }
.av-body { fill: var(--av-body); }
.av-brow { fill: none; stroke: var(--av-hair); stroke-width: 1.9; stroke-linecap: round; }
.av-shine { fill: none; stroke: var(--av-hair-shine); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.av-collar { fill: var(--av-collar); opacity: .9; }
.av-liner { fill: none; stroke: var(--av-pupil); stroke-width: 1.2; stroke-linecap: round; }
.av-lens { fill: rgba(255, 255, 255, .18); stroke: var(--av-glass); stroke-width: 1.7; }
.av-frame { fill: none; stroke: var(--av-glass); stroke-width: 1.7; stroke-linecap: round; }
.av-glint { fill: var(--av-eye); }
.av-lips { fill: var(--av-mouth); stroke: var(--av-mouth); stroke-width: 1.2; stroke-linejoin: round; }
.av-nose { fill: none; stroke: var(--av-skin-line); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.av-cheek { fill: var(--av-cheek); opacity: .45; }

/* ---------- feature drawings ---------- */
.art { display: block; width: 100%; height: auto; }
.art-diagram { width: 100%; aspect-ratio: 168 / 112; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--surface); }
.art-diagram .geo { width: 72%; direction: ltr; display: block; height: auto; }

.art-paper { fill: var(--surface); }
.art-ink { fill: var(--ink-3); opacity: .55; }
.art-row-ok { fill: var(--mint-soft); }
.art-row-bad { fill: var(--coral-soft); }
.art-tick, .art-cross { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.art-tick { stroke: var(--mint); }
.art-cross { stroke: var(--coral); }
.art-code-ok { fill: var(--surface); stroke: var(--mint); stroke-width: 1; }
.art-code-bad { fill: var(--surface); stroke: var(--coral); stroke-width: 1; }
.art-code-text-ok, .art-code-text-bad { font-family: var(--font-mono); font-size: 9px; font-weight: 500; text-anchor: middle; }
.art-code-text-ok { fill: var(--mint); }
.art-code-text-bad { fill: var(--coral); }

.art-cell-done { fill: var(--violet); opacity: .85; }
.art-cell-today { fill: var(--surface); stroke: var(--violet); stroke-width: 2; }
.art-cell-learn { fill: var(--mint-soft); stroke: var(--mint); stroke-width: .8; }
.art-cell-revise { fill: var(--amber-soft); stroke: var(--amber); stroke-width: .8; }
.art-cell-mock { fill: var(--coral); }
.art-cell-sprint { fill: var(--coral-soft); stroke: var(--coral); stroke-width: .8; }
.art-ring-track { fill: none; stroke: var(--surface-3); stroke-width: 6; }
.art-ring-value { fill: none; stroke: var(--mint); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 72 100; }
.art-flag-pole { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.art-flag { fill: var(--coral); }

.art-bubble-in { fill: var(--surface-2); }
.art-wave { fill: var(--violet); }
.art-bubble-out { fill: var(--violet); }
.art-line-out { fill: var(--on-accent); opacity: .7; }
.art-mic { fill: var(--coral-soft); }
.art-mic-icon { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linecap: round; }

/* geometry engine output (classes prefixed geo-) */
.geo-ring { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.geo-seg, .geo-arc { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.geo-dot { fill: var(--ink); }
.geo-dash { stroke-dasharray: 5 4; }
.geo-s_ink { stroke: var(--ink-2); }
.geo-s_v { stroke: var(--violet); }
.geo-s_c { stroke: var(--coral); }
.geo-w17 { stroke-width: 1.7; }
.geo-w20 { stroke-width: 2; }
.geo-w26 { stroke-width: 2.6; }
.geo-w27 { stroke-width: 2.7; }
.geo-txt {
  font-family: 'Lexend', system-ui, sans-serif;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.geo-tPt { font-size: 14.5px; fill: var(--ink); }
.geo-tAng { font-size: 13px; }
.geo-f_v { fill: var(--violet); }
.geo-f_c { fill: var(--coral); }
.geo-mid { text-anchor: middle; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .acc-shell { grid-template-columns: minmax(0, 1fr); align-content: start; max-width: 560px; width: 100%; margin-inline: auto; }
  .acc-stage { padding: 22px; gap: 16px; order: 1; }
  .acc-card { order: 2; }
  .acc-app-title { font-size: 32px; }
  .acc-tagline { font-size: 15.5px; }
  .acc-features { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; gap: 8px; }
  .acc-feature { font-size: 12px; padding: 6px 6px 10px; gap: 8px; }
  .acc-curricula { display: none; }
}

@media (max-width: 560px) {
  .acc-tag { display: none; }
  .acc-stage { padding: 18px; }
  .acc-avatar { width: 60px; height: 60px; border-radius: 16px; }
  .acc-app-title { font-size: 26px; }
  .acc-app-sub { font-size: 13.5px; }
  .acc-tagline { font-size: 14px; }
  .acc-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-card { padding: 20px; }
  .acc-title { font-size: 23px; }
}
