/* ── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0a0f1e;
  --navy-2:      #111827;
  --navy-3:      #1a2236;
  --navy-4:      #212d44;
  --accent:      #2563eb;
  --accent-2:    #3b82f6;
  --accent-dim:  rgba(37,99,235,0.10);
  --accent-bdr:  rgba(37,99,235,0.30);
  --green:       #10b981;
  --green-dim:   rgba(16,185,129,0.10);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.10);
  --text-1:      #f0f4ff;
  --text-2:      #8b9ab8;
  --text-3:      #4b5878;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.13);
  --serif:       'Instrument Serif', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
  --radius:      10px;
  --radius-lg:   16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--navy);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── SHARED FORM ELEMENTS ─────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
}

.form-input {
  width: 100%;
  height: 48px;
  background: var(--navy-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 0.9375rem;
  color: var(--text-1);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: rgba(37,99,235,0.6);
}

.form-input::placeholder {
  color: var(--text-3);
}

.form-input.error {
  border-color: rgba(239,68,68,0.6);
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover  { background: var(--accent-2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── ALERTS ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.visible { display: block; }
.alert-error {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}
.alert-success {
  background: var(--green-dim);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7;
}

/* ── AUTH LAYOUT ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 40%,
    rgba(37,99,235,0.07) 0%, transparent 70%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.auth-logo img {
  height: 72px;
  width: auto;
}

.auth-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 0.375rem;
}

.auth-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 1.75rem;
  font-weight: 300;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.auth-footer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 1.25rem;
}

.auth-footer a {
  color: var(--accent-2);
  font-weight: 500;
  transition: color 0.2s;
}

.auth-footer a:hover { color: var(--text-1); }

/* password toggle wrapper */
.input-wrap {
  position: relative;
}
.input-wrap .form-input {
  padding-right: 44px;
}
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}
.toggle-pw:hover { color: var(--text-2); }

/* spinner inside button */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* password strength bar */
.pw-strength {
  margin-top: 6px;
  display: flex;
  gap: 4px;
}
.pw-strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--border-2);
  transition: background 0.3s;
}
.pw-strength-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* terms checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 1.25rem;
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-row label {
  font-size: 0.8125rem;
  color: var(--text-3);
  line-height: 1.5;
  cursor: pointer;
}
.checkbox-row label a {
  color: var(--accent-2);
}
