/* auth.css — shared styles for all auth pages
   Uses same design tokens as ContentApp dark/light themes
   Include after your main style.css */

/* ── Page layout ─────────────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--auth-bg);
}

/* Dark theme (default) */
:root {
  --auth-bg:         #0d0f17;
  --auth-surface:    #111318;
  --auth-border:     #1e2235;
  --auth-border-mid: #2a2e45;
  --auth-text:       #e8eaf0;
  --auth-dim:        #8890b0;
  --auth-dimmer:     #3a3f5c;
  --auth-accent:     #7ecfff;
  --auth-accent-bg:  rgba(126,207,255,0.08);
  --auth-error:      #f87171;
  --auth-error-bg:   rgba(248,113,113,0.08);
  --auth-success:    #4ade80;
  --auth-success-bg: rgba(74,222,128,0.08);
  --auth-warning:    #facc15;
  --auth-input-bg:   #0d0f17;
  --auth-google-bg:  #161920;
}

/* Light theme override */
[data-theme="light"] {
  --auth-bg:         #f8f9fc;
  --auth-surface:    #ffffff;
  --auth-border:     #dde1ee;
  --auth-border-mid: #c8cedf;
  --auth-text:       #1a1d2e;
  --auth-dim:        #5a6080;
  --auth-dimmer:     #9098b8;
  --auth-accent:     #1a6fa8;
  --auth-accent-bg:  rgba(26,111,168,0.06);
  --auth-error:      #dc2626;
  --auth-error-bg:   rgba(220,38,38,0.06);
  --auth-success:    #16a34a;
  --auth-success-bg: rgba(22,163,74,0.06);
  --auth-warning:    #d97706;
  --auth-input-bg:   #ffffff;
  --auth-google-bg:  #f1f3f8;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 2rem;
}

/* ── Brand ───────────────────────────────────────────────────────────────── */

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-accent);
  letter-spacing: -0.02em;
}

.auth-brand-sub {
  font-size: 0.8rem;
  color: var(--auth-dim);
  margin-top: 0.25rem;
}

/* ── Headings ────────────────────────────────────────────────────────────── */

.auth-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--auth-text);
  margin: 0 0 0.35rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--auth-dim);
  margin: 0 0 1.5rem;
}

/* ── Form ────────────────────────────────────────────────────────────────── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--auth-dim);
}

.auth-input {
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  color: var(--auth-text);
  padding: 0.65rem 0.875rem;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--auth-accent);
}

.auth-input.error {
  border-color: var(--auth-error);
}

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

.auth-input-wrap .auth-input {
  padding-right: 2.5rem;
}

.auth-input-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-dimmer);
  cursor: pointer;
  font-size: 16px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}

/* ── Field hint / error ──────────────────────────────────────────────────── */

.auth-hint {
  font-size: 0.75rem;
  color: var(--auth-dim);
}

.auth-error-msg {
  font-size: 0.75rem;
  color: var(--auth-error);
  display: none;
}

.auth-error-msg.visible {
  display: block;
}

/* ── Alert banner ────────────────────────────────────────────────────────── */

.auth-alert {
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  font-size: 0.82rem;
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
}

.auth-alert.visible { display: flex; }

.auth-alert--error {
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error);
  color: var(--auth-error);
}

.auth-alert--success {
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success);
  color: var(--auth-success);
}

.auth-alert--info {
  background: var(--auth-accent-bg);
  border: 1px solid var(--auth-accent);
  color: var(--auth-accent);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.auth-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.auth-btn--primary {
  background: var(--auth-accent);
  color: #0a0c14;
}

.auth-btn--primary:hover:not(:disabled) { opacity: 0.88; }

.auth-btn--ghost {
  background: transparent;
  border: 1px solid var(--auth-border);
  color: var(--auth-text);
}

.auth-btn--ghost:hover:not(:disabled) {
  background: var(--auth-accent-bg);
  border-color: var(--auth-accent);
}

/* ── Google button ───────────────────────────────────────────────────────── */

.auth-btn--google {
  background: var(--auth-google-bg);
  border: 1px solid var(--auth-border);
  color: var(--auth-text);
  font-weight: 500;
}

.auth-btn--google:hover { border-color: var(--auth-border-mid); }

.auth-btn--google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--auth-dimmer);
  font-size: 0.75rem;
}

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

/* ── OTP / verify inputs ─────────────────────────────────────────────────── */

.auth-otp-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.auth-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--mono, monospace);
}

.auth-otp-input:focus { border-color: var(--auth-accent); }
.auth-otp-input.filled { border-color: var(--auth-border-mid); }

/* ── Footer links ────────────────────────────────────────────────────────── */

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--auth-dim);
}

.auth-link {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover { text-decoration: underline; }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--auth-dim);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10,12,20,0.3);
  border-top-color: #0a0c14;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.auth-btn--primary.loading .auth-spinner { display: block; }
.auth-btn--primary.loading .auth-btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Password strength ───────────────────────────────────────────────────── */

.auth-strength {
  height: 3px;
  border-radius: 2px;
  background: var(--auth-border);
  margin-top: 0.35rem;
  overflow: hidden;
}

.auth-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}

/* ── Step indicator (for multi-step) ─────────────────────────────────────── */

.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.auth-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-border-mid);
  transition: background 0.2s, width 0.2s;
}

.auth-step.active {
  background: var(--auth-accent);
  width: 24px;
  border-radius: 4px;
}

.auth-step.done {
  background: var(--auth-success);
}