/* ==========================================================================
   styles.css — design tokens + auth pages (login, register, dashboard shell)
   Light & dark themes, fully responsive.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Author display rules must never defeat the `hidden` attribute. */
[hidden] { display: none !important; }

:root {
  --bg: #f4f7fc;
  --bg-soft: #e9eef8;
  --card: #ffffff;
  --card-2: #fbfcfe;
  --card-3: #f3f6fc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #6b7793;
  --faint: #9aa8c2;
  --line: #e6ebf3;
  --line-strong: #cbd7ea;
  --accent: #3b6ef6;
  --accent-2: #7b61ff;
  --accent-dark: #2a55d0;
  --accent-soft: #eef3ff;
  --on-accent: #ffffff;
  --danger: #e5484d;
  --danger-soft: #fff5f5;
  --danger-line: #fed7d7;
  --ok: #12a150;
  --ok-soft: #f0fdf4;
  --ok-line: #bbf7d0;
  --warn: #8a5a00;
  --warn-soft: #fff8e6;
  --warn-line: #ffe2a8;
  --ring: rgba(59, 110, 246, .18);
  --blob-1: #bcd2ff;
  --blob-2: #e2d8ff;
  --blob-3: #d8f0ff;
  --radius: 26px;
  --shadow-lg: 0 34px 70px -34px rgba(20, 38, 80, .38), 0 8px 20px -12px rgba(20, 38, 80, .14);
  --shadow-md: 0 12px 32px -22px rgba(20, 38, 80, .4);
  --shadow-brand: rgba(59, 110, 246, .8);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0e1728;
  --card: #131c30;
  --card-2: #182238;
  --card-3: #1d2842;
  --ink: #eef2fb;
  --ink-soft: #c3cddf;
  --muted: #8b98b3;
  --faint: #6b7896;
  --line: #22304a;
  --line-strong: #33425f;
  --accent: #5c8cff;
  --accent-2: #9c86ff;
  --accent-dark: #7ea6ff;
  --accent-soft: #1c2942;
  --on-accent: #0b1220;
  --danger: #ff6b6f;
  --danger-soft: #2a1620;
  --danger-line: #4a2430;
  --ok: #34d07d;
  --ok-soft: #12291f;
  --ok-line: #1e4433;
  --warn: #ffd48a;
  --warn-soft: #2a2113;
  --warn-line: #4a3a1c;
  --ring: rgba(92, 140, 255, .28);
  --blob-1: #1b2f5e;
  --blob-2: #2a2354;
  --blob-3: #123049;
  --shadow-lg: 0 34px 70px -34px rgba(0, 0, 0, .8), 0 8px 20px -12px rgba(0, 0, 0, .55);
  --shadow-md: 0 14px 34px -22px rgba(0, 0, 0, .8);
  --shadow-brand: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

/* ---------- decorative background ---------- */
.decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.blob-1 { width: min(46vw, 520px); aspect-ratio: 1; top: -14%; right: -10%;
  background: radial-gradient(circle at 30% 30%, var(--blob-1) 0%, transparent 72%); }
.blob-2 { width: min(40vw, 460px); aspect-ratio: 1; bottom: -16%; left: -12%;
  background: radial-gradient(circle at 60% 40%, var(--blob-2) 0%, transparent 72%); }
.blob-3 { width: min(26vw, 300px); aspect-ratio: 1; top: 42%; left: 46%;
  background: radial-gradient(circle at 50% 50%, var(--blob-3) 0%, transparent 70%); opacity: .4; }
[data-theme="dark"] .blob { opacity: .42; }

/* ---------- layout ---------- */
.page {
  position: relative; z-index: 1; flex: 1; width: 100%;
  max-width: 1080px; margin: 0 auto;
  padding: clamp(16px, 4vw, 48px) clamp(14px, 4vw, 32px);
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(16px, 2.5vw, 26px);
}
.page.wide { max-width: 1180px; }

.card {
  display: grid; grid-template-columns: 1.02fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise .6s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- brand panel ---------- */
.brand {
  position: relative; padding: clamp(26px, 3.6vw, 46px);
  color: #fff; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #2f5df0 0%, #3b6ef6 38%, #7b61ff 100%);
  overflow: hidden;
}
[data-theme="dark"] .brand { background: linear-gradient(150deg, #1d3fa8 0%, #2b52c9 40%, #5a44c9 100%); }
.brand::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  top: -130px; right: -110px; background: rgba(255, 255, 255, .13); }
.brand::after { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  bottom: -110px; left: -80px; background: rgba(255, 255, 255, .09); }
.brand > * { position: relative; z-index: 1; }

.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 16px; letter-spacing: -.2px; color: #fff; }
.logo-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .32); backdrop-filter: blur(6px); flex: 0 0 auto; }
.logo-mark svg { width: 22px; height: 22px; fill: #fff; }

.brand-mid { margin: auto 0; padding: clamp(26px, 4vw, 44px) 0 24px; }
.brand-mid h1 { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15;
  font-weight: 800; letter-spacing: -.9px; }
.brand-mid p { margin: 0; font-size: clamp(14px, 1.4vw, 15.5px); line-height: 1.65;
  color: rgba(255, 255, 255, .86); max-width: 36ch; }

.features { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 13px; }
.features li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: rgba(255, 255, 255, .95); }
.tick { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3); }
.tick svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.brand-foot { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

/* ---------- form panel ---------- */
.form-panel { padding: clamp(24px, 3.6vw, 48px) clamp(22px, 3.4vw, 50px); display: flex; flex-direction: column; justify-content: center; }
.form-head { margin-bottom: clamp(18px, 2.4vw, 26px); }
.form-head h2 { margin: 0 0 8px; font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; letter-spacing: -.6px; }
.form-head p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

form { display: grid; gap: clamp(13px, 1.7vw, 17px); }
.field { display: grid; gap: 8px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: .1px; }

.control { position: relative; display: flex; align-items: center; }
.control .icon { position: absolute; left: 16px; display: grid; place-items: center; pointer-events: none;
  color: var(--faint); transition: color .2s ease; }
.control .icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"] {
  width: 100%; height: 54px; padding: 0 16px 0 46px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--card-2); border: 1.5px solid var(--line); border-radius: 14px;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s ease, box-shadow .22s ease, background .2s ease;
}
input::placeholder { color: var(--faint); }
input:hover { border-color: var(--line-strong); }
input:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.control:focus-within .icon { color: var(--accent); }
input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 40px var(--card-2) inset; }

