/* ═══════════════════════════════════════════════════════════════════
   يشفيني — Admin login (DLV-214-P1)
   Replicates prototype/a-admin/a00-login.html + styles.css with the
   DEFAULT theme «sunrise-warm» from prototype/theme-system.css.
   Plain CSS, git-tracked, zero build step. Scoped under .yf-auth so it
   cannot leak into other panel pages.
   ═══════════════════════════════════════════════════════════════════ */

.yf-auth {
  /* ━━━ sunrise-warm tokens (theme-system.css) ━━━ */
  --bg-primary:     #FDF8F0;
  --bg-secondary:   #FFFFFF;
  --surface-1:      #FFFBF5;
  --surface-2:      #FAF5F0;
  --surface-3:      #F5EFEA;
  --surface-hover:  #F8F2ED;

  --emerald:        #6B8E23;
  --emerald-dark:   #556B2F;
  --emerald-deep:   #3D5217;
  --emerald-soft:   rgba(107, 142, 35, 0.12);
  --emerald-glow:   rgba(107, 142, 35, 0.10);

  --gold:           #C8860D;
  --gold-light:     #D4A43A;
  --gold-deep:      #8B6914;
  --gold-soft:      rgba(200, 134, 13, 0.14);

  --text-primary:   #3A2F2A;
  --text-secondary: #6B5D56;
  --text-muted:     #9C8F88;
  --text-on-gold:   #FFFFFF;

  --border:         #E8DCD0;
  --border-strong:  #D4C4B8;
  --border-focus:   #6B8E23;
  --divider:        #F5EFEA;

  --shadow-focus: 0 0 0 3px rgba(107, 142, 35, 0.12);

  --btn-primary-bg-start: var(--gold);
  --btn-primary-bg-end:   var(--gold-deep);
  --btn-primary-text:     #FFFFFF;
  --btn-primary-border:   var(--gold);
  --link-color:           var(--gold-deep);

  /* ━━━ shared tokens (a-admin/styles.css :root) ━━━ */
  --danger:   #E74C3C;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.32);
  --shadow-3: 0 10px 32px rgba(0, 0, 0, 0.45);

  --font-body: 'Vazirmatn', sans-serif;
  --font-display: 'El Messiri', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;

  /* ━━━ page base (prototype body) ━━━ */
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

.yf-auth *,
.yf-auth *::before,
.yf-auth *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.yf-auth a { color: inherit; text-decoration: none; }
.yf-auth button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.yf-auth input { font-family: inherit; color: inherit; }
.yf-auth svg { flex: none; }

/* ═══════════ Auth (A00) — ported verbatim from a-admin/styles.css ═══════════ */
.yf-auth .auth-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(43, 106, 75, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(212, 160, 60, 0.08), transparent 60%),
    var(--bg-primary);
}

.yf-auth .auth-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-inline-end: 1px solid var(--border);
}
.yf-auth .auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23234837' stroke-width='1.1' opacity='0.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='26' cy='105' r='6'/><path d='M26 99 Q 26 84 36 80 Q 45 77 45 63 M 26 111 Q 26 122 37 125'/><path d='M108 22 L 115 22 L 115 29 L 122 29 L 122 36 L 115 36 L 115 43 L 108 43 L 108 36 L 101 36 L 101 29 L 108 29 Z'/><path d='M10 50 L 24 50 L 28 43 L 34 61 L 40 50 L 56 50'/><rect x='96' y='94' width='26' height='12' rx='6' transform='rotate(-25 109 100)'/><path d='M68 10 Q 74 20 68 30 Q 62 40 68 50' stroke-width='0.9'/></g></svg>");
  background-repeat: repeat;
  opacity: 0.7;
  pointer-events: none;
}
.yf-auth .auth-hero > * { position: relative; z-index: 1; }

