/* ==========================================================================
   Login page — split screen on desktop, single column on mobile
   ========================================================================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--color-surface);
}

/* ---------- Brand panel ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-10) var(--space-12);
  color: #fff;
  background:
    radial-gradient(900px 500px at 110% 110%, rgba(0, 159, 227, 0.55), transparent 60%),
    radial-gradient(500px 300px at -10% -10%, rgba(255, 138, 61, 0.22), transparent 60%),
    linear-gradient(160deg, #12304A 0%, #0D2438 100%);
}
.auth-brand::before {
  /* subtle grid pattern */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.auth-brand > * { position: relative; }

.auth-logo { display: flex; align-items: center; gap: var(--space-3); }
.auth-logo .brand-mark { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5); }
.auth-logo strong { display: block; font-size: var(--text-lg); letter-spacing: -0.01em; }
.auth-logo span { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.65); }

.auth-pitch h2 {
  color: #fff;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 480px;
}
.auth-pitch h2 em { font-style: normal; color: #5CCBF5; }
.auth-pitch p { margin-top: var(--space-4); color: rgba(255, 255, 255, 0.7); font-size: var(--text-md); max-width: 440px; }

.auth-features { margin-top: var(--space-8); display: grid; gap: var(--space-3); max-width: 440px; }
.auth-feature {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  font-size: var(--text-sm);
}
.auth-feature .ic {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(0, 159, 227, 0.22); color: #7FD8F8;
}
.auth-feature .ic .lucide { width: 18px; height: 18px; }
.auth-feature strong { display: block; font-weight: var(--weight-semibold); }
.auth-feature span { color: rgba(255, 255, 255, 0.6); font-size: var(--text-xs); }

.auth-brand-foot { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.5); display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- Form panel ---------- */
.auth-panel {
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-10);
  background: var(--color-surface);
}
.auth-panel-top { display: flex; justify-content: flex-end; gap: var(--space-1); }
.auth-form-wrap {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-8) 0;
}
.auth-mobile-logo { display: none; }
.auth-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -0.02em; }
.auth-head p { margin-top: var(--space-2); color: var(--color-text-muted); }

.auth-form { margin-top: var(--space-8); display: grid; gap: var(--space-5); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.auth-row a { font-size: var(--text-sm); font-weight: var(--weight-semibold); }

.auth-alert { margin-top: var(--space-6); }

.auth-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--color-text-subtle); font-size: var(--text-xs);
  margin: var(--space-2) 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

.auth-secure {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.auth-secure .lucide { width: 14px; height: 14px; color: var(--color-success); }

.auth-panel-foot { text-align: center; font-size: var(--text-xs); color: var(--color-text-subtle); }

/* Forgot-password panel swaps with the login form */
.auth-view[hidden] { display: none; }
.back-link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--space-6); background: none; border: 0; color: var(--color-primary-700); padding: 0; }
.back-link .lucide { width: 16px; height: 16px; }
[dir="rtl"] .back-link .lucide { transform: scaleX(-1); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .auth-brand { padding: var(--space-8); }
  .auth-panel { padding: var(--space-6); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; background: var(--color-bg); }
  .auth-brand { display: none; }
  .auth-panel { background: var(--color-bg); padding: var(--space-4); min-height: 100vh; }
  .auth-form-wrap {
    flex: 0 0 auto;
    margin: var(--space-4) auto;
    padding: var(--space-8) var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
  }
  .auth-mobile-logo { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
  .auth-mobile-logo .brand-mark { width: 42px; height: 42px; border-radius: 11px; }
  .auth-mobile-logo strong { display: block; font-size: var(--text-md); }
  .auth-mobile-logo span { font-size: var(--text-xs); color: var(--color-text-muted); }
  .auth-head h1 { font-size: var(--text-xl); }
  .auth-form { margin-top: var(--space-6); }
}
@media (max-width: 400px) {
  .auth-form-wrap { padding: var(--space-6) var(--space-4); }
}