/* select mirrors the text inputs (used by the Morocco city picker) */
.control select {
  width: 100%; height: 54px; padding: 0 40px 0 46px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--card-2); border: 1.5px solid var(--line); border-radius: 14px;
  outline: none; -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color .2s ease, box-shadow .22s ease, background .2s ease;
}
.control select:hover { border-color: var(--line-strong); }
.control select:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.control select:invalid, .control select option[value=""] { color: var(--faint); }
.control select option { color: var(--ink); }
.control .chev { position: absolute; right: 15px; display: grid; place-items: center; pointer-events: none;
  color: var(--faint); transition: color .2s ease; }
.control .chev svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.control:focus-within .chev { color: var(--accent); }
.field.invalid select { border-color: var(--danger); background: var(--danger-soft); }

.has-toggle input { padding-right: 52px; }
.toggle { position: absolute; right: 8px; width: 40px; height: 40px; border: 0; background: transparent;
  border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: var(--faint);
  transition: background .18s ease, color .18s ease; }
.toggle:hover { background: var(--accent-soft); color: var(--accent); }
.toggle svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }

.link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; transition: color .18s ease; }
.link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- role selector ---------- */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.role { position: relative; display: block; cursor: pointer; }
.role input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-body {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 16px 12px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--card-2); transition: all .2s ease;
}
.role-body .role-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--card-3); transition: all .2s ease; }
.role-body .role-icon svg { width: 21px; height: 21px; stroke: var(--muted); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s ease; }
.role-name { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.role-blurb { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.role:hover .role-body { border-color: var(--line-strong); }
.role input:checked + .role-body {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--ring);
}
.role input:checked + .role-body .role-icon { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.role input:checked + .role-body .role-icon svg { stroke: #fff; }
.role input:focus-visible + .role-body { box-shadow: 0 0 0 4px var(--ring); }
.roles.invalid .role-body { border-color: var(--danger); }

/* ---------- licence document upload ---------- */
.doc-drop { border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--card-2);
  padding: 16px; transition: border-color .2s ease, background .2s ease; }
.doc-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.doc-drop.filled { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.doc-drop.invalid { border-color: var(--danger); background: var(--danger-soft); }

.doc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.doc-filled { display: flex; align-items: center; gap: 12px; }

.doc-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--card-3); color: var(--muted); flex: 0 0 auto; }
.doc-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.doc-ico.ok { background: var(--ok-soft); color: var(--ok); }
.doc-thumb { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--line); }

