/* Secondary screens: auth, settings, billing, audit, accounts, landing. They
   lean on base.css; this file only adds their layout. */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 48px; align-items: center; max-width: 900px; margin: 24px auto 0; }
.auth-copy h1 { font-size: 2rem; margin-bottom: 12px; }
.auth-copy p { color: var(--ink-muted); max-width: 40ch; }
.auth-card { padding: 28px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: var(--shadow-md); }
.auth-card h2 { margin: 0 0 16px; font-size: 1.3rem; }
.auth-card button[type=submit] { width: 100%; margin-top: 4px; }
.auth-alt { margin: 16px 0 0; text-align: center; font-size: 0.93rem; color: var(--ink-muted); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--ink-muted); font-size: 0.86rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#passkey-btn { width: 100%; }
#passkey-btn img { width: 22px; height: 22px; }

.settings-page > section, .profile-card { margin-bottom: 32px; }
.profile-card { max-width: 520px; }
.profile-card h2, .settings-page h2 { margin-top: 0; }
.profile-fields { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.profile-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.profile-field:last-child { border-bottom: 0; }
.profile-field dt { color: var(--ink-muted); }
.profile-field dd { margin: 0; overflow-wrap: anywhere; }
#user-mgmt, .table-wrap { overflow-x: auto; }
#user-mgmt td { vertical-align: middle; }
#cfg-form, .settings-page form { max-width: 520px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.filter-bar label { margin: 0; width: 220px; max-width: 100%; }
.filter-bar label.narrow { width: 110px; }
#log-container, #account-list-wrap { overflow-x: auto; }

.stub-notice { display: inline-flex; align-items: center; font-size: 0.86rem; color: var(--ink-muted); }

/* --- billing ------------------------------------------------------------ */
.billing-page { max-width: 760px; }
.billing-page > section { margin: 1.5rem 0; }
.billing-account {
  max-width: 440px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.billing-balance {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.billing-balance h2 { margin-top: 0; }
.billing-balance-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.billing-balance .notice { margin: 0.35rem 0 0; }
.billing-balance button { flex-shrink: 0; }
.billing-packs { list-style: none; border-top: 1px solid var(--border); }
.billing-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.billing-pack div { display: grid; gap: 0.1rem; }
.billing-pack span { color: var(--ink-muted); font-size: 0.88rem; }
.billing-pack button { margin: 0; flex-shrink: 0; }
.billing-history { padding-top: 0.25rem; }
.billing-history h2 { margin-bottom: 0.25rem; }
.billing-table-wrap { overflow-x: auto; }
.billing-empty { max-width: 560px; border: 1px solid var(--border); padding: 0.9rem 1rem; background: var(--surface-alt); }
.billing-empty h2 { margin-top: 0; }

@media (max-width: 520px) {
  .billing-balance, .billing-pack { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
  .billing-balance button, .billing-pack button { width: 100%; margin: 0; }
  .billing-history table, .billing-history thead, .billing-history tbody, .billing-history tr, .billing-history th, .billing-history td { display: block; }
  .billing-history thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .billing-history tr { padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
  .billing-history td { border: 0; padding: 0.08rem 0; }
  .billing-history td::before { content: attr(data-label) ': '; color: var(--ink-muted); font-size: 0.8rem; }
}


/* --- logo, QR ------------------------------------------------------------ */
.logo { mix-blend-mode: var(--logo-blend); background: var(--logo-plate); padding: var(--logo-plate-pad); border-radius: var(--radius); object-fit: contain; }
/* QR codes stay black on white so they remain scannable in every theme. */
.qr { display: block; max-width: 180px; margin-top: 8px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }

/* --- theme picker ------------------------------------------------------- */
.theme-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-muted);
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  margin: 0;
}
.theme-swatch:hover { border-color: var(--accent); }
.theme-swatch[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.theme-chip {
  width: 1.5rem;
  height: 0.9rem;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
  border: 1px solid rgba(128, 128, 128, 0.45);
}

/* --- landing page ------------------------------------------------------- */
.landing { display: flex; flex-direction: column; gap: calc(var(--space) * 2.5); }

.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: calc(var(--space) * 1.5) 0;
}
.hero-copy { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 0.9rem; }
.hero-copy h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  line-height: 1.12;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  max-width: 18ch;
  text-wrap: balance;
  letter-spacing: var(--head-tracking);
}
.hero-copy p { color: var(--ink-muted); max-width: 52ch; }
.hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.hero-actions button { margin-top: 0; }
.hero .logo { max-width: 200px; max-height: 200px; flex-shrink: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.85rem;
}
.feature {
  background: var(--surface-alt);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.feature h2 { margin: 0; font-size: 0.95rem; }
.feature p { font-size: 0.88rem; color: var(--ink-muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem; }
.step { display: flex; flex-direction: column; gap: 0.3rem; }
.step-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  border-bottom: var(--rule-weight) solid var(--rule);
  padding-bottom: 0.25rem;
  margin-bottom: 0.2rem;
}
.step h2 { margin: 0; font-size: 0.92rem; }
.step p { font-size: 0.88rem; color: var(--ink-muted); }

.landing-cta {
  border-top: var(--rule-weight) solid var(--rule);
  padding-top: calc(var(--space) * 1.5);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}
.landing-cta h2 { margin: 0; font-size: 1.1rem; }
.landing-cta p { color: var(--ink-muted); max-width: 52ch; font-size: 0.92rem; }

.landing-foot {
  border-top: 1px solid var(--border);
  padding: 1rem 0 2rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}


@media (max-width: 760px) {
  .auth { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 0; }
  .auth-copy h1 { font-size: 1.6rem; }
  .auth-card { padding: 20px; }
  .profile-field { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hero { gap: 1.25rem; }
  .hero .logo { max-width: 130px; max-height: 130px; }
}
