/* Auth Pages — ExpenseFlow */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700;800&display=swap');

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

body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: #F0F4FF;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { direction: rtl; }

.auth-wrapper {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

/* Left Panel — Branding */
.auth-brand {
  flex: 1;
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 60%, #162040 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,.25) 0%, transparent 70%);
  border-radius: 50%;
  top: -80px; right: -80px;
}
.auth-brand::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,.15) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -60px; left: -40px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}
.brand-logo-icon {
  width: 48px; height: 48px;
  background: #2563EB;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}
.brand-logo-icon svg { color: #fff; width: 24px; height: 24px; }
.brand-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
}

.brand-headline {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -.6px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.brand-headline span {
  background: linear-gradient(135deg, #60A5FA, #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub {
  font-size: 1rem;
  color: #94A3B8;
  line-height: 1.7;
  max-width: 360px;
  position: relative;
  z-index: 1;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}
.brand-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #CBD5E1;
  font-size: .9rem;
}
.brand-feature-icon {
  width: 28px; height: 28px;
  background: rgba(37,99,235,.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-feature-icon svg { width: 14px; height: 14px; color: #60A5FA; }

.brand-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.08);
  position: relative;
  z-index: 1;
}
.brand-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.brand-stat-label {
  font-size: .75rem;
  color: #64748B;
  margin-top: 2px;
}

/* Right Panel — Form */
.auth-form-panel {
  width: 480px;
  min-width: 480px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 48px;
  overflow-y: auto;
}

.auth-form-header { margin-bottom: 28px; }
.auth-form-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.auth-form-subtitle {
  font-size: .9rem;
  color: #64748B;
}

.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 5px;
  display: block;
}
.auth-form .form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: .9375rem;
  font-family: 'Tajawal', system-ui, sans-serif;
  color: #0F172A;
  background: #FAFAFA;
  outline: none;
  transition: all .15s ease;
}
.auth-form .form-control:focus {
  border-color: #2563EB;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.auth-form .form-control::placeholder { color: #94A3B8; }

.password-field {
  position: relative;
}
.password-toggle {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color .15s;
}
.password-toggle:hover { color: #2563EB; }
.password-toggle svg { width: 16px; height: 16px; }
[dir="ltr"] .password-toggle { right: 12px; }
[dir="rtl"] .password-toggle { left: 12px; }
[dir="ltr"] .password-field .form-control { padding-right: 40px; }
[dir="rtl"] .password-field .form-control { padding-left: 40px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.form-row .form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: .875rem;
  color: #475569;
}
.form-row .form-check input { accent-color: #2563EB; }
.form-link {
  font-size: .875rem;
  color: #2563EB;
  font-weight: 600;
  text-decoration: none;
}
.form-link:hover { color: #1D4ED8; text-decoration: underline; }

.btn-auth {
  width: 100%;
  padding: 12px 20px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Tajawal', system-ui, sans-serif;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-auth:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth svg { width: 18px; height: 18px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #94A3B8;
  font-size: .8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .875rem;
  color: #64748B;
}
.auth-footer a {
  color: #2563EB;
  font-weight: 700;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

.lang-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 24px;
}
.lang-switch a {
  font-size: .8125rem;
  font-weight: 600;
  color: #94A3B8;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
}
.lang-switch a.active,
.lang-switch a:hover {
  color: #2563EB;
  background: #EFF6FF;
}

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert svg { width: 15px; height: 15px; flex-shrink: 0; }
.alert-error   { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.alert-success { background: #ECFDF5; color: #059669; border-color: #A7F3D0; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 960px) {
  .auth-brand { display: none; }
  .auth-form-panel { width: 100%; min-width: 0; padding: 32px 24px; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 24px 20px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