.doc-name { font-size: 13.5px; font-weight: 700; }
.doc-help { font-size: 12px; color: var(--muted); line-height: 1.5; max-width: 40ch; }
.doc-accept { font-size: 11px; color: var(--faint); }
.doc-file { flex: 1 1 auto; min-width: 0; }
.doc-file strong { display: block; font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.doc-file span { font-size: 12px; color: var(--muted); }
.doc-x { width: 34px; height: 34px; border-radius: 11px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.doc-x:hover { background: var(--danger-soft); color: var(--danger); }
.doc-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- inline validation ---------- */
.err { display: none; align-items: flex-start; gap: 6px; font-size: 12.5px; font-weight: 500;
  color: var(--danger); line-height: 1.4; }
.err svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; stroke: currentColor;
  fill: none; stroke-width: 2.2; stroke-linecap: round; }
.field.invalid .err { display: flex; }
.field.invalid input { border-color: var(--danger); background: var(--danger-soft); }
.field.invalid input:focus { box-shadow: 0 0 0 4px rgba(229, 72, 77, .15); }
.field.invalid .control .icon { color: var(--danger); }

/* ---------- password strength ---------- */
.strength { display: grid; gap: 7px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.meter i { height: 5px; border-radius: 99px; background: var(--line); transition: background .28s ease; }
.strength-text { font-size: 12px; color: var(--muted); }
.strength[data-score="1"] .meter i:nth-child(-n+1) { background: #e5484d; }
.strength[data-score="2"] .meter i:nth-child(-n+2) { background: #f5a524; }
.strength[data-score="3"] .meter i:nth-child(-n+3) { background: #46a758; }
.strength[data-score="4"] .meter i { background: var(--ok); }
.strength[data-score="1"] .strength-text { color: #e5484d; }
.strength[data-score="2"] .strength-text { color: #b7791f; }
.strength[data-score="3"] .strength-text { color: #2f855a; }
.strength[data-score="4"] .strength-text { color: var(--ok); }
[data-theme="dark"] .strength[data-score="2"] .strength-text { color: #f0b53f; }
[data-theme="dark"] .strength[data-score="3"] .strength-text { color: #5ec27f; }

/* ---------- alerts ---------- */
.alert { display: none; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: 13px;
  font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.alert.show { display: flex; }
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; stroke: currentColor; fill: none;
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.alert-success { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }

/* ---------- checkbox ---------- */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-soft);
  cursor: pointer; user-select: none; line-height: 1.5; position: relative; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.box { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px; border: 1.5px solid var(--line-strong);
  background: var(--card); display: grid; place-items: center; transition: all .18s ease; margin-top: 1px; }
.box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round;
  stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: all .18s ease; }
.check input:checked + .box { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--ring); }
.check a { color: var(--accent); font-weight: 600; text-decoration: none; }
.check a:hover { text-decoration: underline; }
.check.invalid .box { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(229, 72, 77, .13); }

/* ---------- buttons ---------- */
.actions { display: grid; gap: 12px; margin-top: 4px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; border: 0; border-radius: 14px;
  font-family: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: .1px;
  cursor: pointer; overflow: hidden; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(.3, .8, .4, 1), box-shadow .26s ease, background .22s ease, border-color .22s ease, color .22s ease;
}
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .22s ease; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn:active { transform: translateY(0) scale(.988); }
.btn[disabled] { opacity: .7; cursor: not-allowed; transform: none; }

.btn-primary { color: #fff; background: linear-gradient(135deg, #3b6ef6 0%, #7b61ff 100%);
  box-shadow: 0 16px 30px -14px var(--shadow-brand), 0 4px 10px -6px rgba(123, 97, 255, .5); }
.btn-primary:hover:not([disabled]) { transform: translateY(-2px);
  box-shadow: 0 24px 40px -16px var(--shadow-brand), 0 6px 14px -8px rgba(123, 97, 255, .6); }
.btn-primary:hover:not([disabled]) svg { transform: translateX(3px); }
.btn-primary::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .4) 46%, transparent 72%);
  transform: translateX(-130%); transition: transform .8s cubic-bezier(.3, .7, .4, 1); }
.btn-primary:hover:not([disabled])::after { transform: translateX(130%); }

.btn-ghost { background: var(--card); color: var(--ink-soft); border: 1.5px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); height: 52px; font-weight: 600; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--card-3); color: var(--ink); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1.5px solid var(--danger-line); height: 48px; font-size: 14.5px; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.spinner { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; animation: spin .7s linear infinite; display: none; }
.btn.loading .spinner { display: block; }
.btn.loading .btn-label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.hint em { font-style: normal; color: var(--accent); font-weight: 600; }

/* ---------- language + theme switches ---------- */
.switches { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }

.lang-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--card-3);
  border: 1px solid var(--line); border-radius: 11px; }
.lang-switch button {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--muted);
  padding: 6px 11px; border-radius: 8px; transition: all .18s ease; text-transform: uppercase;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.theme-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-3); cursor: pointer; display: grid; place-items: center; color: var(--muted);
  transition: all .18s ease; }
