/* PhoneReady shared base: reset, type, buttons, form, the sheet card, call bar.
 * Every colour and font comes from tokens.css. Each mockup layers its own styles.css on top.
 */

/* ---------- Reset + page ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-variant-numeric: lining-nums;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}
p { margin: 0; }
p, li { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
a:active { color: var(--color-brand-deep); }
.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--page-gutter); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-ink-2); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus: instant, never animated, >= 3:1 against the page */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

/* ---------- Wordmark + logo mark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-md); letter-spacing: -0.01em;
  color: var(--color-ink); text-decoration: none; white-space: nowrap;
}
.wordmark__ready { color: var(--color-brand); }
.mark { flex: none; }
.mark__bg { fill: var(--color-mark-bg); }
.mark__phone { fill: none; stroke: var(--color-mark-line); stroke-width: 2.2; }
.mark__check { fill: none; stroke: var(--color-mark-check); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons: all eight states ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--tap); padding: 0 var(--space-lg);
  border: 2px solid transparent; border-radius: var(--radius-btn);
  font: inherit; font-weight: 700; font-size: var(--text-base); line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.btn--primary { background: var(--color-brand); color: var(--color-brand-ink); }
.btn--outline { background: transparent; color: var(--color-brand); border-color: var(--color-brand); }
.btn--block   { display: flex; width: 100%; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--color-brand-deep); transform: translateY(-1px); }
  .btn--outline:hover { background: var(--color-brand-soft); transform: translateY(-1px); }
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[data-state="loading"] { cursor: progress; }
.btn[data-state="loading"]::after {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.btn[data-state="error"]   { background: var(--color-no-soft); color: var(--color-error); border-color: var(--color-error); }
.btn[data-state="success"] { background: var(--color-yes-soft); color: var(--color-yes); border-color: var(--color-yes); }
@keyframes spin { to { transform: rotate(360deg); } }

.call-icon { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

/* Typographic link (C3) */
.link {
  color: var(--color-brand); font-weight: 700; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.2em; white-space: nowrap;
  transition: text-decoration-thickness var(--dur-micro) var(--ease-out);
}
@media (hover: hover) { .link:hover { text-decoration-thickness: 3px; } }

/* ---------- The sheet card (kept exactly as Shawn approved) ---------- */
.sheet-card {
  width: 100%; max-width: 26rem;
  background: var(--color-card); color: var(--color-card-ink);
  border: var(--rule-hair) solid var(--color-card-rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform: rotate(-1.2deg);
}
.sheet-card__top {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm);
  padding: var(--space-md); background: var(--color-card-head); color: var(--color-card-head-ink);
}
.sheet-card__top strong { font-family: var(--font-display); font-size: var(--text-base); }
.sheet-card__top small  { font-size: var(--text-xs); opacity: 0.9; }
.sheet-card__row {
  display: flex; justify-content: space-between; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-card-rule);
  font-size: var(--text-sm);
}
.sheet-card__row span { color: var(--color-card-ink-2); }
.sheet-card__row b    { text-align: right; }
.sheet-card__row--hl  { background: var(--color-card-hl); }
.sheet-card__mark {
  display: flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: var(--space-xs); font-size: var(--text-xs); font-weight: 700; color: var(--color-card-ink-2);
}

/* ---------- First-bill table (sample numbers) ---------- */
.bill { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bill th, .bill td { padding: var(--space-sm) 0; border-bottom: var(--rule-hair) dashed var(--color-rule-2); text-align: left; vertical-align: top; }
.bill th { font-weight: 400; }
.bill th small { display: block; color: var(--color-ink-2); font-size: var(--text-xs); }
.bill td { text-align: right; font-weight: 700; white-space: nowrap; padding-left: var(--space-md); }
.bill tfoot th, .bill tfoot td { border-bottom: 0; font-weight: 700; font-size: var(--text-md); padding-top: var(--space-sm); }
.tag {
  display: inline-block; padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-pill);
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- Portrait placeholder (Shawn's photo goes here) ---------- */
.portrait {
  flex: none; display: grid; place-items: center;
  width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: var(--color-brand-soft); color: var(--color-brand);
  border: 3px solid var(--color-accent);
  font-family: var(--font-display); font-weight: 700; font-size: 1.75rem;
}

/* ---------- The request form: five fields, nothing else ---------- */
.form { display: grid; gap: var(--space-md); }
.field { display: grid; gap: var(--space-xs); }
.field label { font-weight: 700; font-size: var(--text-sm); }
.field input {
  width: 100%; min-height: var(--tap); padding: 0 var(--space-md);
  font: inherit; font-size: var(--text-base); color: var(--color-ink);
  background: var(--color-surface);
  border: var(--rule-hair) solid var(--color-field-border); border-radius: var(--radius-input);
  outline: 2px solid transparent; outline-offset: 1px;
  transition: background-color var(--dur-short) var(--ease-out);
}
.field input::placeholder { color: var(--color-muted); }
@media (hover: hover) { .field input:hover { background: var(--color-paper-2); } }
.field input:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-ink-2); }
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.field input[aria-invalid="true"] { border-color: var(--color-error); }
.field__help { min-height: 1lh; font-size: var(--text-xs); color: var(--color-ink-2); }
.field__help.is-error { color: var(--color-error); font-weight: 700; }
.field__help.is-error::before { content: "⚠ "; }
.form__note { font-size: var(--text-xs); color: var(--color-ink-2); }
.form__fail { font-size: var(--text-sm); color: var(--color-error); }
.form__fail a { color: inherit; font-weight: 700; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-done {
  padding: var(--space-lg); border-radius: var(--radius-card);
  background: var(--color-brand-soft); color: var(--color-ink);
  font-size: var(--text-md);
}
.form-done b { font-family: var(--font-display); }

/* ---------- Call bar (C4). Knobs are set per mockup. ---------- */
.call-bar {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky);
  display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) max(var(--space-md), env(safe-area-inset-bottom));
  background: var(--color-paper); border-top: var(--rule-hair) solid var(--color-rule);
  transition: transform var(--dur-short) var(--ease-out);
}
.call-bar .btn { width: 100%; padding-inline: var(--space-sm); }
.call-bar.is-hidden { transform: translateY(110%); }
@media (min-width: 60rem) { .call-bar { display: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .btn[data-state="loading"]::after { animation: none; border-right-color: currentColor; opacity: 0.5; }
}
