/* Dovetly start page (account + payment).
   Base classes and tokens come from /shared/dovetly.css (design system, zone A1).
   The fallbacks below are wrapped in :where() so they carry zero specificity:
   any rule in dovetly.css wins over them, whatever the load order.
   Everything prefixed .start- is page-specific and owned by this page. */

/* ---------- fallbacks (zero specificity) ---------- */
:where(:root) {
  --terra: #c2410c; --terra-deep: #9a3412; --ink: #1f2430;
  --peach: #fde7dc; --stone: #f4f4f2; --line: #e9e7e4;
  --muted: #5f6673; --muted-2: #7b8290; --white: #ffffff;
  --running: #15803d; --error: #b91c1c; --attention: #9a3412;
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --font-display: 'Gabarito', 'Arial Black', Arial, sans-serif;
  --font-text: 'Figtree', 'Segoe UI', Arial, sans-serif;
  --container: 1180px;
}
:where(html) { -webkit-text-size-adjust: 100%; }
:where(body) { margin: 0; background: var(--stone); color: var(--ink); font-family: var(--font-text); font-size: 17px; line-height: 1.55; }
:where(h1, h2, h3) { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
:where(p) { margin: 0; }
:where(a) { color: var(--terra); }
:where(.muted) { color: var(--muted); }
:where(.small) { font-size: 14px; }
:where(.tnum) { font-variant-numeric: tabular-nums; }
:where(.row) { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
:where(.stack) { display: flex; flex-direction: column; gap: 12px; }
:where(.card) { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-sizing: border-box; }
:where(.card--peach) { background: var(--peach); border-color: transparent; }
:where(.btn) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 26px; border: 1.5px solid transparent; border-radius: var(--r-pill); background: var(--stone); color: var(--ink); font: 600 16px/1.2 var(--font-text); text-decoration: none; cursor: pointer; }
:where(.btn--primary) { background: var(--terra); color: var(--white); }
:where(.btn--primary:hover) { background: var(--terra-deep); }
:where(.btn--ink) { background: var(--ink); color: var(--white); }
:where(.btn--ghost) { background: transparent; border-color: #d6d3cf; color: var(--ink); }
:where(.btn--block) { width: 100%; }
:where(.btn:disabled) { opacity: 0.5; cursor: default; }
:where(.pill) { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: var(--r-pill); background: var(--stone); color: var(--ink); font: 600 14px/1.2 var(--font-text); text-decoration: none; }
:where(.pill--active) { background: var(--ink); color: var(--white); }
:where(.field) { display: flex; flex-direction: column; gap: 6px; }
:where(.field label) { font-size: 13px; font-weight: 600; }
:where(.field__hint) { font-size: 13px; color: var(--muted); }
:where(.field__error) { font-size: 13px; color: var(--error); }
:where(.input) { display: block; width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1.5px solid #d6d3cf; border-radius: var(--r-sm); background: var(--white); color: var(--ink); font: 400 16px/1.3 var(--font-text); }
:where(.input::placeholder) { color: var(--muted-2); }
:where(.input:focus) { outline: 3px solid var(--peach); outline-offset: 0; border-color: var(--terra); }
:where(.input[readonly]) { background: var(--stone); color: var(--muted); }
:where(.input--error) { border-color: var(--error); }
:where(.form-row) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
:where(.banner) { padding: 12px 16px; border-radius: var(--r-sm); background: var(--stone); font-size: 14px; }
:where(.banner--error) { background: #fdecec; color: var(--error); }
:where(.pair) { display: inline-flex; align-items: center; gap: 4px; }
:where(.pair__app) { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--stone); overflow: hidden; }
:where(.pair__app .app-logo) { display: block; width: 26px; height: 26px; object-fit: contain; }
:where(.pair--lg .pair__app) { width: 64px; height: 64px; }
:where(.pair--lg .pair__app .app-logo) { width: 36px; height: 36px; }
:where(.pair__joint) { flex: none; width: 8px; height: 8px; margin: 0 2px; border-radius: 2px; background: var(--terra); transform: rotate(45deg); }
:where(.visually-hidden) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

[hidden] { display: none !important; }

/* ---------- page ---------- */
.start-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 64px; background: var(--white); border-bottom: 1px solid var(--line); }
.start-logo { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.start-logo svg { display: block; height: 26px; width: auto; }
.start-crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.start-crumbs__current { color: var(--ink); font-weight: 600; }
.start-top__note { font-size: 14px; color: var(--muted); }

.start-main { max-width: 1200px; margin: 0 auto; padding: 40px 64px; box-sizing: border-box; }
.start-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.start-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.start-col--summary { gap: 16px; }

.card.start-card { display: flex; flex-direction: column; gap: 16px; padding: 28px 32px; border: 0; border-radius: 20px; }
.start-h1 { font-size: 26px; }
.start-h2 { font-size: 22px; }


.start-exists { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--stone); font-size: 15px; }
.start-link { font-size: 14px; font-weight: 500; color: var(--terra); text-decoration: underline; text-underline-offset: 2px; }

.start-methods { gap: 8px; }
.start-paddle { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--stone); }
.start-paddle svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.start-paddle__title { font-size: 15px; font-weight: 600; }
.start-paddle p { margin-top: 2px; font-size: 13px; color: var(--muted); }

.start-hint { padding: 12px 16px; border-radius: var(--r-sm); background: var(--peach); color: var(--attention); font-size: 14px; }
.start-hint a { color: var(--attention); font-weight: 600; }
.start-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.start-pay .btn { font-size: 16px; }
.start-pay__note { flex: 1; min-width: 180px; font-size: 13px; color: var(--muted); }
.start-terms { font-size: 13px; color: var(--muted); }
.start-terms a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.start-terms a:hover { color: var(--terra); }

.start-invoice { display: flex; flex-direction: column; gap: 14px; }
.start-invoice p { font-size: 15px; }

.start-result p { font-size: 16px; color: var(--muted); }
.start-result__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

.card.start-summary { display: flex; flex-direction: column; gap: 14px; padding: 24px 26px; border: 0; border-radius: 20px; color: var(--attention); }
.start-summary__head { display: flex; align-items: center; gap: 14px; }
.start-summary .pair__app { background: var(--white); }
.start-summary__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; color: var(--ink); }
.start-summary__sub { font-size: 13.5px; }
.start-summary__price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(154, 52, 18, 0.2); font-size: 14px; }
.start-summary__amount { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--ink); }
.start-summary__line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.start-skeleton { font-size: 14px; color: var(--attention); }