.theme-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.theme-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }
[data-theme="light"] .theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-moon { display: block; }

/* ---------- subscription badge ---------- */
.sub-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800;
  letter-spacing: .3px; padding: 4px 10px; border-radius: 99px; vertical-align: middle; }
.sub-badge svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; }
.sub-badge.on { background: var(--ok-soft); color: var(--ok); }
.sub-badge.off { background: var(--danger-soft); color: var(--danger); }

/* ---------- generic avatars ---------- */
.avatar, .avatar-md, .avatar-lg, .avatar-xl, .avatar-sm,
.avatar-md-fallback, .avatar-lg-fallback, .avatar-xl-fallback, .avatar-sm-fallback {
  object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, #3b6ef6, #7b61ff); flex: 0 0 auto;
}
.avatar-md-fallback.alt, .avatar-lg-fallback.alt, .avatar-xl-fallback.alt, .avatar-sm-fallback.alt {
  background: linear-gradient(135deg, #f2994a, #eb5757);
}
.avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
.avatar-sm, .avatar-sm-fallback { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; }
.avatar-md, .avatar-md-fallback { width: 48px; height: 48px; border-radius: 15px; font-size: 16px; }
.avatar-lg, .avatar-lg-fallback { width: 84px; height: 84px; border-radius: 26px; font-size: 27px; }
.avatar-xl, .avatar-xl-fallback { width: 110px; height: 110px; border-radius: 32px; font-size: 36px; }

/* ---------- footer ---------- */
.page-footer { text-align: center; font-size: 12.5px; color: var(--faint); line-height: 1.7; padding-bottom: 4px; }
.page-footer a { color: var(--muted); font-weight: 600; text-decoration: none; }
.page-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- tablet ---------- */
@media (max-width: 920px) {
  .card { grid-template-columns: 1fr; border-radius: 22px; }
  .brand { padding: 24px 26px 26px; }
  .brand::before { width: 240px; height: 240px; top: -120px; right: -90px; }
  .brand::after { display: none; }
  .brand-mid { margin: 18px 0 0; padding: 0; }
  .brand-mid h1 { font-size: clamp(22px, 4.6vw, 28px); margin-bottom: 8px; }
  .brand-mid p { max-width: 52ch; font-size: 14px; }
  .features, .brand-foot { display: none; }
  .form-panel { padding: 24px 26px 30px; }
  .switches { margin-bottom: 14px; }
}

/* ---------- phone ---------- */
@media (max-width: 560px) {
  :root { --radius: 20px; }
  .page { padding: 14px 12px 22px; }
  .brand { padding: 20px 20px 22px; }
  .logo-mark { width: 38px; height: 38px; border-radius: 11px; }
  .form-panel { padding: 22px 20px 26px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"] { height: 52px; font-size: 16px; }
  .btn { height: 52px; font-size: 15px; }
  .btn-ghost { height: 50px; }
  .form-head h2 { font-size: 22px; }
  .hint { font-size: 12.5px; }
  .roles { gap: 9px; }
  .role-body { padding: 13px 9px; border-radius: 14px; }
  .role-blurb { display: none; }
  .role-body .role-icon { width: 36px; height: 36px; }
}

@media (max-width: 360px) {
  .form-panel { padding: 20px 16px 22px; }
  .brand { padding: 18px 16px 20px; }
  .roles { grid-template-columns: 1fr; }
}

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


/* ==========================================================================
   RTL — Arabic support. Applies when <html dir="rtl">.
   A few flex rows and paddings are mirrored; text alignment follows dir.
   ========================================================================== */
html[dir="rtl"] body { font-family: 'Cairo', 'Noto Kufi Arabic', 'Segoe UI', Tahoma, 'Inter', sans-serif; }
html[dir="rtl"] .hdr-inner,
html[dir="rtl"] .appbar,
html[dir="rtl"] .appbar-brand,
html[dir="rtl"] .appbar-actions,
html[dir="rtl"] .hdr-actions,
html[dir="rtl"] .hdr-logo,
html[dir="rtl"] .pcard-seller,
html[dir="rtl"] .pcard-foot,
html[dir="rtl"] .pcard-meta,
html[dir="rtl"] .ftr-links,
html[dir="rtl"] .me-chip,
html[dir="rtl"] .role-body { flex-direction: row-reverse; }
html[dir="rtl"] .sec-head,
html[dir="rtl"] .cta-band,
html[dir="rtl"] .hero-search { flex-direction: row-reverse; }
html[dir="rtl"] ul, html[dir="rtl"] ol { padding-right: 1.1em; padding-left: 0; }
html[dir="rtl"] .hdr-nav { flex-direction: row-reverse; }
html[dir="rtl"] .lang-switch { direction: ltr; }
html[dir="rtl"] .pcard-badge { left: auto; right: 12px; }
html[dir="rtl"] .verif-text, html[dir="rtl"] .paywall-text { text-align: right; }
html[dir="rtl"] .toast { text-align: right; }
html[dir="rtl"] input, html[dir="rtl"] textarea, html[dir="rtl"] select { text-align: right; }
html[dir="rtl"] .hero-title, html[dir="rtl"] .hero-sub, html[dir="rtl"] .hero-kicker { text-align: right; }


/* ---------- Google auth + role grid ---------- */
.roles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; border-radius: 14px; text-decoration: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-strong);
  font-weight: 700; font-size: 14.5px; transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-google:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.btn-google svg { width: 20px; height: 20px; }
