/* auth.css - Phase 6 auth UI. Reuses tokens from theme-override.css where
 * possible. Kept small (targets under 5 KB).
 */

.auth-body {
  background: var(--surface-warm, #fdfbf4);
  color: var(--gray-900, #0f172a);
  font-family: var(--font-body, "DM Sans", system-ui, sans-serif);
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-brand {
  font-family: var(--font-display, "DM Sans", system-ui, sans-serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--color-accent-strong, #0f766e);
  text-decoration: none;
  text-align: center;
}

.auth-card {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-card-wide { max-width: 540px; }

.auth-title {
  font-family: var(--font-display, "DM Sans", system-ui, sans-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--gray-900, #0f172a);
}

.auth-subtitle {
  font-family: var(--font-display, "DM Sans", system-ui, sans-serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--gray-900, #0f172a);
}

.auth-sub {
  color: var(--gray-600, #475569);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--gray-700, #334155);
  font-weight: 500;
}

.auth-form small {
  color: var(--gray-500, #64748b);
  font-size: 0.75rem;
  font-weight: 400;
}

.auth-form input {
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: var(--surface-card, #ffffff);
  color: var(--gray-900, #0f172a);
}

.auth-form input:focus {
  outline: 2px solid var(--color-accent-strong, #0f766e);
  outline-offset: 1px;
  border-color: var(--color-accent-strong, #0f766e);
}

.auth-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color 120ms, box-shadow 120ms;
  text-decoration: none;
  display: inline-block;
}

.auth-btn:disabled { opacity: 0.6; cursor: wait; }

.auth-btn-primary {
  background: var(--color-accent-strong, #0f766e);
  color: #ffffff;
}
.auth-btn-primary:hover:not(:disabled) { background: var(--color-accent, #14b8a6); }

.auth-btn-secondary {
  background: var(--surface-card, #ffffff);
  color: var(--gray-900, #0f172a);
  border-color: var(--gray-300, #cbd5e1);
}
.auth-btn-secondary:hover:not(:disabled) { background: var(--gray-100, #f1f5f9); }

.auth-status { font-size: 0.875rem; margin: 4px 0 0; min-height: 1em; color: var(--gray-500, #64748b); }
.auth-status-ok    { color: var(--color-success-strong, #047857); }
.auth-status-warn  { color: var(--color-warning-strong, #b45309); }
.auth-status-error { color: var(--color-danger-strong, #b91c1c); }
.auth-status-info  { color: var(--gray-600, #475569); }

.auth-banner {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin: 0 0 16px;
  border: 1px solid transparent;
}
.auth-banner-ok   { background: var(--surface-success, #ecfdf5); color: var(--color-success-strong, #047857); border-color: var(--color-success-border, #a7f3d0); }
.auth-banner-warn { background: var(--surface-warning, #fffbeb); color: var(--color-warning-strong, #b45309); border-color: var(--color-warning-border, #fde68a); }

.auth-meta {
  font-size: 0.875rem;
  color: var(--gray-600, #475569);
  margin: 16px 0 0;
  text-align: center;
}

.auth-meta a { color: var(--color-accent-strong, #0f766e); }

.auth-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.9rem;
  margin: 0 0 20px;
}
.auth-kv dt { color: var(--gray-600, #475569); font-weight: 500; }
.auth-kv dd { margin: 0; color: var(--gray-900, #0f172a); }

.auth-list { padding-left: 20px; margin: 0 0 16px; }
.auth-list li {
  margin: 4px 0;
  color: var(--gray-700, #334155);
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-btn-inline {
  font: inherit;
  background: transparent;
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--color-danger-strong, #b91c1c);
  cursor: pointer;
}
.auth-btn-inline:hover:not(:disabled) { background: var(--surface-subtle, #f1f5f9); }

.auth-form-inline {
  flex-direction: row;
  align-items: end;
  gap: 12px;
}
.auth-form-inline label { flex: 1; }

/* SG_AUTH_LIGHT_ONLY_V1 (2026-04-22) — removed auto @media (prefers-color-scheme: dark)
 * block that previously turned signup/login/forgot pages dark for OS-dark users.
 * Dark block only styled inputs; auth-title, auth-sub, labels, and small hint text
 * kept their default near-black color → unreadable on dark bg. Autofill bgs also
 * clashed. No in-app theme toggle exists on auth surfaces (toggle lives in authed
 * sidebar), so there was no way for users to reverse it. Auth pages are now
 * always light. `<meta name="color-scheme" content="light">` in _layout.phtml
 * also pins browser-chrome (autofill, scrollbars) to light.
 * Authed pages keep their html[data-theme="dark"] overrides (below). */


/* Billing section (2026-04-22) — account.phtml Billing block */
.sg-billing { margin: 16px 0 28px; }
.sg-billing-current { background: var(--gray-50, #f8fafc); border: 1px solid var(--gray-200, #e2e8f0); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.sg-billing-current p { margin: 0 0 8px; color: var(--gray-800, #1e293b); font-size: 14px; }
.sg-billing-current p:last-child { margin-bottom: 0; }
.sg-billing-credits { font-size: 13px !important; color: var(--gray-600, #475569) !important; }
.sg-billing-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500, #64748b); margin: 16px 0 10px; }
.sg-billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.sg-billing-card { border: 1px solid var(--gray-200, #e2e8f0); border-radius: 12px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.sg-billing-card.is-current { border-color: var(--accent-600, #2563eb); background: rgba(37, 99, 235, 0.04); }
.sg-billing-card-enterprise { background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(99, 102, 241, 0.04)); }
.sg-billing-card h4 { font-size: 14px; font-weight: 700; margin: 0; color: var(--gray-900, #0f172a); text-transform: uppercase; letter-spacing: 0.04em; }
.sg-billing-price { font-size: 26px; font-weight: 800; margin: 0; color: var(--gray-900, #0f172a); line-height: 1; }
.sg-billing-price span { font-size: 13px; font-weight: 500; color: var(--gray-500, #64748b); margin-left: 3px; }
.sg-billing-price-yr { font-size: 11px; color: var(--gray-500, #64748b); margin: 0; }
.sg-billing-feats { list-style: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--gray-700, #334155); display: flex; flex-direction: column; gap: 4px; }
.sg-billing-feats li { padding-left: 14px; position: relative; line-height: 1.4; }
.sg-billing-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-600, #2563eb); font-weight: 700; }
.sg-billing-card .auth-btn { margin-top: 6px; width: 100%; }
.sg-billing-card .auth-form-inline { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sg-billing-card .auth-form-inline .auth-btn { width: 100%; }
.sg-billing-packs { margin-top: 20px; }
.sg-billing-packgrid { display: flex; gap: 10px; flex-wrap: wrap; }
.sg-billing-packgrid form { flex: 0 0 auto; }
.sg-billing-packgrid .auth-btn { font-size: 13px; }

.sg-billing-headline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; }
.sg-billing-headline .sg-billing-h3 { margin: 0; }
.sg-billing-toggle { display: inline-flex; padding: 3px; background: var(--gray-100, #f1f5f9); border: 1px solid var(--gray-200, #e2e8f0); border-radius: 999px; gap: 2px; }
.sg-billing-toggle-btn { appearance: none; border: 0; background: transparent; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-600, #475569); border-radius: 999px; cursor: pointer; line-height: 1.2; transition: background 120ms ease, color 120ms ease; }
.sg-billing-toggle-btn:hover { color: var(--gray-900, #0f172a); }
.sg-billing-toggle-btn.is-active { background: #fff; color: var(--gray-900, #0f172a); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.sg-billing-toggle-save { font-size: 11px; font-weight: 700; color: var(--accent-600, #2563eb); margin-left: 4px; }

.sg-cancel-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sg-cancel-banner p { margin: 0; flex: 1 1 auto; }
.sg-cancel-banner-action { margin: 0; flex: 0 0 auto; }
.sg-cancel-banner-action .auth-btn { width: auto; }

html[data-theme="dark"] .sg-billing-toggle { background: var(--gray-800, #1e293b); border-color: var(--gray-700, #334155); }
html[data-theme="dark"] .sg-billing-toggle-btn { color: var(--gray-300, #cbd5e1); }
html[data-theme="dark"] .sg-billing-toggle-btn:hover { color: var(--gray-100, #f1f5f9); }
html[data-theme="dark"] .sg-billing-toggle-btn.is-active { background: var(--gray-700, #334155); color: var(--gray-100, #f1f5f9); }
html[data-theme="dark"] .sg-billing-toggle-save { color: #60a5fa; }

html[data-theme="dark"] .sg-billing-current { background: var(--gray-800, #1e293b); border-color: var(--gray-700, #334155); }
html[data-theme="dark"] .sg-billing-current p { color: var(--gray-200, #e2e8f0); }
html[data-theme="dark"] .sg-billing-credits { color: var(--gray-400, #94a3b8) !important; }
html[data-theme="dark"] .sg-billing-card { background: var(--gray-800, #1e293b); border-color: var(--gray-700, #334155); }
html[data-theme="dark"] .sg-billing-card h4 { color: var(--gray-100, #f1f5f9); }
html[data-theme="dark"] .sg-billing-card.is-current { border-color: #60a5fa; background: rgba(59, 130, 246, 0.12); }
html[data-theme="dark"] .sg-billing-price { color: var(--gray-100, #f1f5f9); }
html[data-theme="dark"] .sg-billing-feats { color: var(--gray-300, #cbd5e1); }
html[data-theme="dark"] .sg-billing-feats li::before { color: #60a5fa; }