/*
 * Auth shell — the shared look for every account-utility page
 * (web-rebuild 01/02: "all sign-in surfaces in this style").
 *
 * CANONICAL component file. Tokens come from css/colors_and_type.css (loaded
 * first by every page using this) — this file adds component classes and
 * NEVER new colors. Loaded by: reset-password.html, verify/index.html,
 * email/unsubscribe/index.html, open/index.html. The app at app.pawprint.company carries its
 * own copy of this look (pawprint-app src/styles); changes here should be
 * mirrored there.
 *
 * Retires the pre-redesign palette (#D4A843 gold / #1A1A2E navy) those pages
 * carried inline.
 */

.as-page {
  margin: 0;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-family: var(--pp-font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  -webkit-font-smoothing: antialiased;
}

/* <main> is the flex item of .as-page, and a flex item shrinks to fit its
   content — so without this the card's width:100% resolved against whatever
   the copy happened to need (252px of a 358px phone, and a card that jumped
   sideways when a longer error line appeared). */
.as-page > main {
  width: 100%;
}

.as-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.as-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.as-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
}
.as-brand span {
  font-family: var(--pp-font-display, inherit);
  font-size: 22px;
  font-weight: 600;
  color: var(--pp-text);
}

.as-card {
  background: var(--pp-card);
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  padding: 36px 30px 32px;
  box-shadow: 0 1px 2px rgba(56, 35, 18, 0.05);
}

.as-title {
  font-family: var(--pp-font-display, inherit);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-align: center;
}
/* Headings that take focus programmatically when a state replaces a form. */
.as-title:focus {
  outline: none;
}
/* Words people have to read use --pp-neutral-ink (5.8:1+ on both surfaces);
   --pp-text-secondary is 3.75-3.85:1, short of AA for small text. */
.as-sub {
  font-size: 14px;
  color: var(--pp-neutral-ink);
  text-align: center;
  margin: 0 0 22px;
}

/* The email-under-edit pill. On /reset-password it is a read-only
   <input autocomplete="username"> so password managers file the new password
   under the right account; the input resets below keep it looking like the
   old <div>. */
.as-chip {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  text-align: center;
  font-size: 14px;
  color: var(--pp-neutral-ink);
  margin: 0 0 22px;
  padding: 10px 16px;
  background: var(--pp-bg);
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}
.as-chip:focus {
  outline: 2px solid var(--pp-teal);
  outline-offset: 1px;
}

/* A text link inside card copy. --pp-teal is 2.45:1 as text, so links read as
   dark underlined words instead. */
.as-link {
  color: var(--pp-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* A one-time code shown for typing into the app (/verify). Digits are split
   into spans for a 3+3 gap, so selecting or copying still gives one run. */
.as-code {
  font-family: var(--pp-font-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--pp-text);
  text-align: center;
  background: var(--pp-bg);
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.as-code span + span {
  margin-left: 0.35em;
}

.as-group {
  margin-bottom: 16px;
  text-align: left;
}
.as-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.as-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  color: var(--pp-text);
  background: var(--pp-bg);
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.as-input:focus {
  outline: 2px solid var(--pp-teal);
  outline-offset: 1px;
  border-color: var(--pp-teal);
}
.as-input-error {
  border-color: var(--pp-error);
}
.as-field-error {
  display: none;
  font-size: 12.5px;
  color: var(--pp-error);
  margin-top: 6px;
}
.as-field-error.visible {
  display: block;
}
/* A field's rule, kept on screen while typing (a placeholder vanishes on the
   first keystroke). */
.as-hint {
  font-size: 12.5px;
  color: var(--pp-neutral-ink);
  margin-top: 6px;
}

/* A checkbox row, e.g. "Show passwords". The label is the 44px target. */
.as-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  margin: -8px 0 8px;
  font-size: 14px;
  cursor: pointer;
}
.as-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pp-text);
  cursor: pointer;
}
.as-check input:focus-visible {
  outline: 2px solid var(--pp-teal);
  outline-offset: 2px;
}

.as-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  color: var(--pp-text);
  background: var(--pp-primary);
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
}
.as-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.as-btn-quiet {
  background: transparent;
  border: 1px solid var(--pp-border);
  font-weight: 500;
}

.as-error {
  display: none;
  font-size: 13.5px;
  color: var(--pp-text);
  background: rgba(224, 82, 82, 0.09);
  border-left: 2px solid var(--pp-error);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 14px;
}
.as-error.visible {
  display: block;
}

.as-state {
  display: none;
  text-align: center;
}
.as-state.visible {
  display: block;
}
.as-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.as-state-ok .as-state-icon {
  background: var(--pp-tint-green);
  color: var(--pp-verified-green-ink);
}
.as-state-bad .as-state-icon {
  background: rgba(224, 82, 82, 0.1);
  color: var(--pp-error);
}
.as-state h2 {
  font-family: var(--pp-font-display, inherit);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 8px;
}
.as-state p {
  font-size: 14.5px;
  color: var(--pp-neutral-ink);
  margin: 0 0 8px;
}
.as-state .as-btn {
  margin: 18px 0 14px;
}

.as-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(56, 35, 18, 0.25);
  border-top-color: var(--pp-text);
  border-radius: 50%;
  animation: as-spin 0.6s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes as-spin {
  to { transform: rotate(360deg); }
}

.as-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12.5px;
  color: var(--pp-neutral-ink);
}
.as-foot a {
  color: var(--pp-neutral-ink);
}

@media (max-width: 480px) {
  .as-page {
    align-items: flex-start;
    padding-top: 44px;
  }
  .as-card {
    padding: 30px 22px 26px;
  }
}
