/* ─────────────────────────────────────────
   Auth pages — login & register
   Requires: style.css (design tokens)
───────────────────────────────────────── */

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

/* ── Left panel — branding ── */
.auth-panel-left {
  background: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(0,87,255,0.14);
  pointer-events: none;
}

.auth-panel-left::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -60px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(0,87,255,0.08);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.5px;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.auth-logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
}

.auth-panel-tagline {
  position: relative;
  z-index: 1;
}

.auth-panel-tagline h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.15;
}

.auth-panel-tagline h2 em {
  font-style: normal;
  color: #5b9eff;
}

.auth-panel-tagline p {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 36px;
}

.auth-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}

.auth-benefit-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.85);
}

.auth-benefit-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.auth-panel-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ── Right panel — form ── */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card-header {
  margin-bottom: 36px;
}

.auth-card-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-card-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-card-header p a {
  color: var(--accent);
  font-weight: 500;
}

.auth-card-header p a:hover {
  text-decoration: underline;
}

/* ── Social buttons ── */
.auth-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-social:hover {
  border-color: var(--text);
  background: var(--surface2);
  transform: translateY(-1px);
}

.btn-social svg { flex-shrink: 0; }

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Form fields ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field-input-wrap {
  position: relative;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,87,255,0.1);
}

.field input.has-toggle { padding-right: 46px; }

.field input.is-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.field input.is-valid {
  border-color: var(--green);
}

.field-error {
  font-size: 12px;
  color: var(--red);
  display: none;
}

.field.show-error .field-error { display: block; }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  display: flex;
  padding: 4px;
  transition: color 0.2s;
}

.toggle-pw:hover { color: var(--text-muted); }

/* ── Password strength ── */
.pw-strength {
  margin-top: 4px;
}

.pw-strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.pw-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-strong);
  transition: background 0.3s;
}

.pw-bar.active-weak   { background: var(--red); }
.pw-bar.active-fair   { background: var(--amber); }
.pw-bar.active-good   { background: #3b82f6; }
.pw-bar.active-strong { background: var(--green); }

.pw-strength-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ── Checkbox ── */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.field-check a {
  color: var(--accent);
  font-weight: 500;
}

/* ── Forgot link ── */
.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-meta label { margin: 0; }

.forgot-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.2s;
}

.forgot-link:hover { opacity: 0.75; }

/* ── Submit button ── */
.btn-auth {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.btn-auth:hover {
  background: #2a2927;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-auth:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Alert / flash message ── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.auth-alert.error {
  background: #fef2f2;
  border: 1px solid rgba(220,38,38,0.2);
  color: #991b1b;
}

.auth-alert.success {
  background: var(--green-light);
  border: 1px solid rgba(0,135,90,0.2);
  color: #065f46;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-panel-left { display: none; }

  .auth-panel-right {
    min-height: 100vh;
    padding: 32px 20px;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-card-header h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .auth-socials { grid-template-columns: 1fr; }
}
