/* הנימוק ב-CLAUDE.md. לא כאן: מוגש לפני התחברות. */

:root {
  --navy: #1F3343;
  --turkiz: #a1f8fd;
  --light-bg: #F8FAFC;
  --dark-bg: #0F172A;
  --card-dark: #1E293B;
  --accent: #08BBE7;
  --accent-hover: #07A8D0;
  --error: #C1272D;          /* 5.9:1 על לבן — accentRed מגיע רק ל-4.05:1 */
  --error-dark: #FCA5A5;     /* 6.4:1 על הכרטיס הכהה */
  --border: #DBE3F1;
  --border-dark: #334155;
  --muted: #52606D;          /* 7.0:1 על הרקע הבהיר */
  --muted-dark: #CBD5E1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Assistant', 'Heebo', sans-serif;
  background: var(--light-bg);
  color: #1E293B;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}
.dark body { background: var(--dark-bg); color: #E2E8F0; }

/* ---- כותרת עליונה ---- */
.login-header {
  background: var(--navy);
  border-bottom: 4px solid var(--turkiz);
  color: #fff;
  padding: 0 1rem;
}
.login-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.login-brand { font-size: 1.0625rem; font-weight: 900; line-height: 1.2; }
.login-brand span {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #CBD5E1;
}

/* ---- כפתור בכותרת (נגישות) ---- */
.header-btn {
  min-height: 2.75rem;
  min-width: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.header-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* ---- הכרטיס ---- */
main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(31, 51, 67, 0.10);
  padding: 2rem;
  text-align: center;
}
.dark .login-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.login-mark {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 9999px;             /* עיגול מלא — החריג היחיד לפינות ישרות */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 51, 67, 0.06);
  color: var(--navy);
  font-size: 1.5rem;
}
.dark .login-mark { background: rgba(8, 187, 231, 0.12); color: var(--accent); }

.login-card h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--navy);
}
.dark .login-card h1 { color: #fff; }

.login-card p.hint {
  margin: 0.25rem 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.dark .login-card p.hint { color: var(--muted-dark); }

/* ---- כפתור ההתחברות ---- */
.sso-btn {
  width: 100%;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 0.2s;
}
.sso-btn:hover:not(:disabled) { background: #2A4457; }
.sso-btn:disabled { opacity: 0.65; cursor: progress; }
.dark .sso-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--navy);
}
.dark .sso-btn:hover:not(:disabled) { background: var(--accent-hover); }

/* מסמן מיקוד גלוי — נדרש לניווט במקלדת, ולא נסמכים על ברירת המחדל של הדפדפן
   שנעלמת על רקע כהה. */
.sso-btn:focus-visible,
.header-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* הנימוק ב-CLAUDE.md. לא כאן: מוגש לפני התחברות. */

/* ---- הודעת שגיאה ---- */
.login-error {
  margin-bottom: 1rem;
  padding: 0.625rem 1rem;
  border: 1px solid rgba(193, 39, 45, 0.4);
  background: rgba(193, 39, 45, 0.08);
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: right;
}
.dark .login-error {
  color: var(--error-dark);
  border-color: rgba(252, 165, 165, 0.4);
  background: rgba(252, 165, 165, 0.10);
}

/* ---- מצב "בודק סשן קיים" ---- */
.login-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}
.dark .login-checking { color: var(--muted-dark); }

[hidden] { display: none !important; }

/* ---- כותרת תחתונה ---- */
.login-footer {
  background: var(--navy);
  border-top: 4px solid var(--turkiz);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.875rem 1rem;
}
.login-footer a { color: var(--turkiz); }

/* עצירת אנימציות — נשלט מלוח הנגישות, ומכובד גם כשהמערכת מבקשת זאת. */
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
