/* ==========================================================================
   Public/auth pages — Stripe light refresh
   ========================================================================== */

.public-page,
.auth-page {
  background: var(--bg-warm);
}

.public-shell,
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.public-shell {
  align-content: start;
  justify-items: center;
  gap: 16px;
  padding-top: clamp(48px, 12vh, 108px);
}

.public-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(680px, 100%);
}

.public-brand-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--primary-mist);
  font-size: 13px;
  font-weight: 700;
}

.public-heading h1,
.public-heading p {
  margin: 0;
  letter-spacing: 0;
}

.public-heading h1 {
  font-size: 24px;
  line-height: 1.2;
}

.public-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.panel,
.lookup-panel,
.auth-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  position: relative;
  padding: 22px;
  background: var(--surface);
}

.lookup-panel {
  width: min(720px, 100%);
  padding: 30px;
}

.public-compact {
  width: min(680px, 100%);
  padding: 18px;
}

.public-lookup-row {
  grid-template-columns: minmax(0, 1fr) 136px 124px;
}

.public-compact .result:empty {
  display: none;
}

.tutorial-panel {
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.tutorial-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.tutorial-panel summary::-webkit-details-marker {
  display: none;
}

.tutorial-panel summary::after {
  content: "+";
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
}

.tutorial-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.tutorial-panel[open] summary::after {
  content: "−";
}

.tutorial-panel ul {
  margin: 0;
  padding: 14px 22px 16px 38px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.tutorial-panel li::marker {
  color: var(--primary);
  font-weight: 600;
}

.auth-box {
  position: relative;
  width: min(440px, 100%);
  padding: 30px;
  overflow: hidden;
}

.brand-mark {
  width: fit-content;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--primary);
  background: var(--primary-mist);
  box-shadow: none;
  font-size: 13px;
  margin-bottom: 18px;
}

/* 5. Public lookup results */
.lookup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hint,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.56;
}

.with-icon {
  align-items: flex-start;
}

.with-icon svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.result {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.input-insight {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted-strong);
  background: var(--primary-mist);
  font-size: 12px;
  line-height: 1.45;
}

.input-insight[hidden] {
  display: none;
}

.input-insight svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.input-insight strong {
  color: var(--primary);
  white-space: nowrap;
}

.input-insight span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recent-lookups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.recent-lookups > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.recent-lookup {
  width: auto;
  min-height: 32px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--primary);
  border-color: var(--line);
  background: var(--primary-mist);
  box-shadow: none;
  font-size: 12px;
}

.recent-lookup:hover {
  color: #fff;
  background: var(--primary);
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.loading-state {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.code-wrap,
.lookup-result,
.lookup-error,
.account-card,
.password-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.code,
.message-code,
.failed-code {
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
  letter-spacing: .02em;
}

.copy-button,
.retry-button {
  border-radius: var(--radius-pill);
}

.copy-button.copied {
  background: var(--success);
}

.error-card,
.error-inline,
.lookup-error {
  color: var(--danger-hover);
}

@media (max-width: 720px) {
  .public-lookup-row,
  .lookup-row {
    grid-template-columns: 1fr;
  }

  .lookup-panel,
  .auth-box,
  .tutorial-panel,
  .panel {
    border-radius: var(--radius-lg);
  }

  .public-shell,
  .auth-page {
    padding: 16px;
  }

  .public-shell {
    padding-top: 32px;
  }

  .input-insight {
    align-items: flex-start;
    border-radius: var(--radius);
  }

  button {
    width: 100%;
  }
}
