/* ============================================================
   باص الشاطر — Shater Bus v2 · Auth (login) surface
   Shared by admin & school login. Same tokens as the dashboard
   (shaterbus.css). Arabic-first / RTL-native, logical properties,
   zero framework dependencies. Deliberately single (light) theme:
   a dark petrol brand panel beside a light form panel.
   ============================================================ */

:root {
  --petrol: #1b4459;
  --petrol-deep: #133648;
  --mint: #5bbe93;
  --mint-deep: #1f7a55;
  --mint-soft: #e2f2ea;

  --bg: #f7faf9;
  --card: #ffffff;
  --ink: #1c3a49;
  --muted: #5e7480;
  --line: #e0e8e8;
  --chip: #ecf2f1;

  --red: #c24b3e;
  --red-bg: #f9e9e6;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --shadow-pop: 0 18px 48px rgba(23, 59, 76, 0.16);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 480px at 15% -10%, #eef5f3 0%, transparent 60%),
    radial-gradient(900px 420px at 100% 110%, #eaf4ee 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- card shell ---------- */
.auth-shell { width: 100%; max-width: 940px; }

.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Lay the two columns out deterministically (LTR track order), then place
     the panels by `order` — brand on the right, form on the left — so it reads
     correctly for Arabic regardless of how the browser resolves an RTL grid.
     Each panel restores `direction: rtl` for its own text. */
  direction: ltr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.auth-brand, .auth-form { direction: rtl; }
.auth-form  { order: 1; } /* left column */
.auth-brand { order: 2; } /* right column */

/* ---------- brand panel (petrol) ---------- */
.auth-brand {
  position: relative;
  padding: 44px 40px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 120% -10%, rgba(91, 190, 147, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, var(--petrol) 0%, var(--petrol-deep) 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
}

.brand-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.brand-badge svg { width: 30px; height: 30px; color: var(--mint); }

.brand-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.brand-role {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #d7ede4;
}
.brand-role .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }

.brand-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  max-width: 30ch;
}

/* route-line motif — the product signature */
.brand-route { margin-top: auto; }
.brand-route svg { width: 100%; height: auto; display: block; }

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

/* ---------- form panel ---------- */
.auth-form { padding: 48px 44px; display: flex; flex-direction: column; }

.form-head { margin-bottom: 26px; }
.form-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.form-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

.auth-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--red-bg);
  border: 1px solid rgba(194, 75, 62, 0.28);
  border-radius: var(--r-sm);
  color: #8f2f24;
  font-size: 13px;
}
.auth-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.auth-alert ul { margin: 0; padding: 0; list-style: none; }
.auth-alert li + li { margin-top: 3px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink); }

.control { position: relative; display: flex; align-items: center; }
.control .lead {
  position: absolute;
  inset-inline-start: 13px;
  width: 19px; height: 19px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.15s;
}
.control input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  padding-inline-start: 42px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.control:has(.tail) input { padding-inline-end: 44px; }
.control input::placeholder { color: var(--muted); opacity: 0.7; }
.control input:focus {
  outline: none;
  border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(91, 190, 147, 0.22);
}
.control input:focus ~ .lead { color: var(--petrol); }

.tail {
  position: absolute;
  inset-inline-end: 8px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); border-radius: 8px;
}
.tail:hover { color: var(--petrol); background: var(--chip); }
.tail svg { width: 19px; height: 19px; }

.row-between { display: flex; justify-content: flex-end; margin: -4px 0 22px; }
.link-mint {
  font-size: 13px; font-weight: 600; color: var(--mint-deep); text-decoration: none;
}
.link-mint:hover { color: var(--petrol); text-decoration: underline; }

.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  background: var(--petrol);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-submit:hover { background: var(--petrol-deep); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { opacity: 0.75; cursor: not-allowed; }
.btn-submit svg { width: 18px; height: 18px; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dev credentials (local only) ---------- */
.dev-creds {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--chip);
}
.dev-creds-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.dev-row {
  display: flex; align-items: center; gap: 10px;
}
.dev-row + .dev-row { margin-top: 8px; }
.dev-label { font-size: 11.5px; color: var(--muted); min-width: 52px; }
.dev-value {
  flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink);
  font-family: "IBM Plex Sans Arabic", ui-monospace, monospace;
  direction: ltr; text-align: start;
}
.dev-copy {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; font-size: 11px; font-weight: 700;
  color: var(--petrol); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.dev-copy:hover { border-color: var(--mint); color: var(--mint-deep); }
.dev-copy.copied { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-deep); }
.dev-copy svg { width: 13px; height: 13px; }

/* ---------- responsive: stack, brand becomes top band ---------- */
@media (max-width: 820px) {
  .auth-card { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  /* stacked: brand band on top, form below */
  .auth-brand { order: 1; padding: 30px 30px 26px; gap: 14px; }
  .auth-form { order: 2; padding: 32px 28px; }
  .brand-route { display: none; }
  .brand-tagline { display: none; }
}
