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

/* ─── Base ─── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cs-background);
  color: var(--cs-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Page wrapper ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(124,58,237,0.22), transparent),
    var(--cs-background);
}

/* ─── Card ─── */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 28px;
}

/* ─── Logo ─── */
.auth-logo-wrap { text-align: center; margin-bottom: 28px; }
.auth-logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

/* ─── Header ─── */
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--cs-text-muted); }

/* ─── Name row (side by side) ─── */
.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .name-row { grid-template-columns: 1fr; }
}

/* ─── Form groups ─── */
.auth-form .cs-form-group { margin-bottom: 16px; }

/* ─── Password field with show/hide ─── */
.input-wrap { position: relative; }
.input-wrap .cs-input { padding-right: 40px; }
.show-pass-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--cs-text-muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.show-pass-btn:hover { color: var(--cs-text); }

/* ─── Field-level error ─── */
.field-error {
  font-size: 11px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }
.cs-input.invalid { border-color: #ef4444; }

/* ─── Password strength ─── */
.pw-strength-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pw-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--cs-border);
  border-radius: 2px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.35s ease, background 0.35s ease;
}
.pw-strength-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
  transition: color 0.2s;
}

/* ─── Terms checkbox ─── */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.terms-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #7c3aed;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.terms-row label {
  font-size: 13px;
  color: var(--cs-text-muted);
  line-height: 1.5;
  cursor: pointer;
}
.terms-row a { color: #7c3aed; text-decoration: none; }
.terms-row a:hover { text-decoration: underline; }

/* ─── Error / success alerts ─── */
.auth-error {
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--cs-radius, 8px);
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ─── Loading button state ─── */
.cs-button .btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Success state ─── */
.success-state {
  text-align: center;
  padding: 16px 0;
}
.success-icon {
  font-size: 52px;
  margin-bottom: 16px;
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.success-text { font-size: 14px; color: var(--cs-text-muted); line-height: 1.7; }

/* ─── OAuth section ─── */
.oauth-section { margin-top: 24px; }
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--cs-text-muted);
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cs-border);
}
.oauth-btns { display: flex; flex-direction: column; gap: 10px; }
.oauth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius, 8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--cs-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.oauth-btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.2);
}
.oauth-btn .oauth-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; }
.oauth-btn .oauth-label { flex: 1; text-align: left; }

/* ─── Footer ─── */
.auth-.auth-footer a { color: #7c3aed; text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.logo { font-size:18px;font-weight:800;background:linear-gradient(135deg,#7c3aed,#0ea5e9);-webkit-background-clip:text;-webkit-text-fill-color:transparent;text-decoration:none; }
.nav-right { display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.nav-more-wrap { position:relative; }
.nav-more-menu { position:absolute;right:0;top:calc(100% + 8px);min-width:200px;max-height:70vh;overflow-y:auto;background:var(--cs-surface);border:1px solid var(--cs-border);border-radius:8px;box-shadow:0 12px 40px rgba(0,0,0,0.35);padding:8px 0;z-index:300; }
.nav-more-menu[hidden] { display:none; }
.nav-more-menu a { display:block;padding:8px 16px;font-size:13px;color:var(--cs-text-muted);text-decoration:none; }
.nav-more-menu a:hover { background:rgba(124,58,237,0.1);color:var(--cs-text); }
