
/* ============================================================
   AUTH PAGES — Login & Register
   ============================================================ */

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

:root {
  --white:    #FFFFFF;
  --bg:       #F8FAFC;
  --border:   #E2E8F0;
  --border2:  #CBD5E1;
  --indigo:   #4F46E5;
  --indigo2:  #4338CA;
  --indigo-l: #EEF2FF;
  --emerald:  #059669;
  --slate:    #1E293B;
  --body:     #475569;
  --muted:    #94A3B8;
  --danger:   #DC2626;
  --danger-l: #FEF2F2;
  --shadow:   0 4px 24px rgba(0,0,0,.08);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--slate);
  line-height: 1.6;
}

/* ── Layout ── */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left panel — branding ── */
.auth-brand {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #059669 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.brand-content { position: relative; z-index: 1; }
.brand-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  margin-bottom: 3rem;
}
.brand-logo-mark {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(10px);
}
.brand-logo span {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.brand-content h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
.brand-content p {
  color: rgba(255,255,255,.75);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 380px;
  margin-bottom: 2.5rem;
}
.brand-features { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.brand-features li {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
}
.brand-features li::before {
  content: '✓';
  width: 20px; height: 20px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Right panel — form ── */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  background: var(--white);
  overflow-y: auto;
}
.auth-form-inner {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.auth-header { margin-bottom: 2rem; }
.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate);
  letter-spacing: -.02em;
  margin-bottom: .35rem;
}
.auth-header p { font-size: .9rem; color: var(--body); }
.auth-header a { color: var(--indigo); text-decoration: none; font-weight: 600; }
.auth-header a:hover { text-decoration: underline; }

/* ── Form elements ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: .45rem;
}
.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--slate);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--muted); }
.form-control.error { border-color: var(--danger); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

/* Password wrapper */
.input-wrapper { position: relative; }
.input-wrapper .form-control { padding-right: 3rem; }
.password-toggle {
  position: absolute;
  right: .75rem; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: .25rem;
  transition: color .2s;
  display: flex;
}
.password-toggle:hover { color: var(--slate); }

/* Row layout for name fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

/* Error messages */
.field-error {
  font-size: .78rem;
  color: var(--danger);
  margin-top: .35rem;
  display: none;
}
.field-error.show { display: block; }

/* Alert */
.alert {
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: flex-start;
  gap: .5rem;
}
.alert.show { display: flex; }
.alert-error { background: var(--danger-l); color: var(--danger); border: 1px solid rgba(220,38,38,.2); }
.alert-success { background: #ECFDF5; color: var(--emerald); border: 1px solid rgba(5,150,105,.2); }

/* Submit button */
.btn-submit {
  width: 100%;
  padding: .85rem;
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .25rem;
}
.btn-submit:hover:not(:disabled) {
  background: var(--indigo2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.btn-submit:disabled { opacity: .7; cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.spinner.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: .82rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Footer note */
.auth-footer-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .83rem;
  color: var(--muted);
}
.auth-footer-note a { color: var(--indigo); text-decoration: none; }
.auth-footer-note a:hover { text-decoration: underline; }

/* Password strength */
.password-strength { margin-top: .5rem; }
.strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: .3rem;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0%;
}
.strength-text { font-size: .72rem; color: var(--muted); }

/* Terms checkbox */
.terms-group {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1.25rem;
}
.terms-group input[type="checkbox"] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: .2rem;
  accent-color: var(--indigo);
  cursor: pointer;
}
.terms-group label {
  font-size: .82rem;
  color: var(--body);
  cursor: pointer;
  line-height: 1.6;
}
.terms-group label a { color: var(--indigo); text-decoration: none; }
.terms-group label a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel { padding: 2rem 1.5rem; justify-content: flex-start; padding-top: 3rem; }
  .form-row { grid-template-columns: 1fr; }
}