.yf-auth .hero-brand {
  display: flex; align-items: center; gap: 14px;
}
.yf-auth .brand-mark {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  display: grid; place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.yf-auth .brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.yf-auth .brand-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.2px;
}
.yf-auth .brand-role {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.8px;
}
.yf-auth .brand-tagline {
  /* Portal Arabic brand line (owner/lab/radiology/pharmacy) — absent on admin */
  font-size: 13px; font-weight: 600;
  color: var(--olive, #6B8E23);
  margin-top: 2px;
}
.yf-auth .hero-brand .brand-mark { width: 52px; height: 52px; font-size: 26px; }
.yf-auth .hero-brand .brand-name { font-size: 26px; }
.yf-auth .hero-brand .brand-role { font-size: 12px; }

.yf-auth .hero-pitch {
  max-width: 480px;
}
.yf-auth .hero-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.yf-auth .hero-title .hl { color: var(--gold); }
.yf-auth .hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
}
.yf-auth .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 520px;
}
.yf-auth .hero-stat {
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.yf-auth .hero-stat .value {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
  color: var(--gold);
}
.yf-auth .hero-stat .label {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.yf-auth .auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 48px;
}
.yf-auth .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-3);
}
.yf-auth .auth-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.yf-auth .auth-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

.yf-auth .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.yf-auth .field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.yf-auth .field-input {
  display: flex; align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  height: 46px;
  padding: 0 14px;
  gap: 10px;
  transition: border-color 140ms, box-shadow 140ms;
}
.yf-auth .field-input:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}
.yf-auth .field-input .field-icon {
  color: var(--text-muted);
  width: 18px; height: 18px;
}
.yf-auth .field-input input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
}
.yf-auth .field-input input::placeholder { color: var(--text-muted); }
.yf-auth .field-input .field-suffix {
  font-size: 13px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.yf-auth .field-input .field-toggle {
  color: var(--text-muted);
  padding: 4px;
}
.yf-auth .field-input .field-toggle:hover { color: var(--text-primary); }

/* @tailwindcss/forms paints a foreign BLUE focus ring on the inner input —
   the design's focus treatment lives on the .field-input WRAPPER (olive
   border + soft shadow via :focus-within), so suppress the inner ring. */
.yf-auth .field-input input:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
  --tw-ring-color: transparent;
  --tw-ring-shadow: 0 0 #0000;
  --tw-ring-offset-shadow: 0 0 #0000;
}

/* Validation feedback (Livewire) — warm-theme danger, design-consistent */
.yf-auth .field-error {
  font-size: 12px;
  color: var(--danger);
}

.yf-auth .field-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 22px;
  font-size: 13px;
}
.yf-auth .check {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}
.yf-auth .check input { accent-color: var(--emerald); width: 16px; height: 16px; }
/* @tailwindcss/forms (shipped by Filament's layout.base) sets appearance:none
   on checkboxes, so accent-color is ignored — paint the checked state in the
   olive token explicitly, and keep its focus ring olive-soft. */
.yf-auth .check input[type='checkbox'] {
  border-color: var(--border-strong);
}
.yf-auth .check input[type='checkbox']:checked {
  background-color: var(--emerald);
  border-color: var(--emerald);
}
.yf-auth .check input[type='checkbox']:focus {
  box-shadow: none;
  --tw-ring-color: rgba(107, 142, 35, 0.25);
}
.yf-auth .link { color: var(--link-color); font-weight: 600; }
.yf-auth .link:hover { color: var(--gold); }

/* ═══════════ Buttons — ported verbatim from a-admin/styles.css ═══════════
   NOTE: a-admin/styles.css .btn-primary uses var(--emerald)/var(--emerald-dark)
   DIRECTLY (not the theme-system --btn-primary-* tokens), so the rendered
   a00-login CTA is olive with warm-cream text. Replicated exactly. */
.yf-auth .btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: all 140ms ease;
  white-space: nowrap;
}
.yf-auth .btn-primary {
  background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  color: var(--bg-primary);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.yf-auth .btn-primary:hover { filter: brightness(1.08); }
.yf-auth .btn-primary:active { transform: translateY(1px); }
.yf-auth .btn-primary:disabled { opacity: 0.7; cursor: wait; }

.yf-auth .auth-cta {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  font-size: 15px;
}
.yf-auth .auth-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ═══════════ Responsive Safety (a-admin/styles.css) ═══════════ */
@media (max-width: 1180px) {
  .yf-auth .auth-stage { grid-template-columns: 1fr; }
  .yf-auth .auth-hero { display: none; }
}
