@font-face { font-family: 'Urbanist'; src: url(/factura/fonts/urbanist.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'RBNo2'; src: url(/factura/fonts/rbno2.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #111518;
  --ink-2: #3b4248;
  --muted: #6b747b;
  --bg: #f3f4f5;
  --card: #fff;
  --line: #e2e5e8;
  --field: #fff;
  --accent: #c8432f;
  --accent-ink: #fff;
  --ok: #1f7a4d;
  --error: #b3261e;
  --band: #f7f8f9;
  --shadow: 0 1px 2px rgba(17, 21, 24, .06), 0 8px 24px rgba(17, 21, 24, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f4f5; --ink-2: #c9cfd3; --muted: #8f9aa1; --bg: #0c0f11; --card: #151a1e; --line: #252d33; --field: #0f1316;
    --accent: #f16553; --accent-ink: #111518; --ok: #5cc98f; --error: #ff8a80; --band: #192026; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: inherit; }
.is-hidden { display: none !important; }

.top { background: #111518; color: #fff; }
.top__inner { max-width: 640px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.top__logo { display: block; width: 110px; height: 44px; object-fit: contain; }
.top__title { font: 700 15px/1 'RBNo2', 'Urbanist', sans-serif; letter-spacing: .08em; text-transform: uppercase; }

.page { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 16px; align-content: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px 20px; }

.banner { margin: 0; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.banner--test { background: var(--accent); color: var(--accent-ink); }

.step__title { margin: 0 0 4px; font: 700 24px/1.15 'RBNo2', 'Urbanist', sans-serif; letter-spacing: .01em; }
.step__lead { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.step--center { text-align: center; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.grid .field { margin: 0; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 0; }
.field__input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field);
  color: var(--ink); font: inherit; font-size: 16px; appearance: none; }
select.field__input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field__input:disabled { opacity: .55; }
.field__input--upper { text-transform: uppercase; }
.field__input--code { height: 56px; font-size: 22px; letter-spacing: .2em; text-transform: uppercase; text-align: center; font-weight: 700; }
.field__input.is-invalid { border-color: var(--error); }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { min-height: 0; margin: 0; font-size: 13px; font-weight: 600; color: var(--error); }
.field__error:empty { display: none; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice__opt { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.choice__opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input, .check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
  font: 700 16px/1 'Urbanist', sans-serif; text-decoration: none; cursor: pointer; width: 100%; white-space: nowrap; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .6; cursor: progress; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.actions .btn { padding: 0 12px; }

.help { margin-top: 16px; font-size: 14px; color: var(--muted); }
.help summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.help p { margin: 8px 0 0; }

.ticket__head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.ticket__eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ticket__ref { margin: 2px 0 0; font-weight: 700; font-size: 17px; }
.ticket__date { margin: 0; color: var(--muted); font-size: 14px; }
.ticket__total { text-align: right; }
.ticket__amount { margin: 2px 0 0; font: 700 26px/1.1 'RBNo2', 'Urbanist', sans-serif; }
.ticket__items { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.ticket__items li { display: flex; justify-content: space-between; gap: 12px; }
.ticket__items span:first-child { color: var(--ink-2); }
.ticket__pay { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.notice__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.notice__list { margin: 0; padding-left: 20px; }
.notice__why { margin: 10px 0 0; font-style: italic; color: var(--muted); font-size: 14px; }
.notice__why:empty { display: none; }

.review { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 8px; padding: 14px; background: var(--band); border-radius: 10px; font-size: 15px; }
.review dt { color: var(--muted); font-weight: 600; }
.review dd { margin: 0; font-weight: 600; word-break: break-word; }

.spinner { display: inline-block; width: 44px; height: 44px; margin: 8px auto 16px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done__mark { display: block; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 50%; background: var(--ok); position: relative; }
.done__mark::after { content: ''; position: absolute; left: 18px; top: 12px; width: 12px; height: 22px; border: solid #fff; border-width: 0 4px 4px 0; transform: rotate(45deg); }
.done__mail { margin: 8px 0 4px; font-size: 15px; color: var(--ink-2); }
.resend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.resend .field { margin: 0; }
.resend .btn { width: auto; }
.resend .field__error { grid-column: 1 / -1; }

.foot { text-align: center; padding: 20px 16px 28px; font-size: 13px; color: var(--muted); }
.foot p { margin: 2px 0; }

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .step__title { font-size: 22px; }
  .resend { grid-template-columns: 1fr; }
  .resend .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
