/* ============================================================
   Account pages (login/signup) — minimal by design (Phase A).
   Reuses shared/css/hub.css's tokens and header/footer chrome
   verbatim (both stylesheets are linked together on these pages);
   this file only adds what hub.css has no reason to carry itself:
   a centered card and real form controls. The distinct platform
   brand for account pages is a later phase — see CONTRACT.md's
   Backend section.
   ============================================================ */

.auth-main {
  max-width: 420px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem 4rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
}

.auth-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.auth-card .lead {
  margin: 0 0 1.6rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

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

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

.auth-field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ink);
}

.auth-field input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.auth-field input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--indigo);
}

.auth-field .hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.auth-submit {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: var(--indigo);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover { background: var(--indigo-deep); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.4rem 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.auth-google:hover { border-color: var(--ink-faint); background: var(--surface-2); }
.auth-google svg { flex: none; }

.auth-switch {
  margin: 1.6rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-align: center;
}

.auth-error {
  display: none;
  font-size: 0.86rem;
  color: #B42318;
  background: #FEF3F2;
  border: 1px solid #FDA29B;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}
.auth-error[data-visible] { display: block; }

/* Explicit :root[data-theme] overrides always beat a bare @media rule on
   specificity (an attribute selector on :root outweighs the class alone),
   so this wins in both directions regardless of source order — same
   mechanism hub.css's own token blocks rely on. */
@media (prefers-color-scheme: dark) {
  .auth-error {
    color: #FDA29B;
    background: rgba(180, 35, 24, 0.14);
    border-color: rgba(180, 35, 24, 0.5);
  }
}
:root[data-theme="dark"] .auth-error {
  color: #FDA29B;
  background: rgba(180, 35, 24, 0.14);
  border-color: rgba(180, 35, 24, 0.5);
}
:root[data-theme="light"] .auth-error {
  color: #B42318;
  background: #FEF3F2;
  border-color: #FDA29B;
}

.auth-status {
  font-size: 0.84rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.auth-status a { color: var(--ink-soft); }
.auth-status button {
  font: inherit;
  font-size: inherit;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.auth-success {
  display: none;
  font-size: 0.86rem;
  color: #067647;
  background: #ECFDF3;
  border: 1px solid #ABEFC6;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}
.auth-success[data-visible] { display: block; }

@media (prefers-color-scheme: dark) {
  .auth-success {
    color: #75E0A7;
    background: rgba(6, 118, 71, 0.14);
    border-color: rgba(6, 118, 71, 0.5);
  }
}
:root[data-theme="dark"] .auth-success {
  color: #75E0A7;
  background: rgba(6, 118, 71, 0.14);
  border-color: rgba(6, 118, 71, 0.5);
}
:root[data-theme="light"] .auth-success {
  color: #067647;
  background: #ECFDF3;
  border-color: #ABEFC6;
}

.account-section-title {
  margin: 1.8rem 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.account-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}
.account-fields dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.account-fields dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-word;
}

@media (max-width: 480px) {
  .auth-main { padding: 2rem 1.1rem 3rem; }
  .auth-card { padding: 1.6rem 1.3rem; }
}