.card.start-after { display: flex; flex-direction: column; gap: 10px; padding: 22px 26px; border: 0; border-radius: 20px; font-size: 14.5px; color: var(--muted); }
.start-after__title { font-weight: 600; color: var(--ink); }

.card.start-empty { display: flex; flex-direction: column; gap: 12px; padding: 24px 26px; border: 0; border-radius: 20px; }
.start-empty p { font-size: 15px; color: var(--muted); }

/* mock Paddle overlay (?mock=1 only) */
.mock-paddle { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(31, 36, 48, 0.55); }
.mock-paddle__box { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 420px; padding: 28px 32px; border-radius: 20px; background: var(--white); box-sizing: border-box; }
.mock-paddle__title { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.mock-paddle__meta { font-size: 14px; color: var(--muted); word-break: break-word; }

@media (max-width: 1024px) {
  .start-top, .start-main { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 820px) {
  .start-grid { grid-template-columns: 1fr; gap: 20px; }
  .start-col--summary { order: -1; }
  .start-main { padding: 24px 20px; }
  .start-top { padding: 14px 20px; }
  .card.start-card { padding: 22px 20px; }
  .card.start-summary, .card.start-after, .card.start-empty { padding: 20px; }
}
@media (max-width: 560px) {
  .start-top, .start-main { padding-left: 16px; padding-right: 16px; }
  .start-top__note { display: none; }
  .start-crumbs { gap: 6px; }
  .start-h1 { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .start-pay .btn { width: 100%; }
  .start-result__actions .btn { width: 100%; }
}
