/* assets/css/auth.css — sign-in, forgot/reset password, verify email.
   2.14.0: the public site's look (brand blue #0040A0, navy panel, Inter +
   Tajawal). Same class names as before, so the page scripts are unchanged. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --a-brand: #0040A0;
  --a-brand-h: #003080;
  --a-teal: #22C5C5;
  --a-ink: #0A1A33;
  --a-ink-2: #2E3F59;
  --a-muted: #5A6A82;
  --a-line: #E3E8F0;
  --a-line-2: #CBD5E3;
  --a-paper: #F5F7FA;
  --a-navy: #071A38;
  --a-bad: #C42B2B;
  --a-ok: #0E8A5F;
  --font-ar: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
html[lang="en"] { direction: ltr; }
html[lang="ar"] { direction: rtl; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-ar); font-size: 16px; line-height: 1.6; color: var(--a-ink);
  background: #fff; -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--font-en); font-size: 15px; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--a-brand); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { top: 12px; color: #fff; }

/* SHELL: navy panel + form side */
.shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); min-height: 100vh; width: 100%; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .brand { display: none !important; }
}

/* BRAND PANEL */
.brand {
  position: relative; overflow: hidden;
  background: var(--a-navy); color: #E7EEF8;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 48px 56px 0;
}
.brand::before {
  content: ""; position: absolute; inset-inline-end: -140px; top: -140px; width: 420px; height: 420px;
  border-radius: 50%; border: 64px solid rgba(34, 197, 197, .08); pointer-events: none;
}
.orb, .brand-logo-ring, .brand-pills { display: none !important; } /* pre-2.14 markup */
.brand-top { position: relative; display: inline-flex; }
.brand-top img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.brand-body { position: relative; display: grid; gap: 18px; max-width: 520px; }
.brand-kicker { margin: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--a-teal); font-size: 15px; font-weight: 700; }
html[lang="en"] .brand-kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.brand-kicker::before { content: ""; width: 22px; height: 2px; background: var(--a-teal); border-radius: 2px; }
.brand-title { margin: 0; color: #fff; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.35; font-weight: 800; text-wrap: balance; }
html[lang="en"] .brand-title { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.brand-facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; color: #A9B8CF; }
.brand-facts li { position: relative; padding-inline-start: 26px; }
.brand-facts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 14px; height: 2px; background: var(--a-teal); }
.brand-shot { position: relative; margin: 0 0 0; align-self: stretch; }
.brand-shot img { display: block; width: 100%; height: auto; max-width: 760px; border-radius: 12px 12px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5); }
html[lang="ar"] .brand-shot .shot-en, html[lang="en"] .brand-shot .shot-ar { display: none; }
.brand-ver { position: absolute; bottom: 14px; inset-inline-start: 56px; z-index: 2; font-size: 12px; color: rgba(255, 255, 255, .7); letter-spacing: .06em; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
/* old brand-text block (if a page still has it) */
.brand-text { position: relative; color: #fff; }
.brand-text h2 { color: #fff; font-size: 30px; line-height: 1.35; margin: 0 0 10px; }
.brand-text p { color: #A9B8CF; margin: 0; }

/* FORM SIDE */
.form-side {
  position: relative; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 88px 48px 48px;
}
.auth-top {
  position: absolute; top: 20px; inset-inline: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.back-home { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--a-ink-2); text-decoration: none; }
.back-home:hover { color: var(--a-brand); }
.back-home .arrow { display: inline-block; }
html[lang="ar"] .back-home .arrow { transform: scaleX(-1); }
.lang-toggle {
  position: absolute; top: 20px; inset-inline-end: 24px;
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--a-line-2); border-radius: 8px; background: #fff;
}
.auth-top .lang-toggle { position: static; }
.lang-btn {
  min-width: 40px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font: 600 13px/1 var(--font-en); color: var(--a-muted); cursor: pointer;
}
.lang-btn.active { background: var(--a-brand); color: #fff; }

/* CARD (no box: the form sits on the page) */
.login-card { width: 100%; max-width: 400px; background: transparent; padding: 0; box-shadow: none; border: 0; border-radius: 0; animation: none; }
.card-header-top { display: none; margin-bottom: 28px; }
@media (max-width: 960px) { .card-header-top { display: flex; } }
.card-logo img { height: 28px; width: auto; }
.card-heading { margin-bottom: 28px; text-align: start; }
.card-heading h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.3; font-weight: 800; color: var(--a-ink); }
html[lang="en"] .card-heading h1 { font-weight: 700; letter-spacing: -0.02em; font-size: 28px; }
.card-heading p { margin: 0; font-size: 15px; color: var(--a-muted); line-height: 1.65; }
html[lang="en"] .card-heading, html[lang="en"] .field label { text-align: left; }

#loginGlobalError, .auth-alert {
  display: none; margin-bottom: 18px; padding: 12px 14px; border-radius: 8px;
  background: #FDF2F2; border: 1px solid #F6D4D4; color: #9B1C1C; font-size: 14px; line-height: 1.55;
  align-items: flex-start; gap: 8px;
}
#loginGlobalError.visible { display: flex; }
.auth-alert { display: block; }
.auth-alert strong { display: block; margin-bottom: 2px; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--a-ink); }
html[lang="en"] .field label { font-weight: 600; }
.input-wrap { position: relative; }
.input-icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: #8794A8; font-size: 15px; pointer-events: none; }
.input-wrap input, .field > input, .field > select {
  width: 100%; height: 48px; border: 1px solid var(--a-line-2); border-radius: 8px; background: #fff;
  font: inherit; font-size: 16px; color: var(--a-ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
html[lang="ar"] .input-wrap input { padding: 0 40px 0 12px; direction: rtl; }
html[lang="en"] .input-wrap input { padding: 0 12px 0 40px; direction: ltr; text-align: left; }
.input-wrap input[type="email"] { direction: ltr; }
html[lang="ar"] .input-wrap input[type="email"] { text-align: right; }
.input-wrap input:focus, .field > input:focus { border-color: var(--a-brand); box-shadow: 0 0 0 3px rgba(0, 64, 160, .15); }
.input-wrap input.is-invalid { border-color: var(--a-bad); box-shadow: 0 0 0 3px rgba(196, 43, 43, .12); }
.toggle-pw { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: #8794A8; cursor: pointer; }
.toggle-pw:hover { color: var(--a-ink-2); background: var(--a-paper); }
html[lang="ar"] .input-wrap:has(.toggle-pw) input { padding-left: 46px; }
html[lang="en"] .input-wrap:has(.toggle-pw) input { padding-right: 46px; }
.field-error { display: none; margin-top: 5px; font-size: 13px; color: var(--a-bad); align-items: center; gap: 4px; }
.field-error.visible { display: flex; }
.field .form-text { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--a-muted); }

.submit-btn {
  width: 100%; height: 50px; margin-top: 8px; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px; background: var(--a-brand); color: #fff;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
html[lang="en"] .submit-btn { font-weight: 600; }
.submit-btn:hover { background: var(--a-brand-h); color: #fff; }
.submit-btn:disabled { opacity: .65; cursor: not-allowed; }
a.submit-btn { text-decoration: none; }
.submit-btn.is-secondary { background: #fff; color: var(--a-ink); border-color: var(--a-line-2); }
.submit-btn.is-secondary:hover { background: #fff; border-color: var(--a-ink-2); color: var(--a-ink); }

.form-footer { display: flex; justify-content: center; margin-top: 18px; }
.form-footer a { font-size: 14px; font-weight: 600; color: var(--a-brand); text-decoration: none; unicode-bidi: plaintext; }
.form-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.form-footer.is-split { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-signup { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--a-line); font-size: 14px; color: var(--a-muted); text-align: center; }
.auth-signup a { font-weight: 700; color: var(--a-brand); text-decoration: none; }
.auth-signup a:hover { text-decoration: underline; }

.sep { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.sep span { font-size: 13px; color: var(--a-muted); white-space: nowrap; }
.sep hr { flex: 1; border: 0; border-top: 1px solid var(--a-line); margin: 0; }
#ssoButtons .btn, #ssoButtons a, #ssoButtons button { min-height: 46px; border-radius: 8px; font-weight: 600; }

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

.auth-account { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 10px 12px; border-radius: 8px; background: var(--a-paper); font-size: 14px; color: var(--a-ink-2); }
.auth-account bdi { font-weight: 700; overflow-wrap: anywhere; }

.auth-state { text-align: center; }
.auth-state .card-heading { text-align: center !important; margin-bottom: 18px; }
.auth-state-icon { width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; }
.auth-state-icon.is-ok { background: #E3F5EC; color: var(--a-ok); }
.auth-state-icon.is-bad { background: #FDECEC; color: var(--a-bad); }
.auth-spin { width: 34px; height: 34px; margin: 6px auto 18px; border: 3px solid rgba(0, 64, 160, .18); border-top-color: var(--a-brand); border-radius: 50%; animation: spin .7s linear infinite; }
.auth-state .auth-alert, .auth-state .auth-ok { text-align: start; }
.auth-ok { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: #EEF8F3; border: 1px solid #CDEBDC; color: #0B6B49; font-size: 14px; }

@media (max-width: 560px) {
  .form-side { padding: 84px 16px 40px; justify-content: flex-start; }
  .auth-top { inset-inline: 16px; }
  .card-heading h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Sign-up page (2.14.0: same layout as sign-in) */
.signup-card { max-width: 440px; }
.login-title { margin: 0 0 6px; font-size: 30px; line-height: 1.3; font-weight: 800; color: var(--a-ink); }
html[lang="en"] .login-title { font-weight: 700; letter-spacing: -0.02em; font-size: 28px; }
.login-subtitle { margin: 0 0 24px; font-size: 15px; color: var(--a-muted); }
.field label .req { color: var(--a-bad); }
.field .hint { margin-top: 5px; font-size: 13px; color: var(--a-muted); }
.input-wrap input.is-valid { border-color: #2E9E6E; }
.pw-strength { margin-top: 8px; }
.pw-bar { height: 4px; background: var(--a-line); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.pw-fill { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }
.pw-text, .pw-counter { font-size: 12.5px; color: var(--a-muted); }
.pw-counter { float: inline-end; font-weight: 500; }
.global-error, .global-success { display: none; margin-bottom: 18px; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.6; gap: 10px; align-items: flex-start; }
.global-error { background: #FDF2F2; border: 1px solid #F6D4D4; color: #9B1C1C; }
.global-success { background: #EEF8F3; border: 1px solid #CDEBDC; color: #0B6B49; }
.global-error.visible, .global-success.visible { display: flex; }
.terms-row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 16px; font-size: 14px; color: var(--a-ink-2); }
.terms-row input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--a-brand); }
.terms-row a { color: var(--a-brand); font-weight: 600; text-decoration: none; }
.terms-row a:hover { text-decoration: underline; }
.login-footer { margin-top: 28px; text-align: center; font-size: 13px; color: var(--a-muted); }
.login-footer a { color: var(--a-muted); text-decoration: none; }
.login-footer a:hover { color: var(--a-brand); text-decoration: underline; }
