/* ============================================================
   Arbah v1 — Login page migration (first per-page rollout)
   Scoped under .arbah-v1. Legacy login styles (all inline +
   Tailwind utilities on src/pages/Login.js) untouched; nothing
   here applies unless <html> has .arbah-v1.

   Spec: cluade/design/arbah-v1-design-system-COMPLETE-2026-05-12.md
   (no explicit login mockup; layout extrapolated from the locked
   token system + goal description for the foundation rollout).

   Login page is OUTSIDE the shell — rendered by src/app.js when
   `!user`, before Layout mounts. No sidebar / topbar / bottom-nav
   selectors appear on this surface.
   ============================================================ */

/* ---------- Legacy class definitions (paint-preserving) -------- */
/* These classes replace inline style= attributes on Login.js. Outside
   the .arbah-v1 scope so unflagged renders pick them up at specificity
   (0,1,0). Each .arbah-v1 .legacy-X rule below has (0,2,0) and wins
   under the flag on plain specificity.

   Migrated from inline styles in PR 17 (zero-specificity-hack cleanup):
     legacy-login-page-bg     ← style="background:linear-gradient(135deg,#0B2545 0%,#13315C 100%);"
     legacy-login-logo        ← gradient + Cormorant Garamond + inset bronze
     legacy-login-brand-name  ← color #0B2545 + Cormorant Garamond
     legacy-login-heading     ← color #B8860B + font-weight 600
     legacy-login-submit-bg   ← background #0B2545 (used on 2 buttons)
*/
.legacy-login-page-bg {
  background: linear-gradient(135deg, #0B2545 0%, #13315C 100%);
}
.legacy-login-logo {
  background: linear-gradient(135deg, #0B2545, #13315C);
  font-family: 'Cormorant Garamond', serif;
  box-shadow: inset 0 1px 0 #B8860B;
}
.legacy-login-brand-name {
  color: #0B2545;
  font-family: 'Cormorant Garamond', serif;
}
.legacy-login-heading {
  color: #B8860B;
  font-weight: 600;
}
.legacy-login-submit-bg {
  background: #0B2545;
}

/* ---- Outer page wrapper ----
   The legacy wrapper now carries .legacy-login-page-bg instead of an
   inline gradient. Scope-specificity (0,2,0) beats it (0,1,0) — v1
   paints the flat neutral surface from the token. */
.arbah-v1 .login-page {
  background: var(--arbah-bg);
  font-family: var(--arbah-font-sans);
  color: var(--arbah-text);
}

/* ---- Card container ----
   Selector is .arbah-v1 .login-card (specificity 0,2,0) which beats
   Tailwind's single-class .max-w-md / .rounded-xl / .shadow-2xl
   (0,1,0). */
.arbah-v1 .login-card {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-md);
  padding: var(--arbah-space-8);
  max-width: 420px;
  width: 100%;
}

/* ---- Brand block (logo + name + tagline) ---- */
.arbah-v1 .login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--arbah-space-2);
}

/* Logo box — legacy now carries .legacy-login-logo; scope wins on
   plain specificity. */
.arbah-v1 .login-logo {
  background: var(--arbah-navy-700);
  box-shadow: inset 0 1px 0 var(--arbah-bronze-500);
  border-radius: var(--arbah-radius-md);
  color: #fff;
  font-family: var(--arbah-font-serif);
  font-weight: 600;
}

/* Brand name — legacy now carries .legacy-login-brand-name. */
.arbah-v1 .login-brand-name {
  color: var(--arbah-navy-700);
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-lg);
}

/* Heading (uppercase tagline) — legacy goldenrod #B8860B is bronze-600
   (print variant per spec). v1 surfaces the interactive bronze-500. */
.arbah-v1 .login-heading {
  color: var(--arbah-bronze-500);
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Form fields ----
   Inputs and labels are targeted by descendant selector — no class
   additions on each <input>/<label> needed. */
.arbah-v1 .login-page input {
  width: 100%;
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-md);
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-base);
  color: var(--arbah-text);
  background: var(--arbah-surface);
  padding: var(--arbah-space-2) var(--arbah-space-3);
  transition:
    border-color var(--arbah-duration-fast) var(--arbah-ease-standard),
    box-shadow var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .login-page input:focus,
.arbah-v1 .login-page input:focus-visible {
  outline: 2px solid var(--arbah-bronze-500);
  outline-offset: 2px;
  border-color: var(--arbah-bronze-500);
  box-shadow: var(--arbah-focus-ring-glow);
}

.arbah-v1 .login-page label {
  font-family: var(--arbah-font-sans);
  font-weight: 500;
  font-size: var(--arbah-text-sm);
  color: var(--arbah-text-muted);
}

/* ---- Primary submit button ----
   Legacy now carries .legacy-login-submit-bg (background #0B2545).
   Scope-specificity (0,2,0) wins natively. */
.arbah-v1 .login-submit {
  background: var(--arbah-bronze-500);
  color: #fff;
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-base);
  border-radius: var(--arbah-radius-md);
  padding: var(--arbah-space-3) var(--arbah-space-4);
  border: none;
  transition: background var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .login-submit:hover:not(:disabled) {
  /* Spec ramp: -600 (#B8860B) is the print goldenrod, BRIGHTER than
     -500. Hover wants darker — use -700 (#7A4F1F). Goal text said
     "-600" but spec wins per foundation-PR precedent. */
  background: var(--arbah-bronze-700);
}
.arbah-v1 .login-submit:disabled {
  opacity: 0.6;
}

/* ---- Secondary link (mode toggle) ---- */
.arbah-v1 .login-toggle {
  color: var(--arbah-text-muted);
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-xs);
}
.arbah-v1 .login-toggle:hover {
  color: var(--arbah-bronze-500);
  text-decoration: underline;
}

/* ---- Status / error messages ---- */
.arbah-v1 .login-status {
  border-radius: var(--arbah-radius-md);
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-sm);
  padding: var(--arbah-space-2) var(--arbah-space-3);
}
.arbah-v1 .login-status-error {
  background: var(--arbah-danger-soft);
  color: var(--arbah-danger);
}
.arbah-v1 .login-status-info {
  background: var(--arbah-info-soft);
  color: var(--arbah-info);
}

/* ---- AR mode ----
   The app sets `dir="rtl"` on <html> when lang === 'ar' (see
   src/app.js useEffect). With .arbah-v1 also on <html>, both
   classes co-locate so .arbah-v1[dir="rtl"] is the correct anchor. */
.arbah-v1[dir="rtl"] .login-page {
  font-family: "IBM Plex Sans Arabic", var(--arbah-font-sans);
}
.arbah-v1[dir="rtl"] .login-page input,
.arbah-v1[dir="rtl"] .login-page label,
.arbah-v1[dir="rtl"] .login-submit,
.arbah-v1[dir="rtl"] .login-toggle {
  font-family: "IBM Plex Sans Arabic", var(--arbah-font-sans);
}
