/* auth.css — extends style.css, same design tokens */

body.auth-body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-image: radial-gradient(ellipse at top, #1a1040 0%, var(--bg) 60%);
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  animation: cardIn 0.25s ease;
}

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

/* Wide card: branding left + form right */
.auth-card-wide {
  max-width: 840px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-brand {
  background: linear-gradient(160deg, #15123a 0%, #0e1128 60%, #0a0f20 100%);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: ''; position: absolute; top: -100px; left: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand::after {
  content: ''; position: absolute; bottom: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.brand-top { display: flex; align-items: center; gap: 0.6rem; position: relative; z-index: 1; }

.brand-icon-wrap {
  width: 38px; height: 38px; background: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; box-shadow: 0 0 18px rgba(108,99,255,0.4);
}

.brand-name { font-size: 1rem; font-weight: 700; }

.brand-middle { position: relative; z-index: 1; }

.brand-middle h2 {
  font-size: 1.55rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.brand-middle p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }

.brand-pills { display: flex; flex-direction: column; gap: 0.5rem; position: relative; z-index: 1; }

.brand-pill {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 40px; padding: 0.45rem 0.8rem;
  font-size: 0.78rem; color: var(--muted); width: fit-content;
}

.auth-form-panel {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Headings ─────────────────────────────────────────────────────────────── */
.auth-logo     { font-size: 2rem; margin-bottom: 0.5rem; display: block; text-align: center; }
.auth-title    { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 0.3rem; letter-spacing: -0.01em; }
.auth-subtitle { color: var(--muted); font-size: 0.875rem; text-align: center; margin-bottom: 1.75rem; line-height: 1.5; }

/* ── Form ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block; font-size: 0.82rem; font-weight: 500;
  color: var(--muted); margin-bottom: 0.4rem; letter-spacing: 0.01em;
}

.form-group input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.72rem 0.95rem; color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif; font-size: 0.925rem;
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
}

.form-group input::placeholder { color: #4a4f6a; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-meta { display: flex; justify-content: flex-end; margin-top: -0.5rem; margin-bottom: 1rem; }

.link-small { font-size: 0.82rem; color: var(--accent-light); text-decoration: none; transition: color 0.15s; }
.link-small:hover { color: #fff; }

/* ── Submit button ────────────────────────────────────────────────────────── */
.btn-submit {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 0.82rem; border-radius: 8px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.12s, opacity 0.2s;
  letter-spacing: 0.01em; position: relative;
}

.btn-submit:hover:not(:disabled) { background: var(--accent-light); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-submit.loading { color: transparent; pointer-events: none; }

.btn-submit.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 0.5rem;
  padding: 0.75rem 0.95rem; border-radius: 8px;
  font-size: 0.875rem; line-height: 1.5; margin-bottom: 1.25rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error   { background: rgba(239,68,68,0.09);  border: 1px solid rgba(239,68,68,0.28);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.09);  border: 1px solid rgba(34,197,94,0.28);  color: #86efac; }
.alert-info    { background: rgba(108,99,255,0.09); border: 1px solid rgba(108,99,255,0.28); color: var(--accent-light); }
.alert-icon    { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* ── Footer switch ────────────────────────────────────────────────────────── */
.auth-switch { text-align: center; margin-top: 1.4rem; font-size: 0.85rem; color: var(--muted); }
.auth-switch a { color: var(--accent-light); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.auth-switch a:hover { color: #fff; }

/* ── Password strength ────────────────────────────────────────────────────── */
.strength-wrap  { margin-top: 0.45rem; }
.strength-track { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 0.3rem; }
.strength-fill  { height: 100%; border-radius: 2px; width: 0%; transition: width 0.3s, background 0.3s; }
.strength-label { font-size: 0.74rem; color: var(--muted); min-height: 1em; }

/* ── Success state ────────────────────────────────────────────────────────── */
.success-state    { text-align: center; padding: 1rem 0; animation: cardIn 0.3s ease; }
.success-icon     { font-size: 3rem; margin-bottom: 1rem; display: block; }
.success-state h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.success-state p  { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* Redirect progress bar */
.redirect-bar-wrap { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 1.25rem; }
.redirect-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); width: 0%; transition: width 1.5s ease; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .auth-card-wide { grid-template-columns: 1fr; max-width: 440px; }
  .auth-brand { display: none; }
  .auth-form-panel { padding: 2rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body.auth-body { padding: 1rem; align-items: flex-start; padding-top: 2rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}
