/*
 * onboarding/auth.css — shared editorial styling for forgot/reset/
 * change-password. Mirrors the login page aesthetic so the merchant
 * sees a consistent visual language across the auth flow:
 *   - parchment background + warm depth
 *   - Instrument Serif italic headline (Tajawal swap for AR)
 *   - hairline-bordered card, no heavy shadow
 *   - navy CTA button
 */

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

:root {
  --primary: #4DA8DA;
  --primary-dark: #3A8FC2;
  --navy: #1B2A4A;
  --accent: #D4A156;
  --parchment: #FAF8F4;
  --parchment-2: #F5F3EE;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --display: 'Instrument Serif', 'Tajawal', Georgia, serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

body {
  font-family: var(--body);
  background: var(--parchment);
  min-height: 100vh;
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: 'Tajawal', sans-serif; }

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(212, 161, 86, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 80% 75%, rgba(77, 168, 218, 0.05) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  z-index: 1;
}

.lang-toggle {
  position: fixed;
  top: 24px;
  inset-inline-end: 24px;
  background: transparent;
  border: 1px solid rgba(27, 42, 74, 0.14);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: var(--body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 180ms ease;
  z-index: 10;
}
.lang-toggle:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: white;
}

.auth-frame {
  width: 100%;
  max-width: 420px;
  background: white;
  border: 1px solid rgba(27, 42, 74, 0.08);
  border-radius: 16px;
  padding: 44px 40px;
  position: relative;
}
@media (max-width: 480px) {
  .auth-frame { padding: 32px 24px; }
}

.auth-num {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--gray-400);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.tk-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-decoration: none;
}
.tk-mark { flex-shrink: 0; }
.tk-word {
  display: inline-flex;
  align-items: baseline;
  direction: ltr;
  font-family: var(--body);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1;
}
.tk-word-track { color: var(--navy); }
.tk-word-it    { color: var(--primary); }
.tk-word-dot {
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 2px;
  background: var(--primary);
  border-radius: 50%;
}

.auth-headline {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
[dir="rtl"] .auth-headline {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 24px;
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  background: white;
  border: 1px solid rgba(27, 42, 74, 0.12);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--navy);
  font-family: var(--body);
  direction: ltr;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field input:hover { border-color: rgba(27, 42, 74, 0.22); }
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77, 168, 218, 0.14);
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 24px;
  background: var(--navy);
  color: white;
  border: 1px solid var(--navy);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.005em;
  margin-top: 8px;
}
.auth-btn:hover:not(:disabled) {
  background: #0F1B36;
  border-color: #0F1B36;
  box-shadow: 0 6px 20px rgba(27, 42, 74, 0.22);
  transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-back {
  display: inline-flex;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--gray-500);
  text-decoration: none;
  font-weight: 500;
  transition: color 180ms ease;
}
.auth-back:hover { color: var(--primary); }
.auth-back::before {
  content: '←';
  margin-inline-end: 6px;
  transition: transform 180ms ease;
}
[dir="rtl"] .auth-back::before { content: '→'; }
.auth-back:hover::before { transform: translateX(-2px); }
[dir="rtl"] .auth-back:hover::before { transform: translateX(2px); }

.error-msg {
  background: #FEF2F2;
  color: #B91C1C;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid rgba(239, 68, 68, 0.18);
  line-height: 1.5;
}
.success-msg {
  background: rgba(34, 197, 94, 0.08);
  color: #15803D;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid rgba(34, 197, 94, 0.20);
  line-height: 1.5;
}
.show { display: block; }

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.password-strength {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
  letter-spacing: 0.005em;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-frame > * {
  opacity: 0;
  animation: authFadeUp 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.auth-frame > *:nth-child(1) { animation-delay: 0ms;   }
.auth-frame > *:nth-child(2) { animation-delay: 50ms;  }
.auth-frame > *:nth-child(3) { animation-delay: 100ms; }
.auth-frame > *:nth-child(4) { animation-delay: 150ms; }
.auth-frame > *:nth-child(5) { animation-delay: 200ms; }
.auth-frame > *:nth-child(6) { animation-delay: 250ms; }
.auth-frame > *:nth-child(7) { animation-delay: 300ms; }
@media (prefers-reduced-motion: reduce) {
  .auth-frame > * { animation: none; opacity: 1; }
}
