@charset "utf-8";
/* ==========================================================================
   Royal Pay · base compartilhada (painel, checkout e obrigado)
   Marca: navy #0A1628 + dourado #C9A84C, fonte Inter.
   Sem estilo inline em lugar nenhum: tudo aqui (CSP sem 'unsafe-inline').
   ========================================================================== */

:root {
  --navy-950: #060E1C;
  --navy-900: #0A1628;
  --navy-850: #0E1C33;
  --navy-800: #12213A;
  --navy-700: #1B2D4D;
  --gold: #C9A84C;
  --gold-light: #E8D5A0;
  --gold-ink: #7D6219;          /* dourado para texto em fundo claro (5.9:1) */

  --ink: #0A1628;
  --ink-2: #3D4759;             /* 9.4:1 em branco */
  --ink-3: #5B6475;             /* 5.9:1 em branco */
  --placeholder: #6B7385;       /* 4.8:1 em branco */

  --on-navy: #FFFFFF;
  --on-navy-2: #B8C0CE;         /* 10:1 em navy */
  --on-navy-3: #8D97A8;         /* 6.2:1 em navy */
  --navy-line: rgba(255, 255, 255, .10);

  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --line: #E4E6EB;
  --line-strong: #CDD2DB;

  --danger: #B42318;
  --danger-ink: #7A271A;
  --danger-bg: #FEF3F2;
  --danger-line: #FECDCA;
  --success: #067647;
  --success-bg: #ECFDF3;
  --success-line: #ABEFC6;
  --pending: #7A4E00;
  --pending-bg: #FFF5DB;
  --pending-line: #F5DDA0;
  --info: #1E3A8A;
  --info-bg: #EEF2FF;
  --info-line: #C7D2FE;
  --neutral: #4A5262;
  --neutral-bg: #EEF0F3;

  --focus: #0A1628;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-1: 0 1px 2px rgba(10, 22, 40, .05), 0 1px 3px rgba(10, 22, 40, .07);
  --shadow-2: 0 2px 4px rgba(10, 22, 40, .04), 0 12px 32px -8px rgba(10, 22, 40, .14);
  --shadow-3: 0 30px 80px -24px rgba(10, 22, 40, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-reset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Foco visível (WCAG 2.4.7 / 2.4.11) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.on-navy :focus-visible { outline-color: var(--gold); }
/* Títulos, avisos e o main recebem foco por script (leitor de tela); não são controles, então sem moldura */
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible, main[tabindex="-1"]:focus-visible, .alert[tabindex="-1"]:focus-visible { outline: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-word { font-weight: 700; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.brand-sub { font-size: 12px; color: var(--on-navy-3); letter-spacing: .02em; font-weight: 500; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 12px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-primary {
  background: var(--navy-900); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 1px 2px rgba(10, 22, 40, .25), 0 6px 16px -6px rgba(10, 22, 40, .45);
}
.btn-primary:hover:not([disabled]) { background: var(--navy-700); }
.btn-gold {
  background: linear-gradient(180deg, #D9BC63 0%, var(--gold) 100%); color: var(--navy-900);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(10, 22, 40, .25);
}
.btn-gold:hover:not([disabled]) { background: linear-gradient(180deg, #E2C77A 0%, #D1B158 100%); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.btn-secondary:hover:not([disabled]) { background: #F8F9FB; border-color: #B4BBC7; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not([disabled]) { background: rgba(10, 22, 40, .05); color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover:not([disabled]) { background: var(--danger-bg); border-color: #F5A59D; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover:not([disabled]) { background: #912018; }
.btn-whatsapp { background: #0F7A3F; color: #fff; box-shadow: 0 1px 2px rgba(10, 22, 40, .2); }
.btn-whatsapp:hover:not([disabled]) { background: #0B6634; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn-primary[disabled] { background: var(--navy-800); color: #DCE1E9; }
.btn-secondary[disabled] { color: var(--ink-3); }

.link-btn {
  background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link-btn:hover { text-decoration-thickness: 2px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.label .opt { color: var(--ink-3); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(10, 22, 40, .03);
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: 16px; /* 16px evita zoom automático no iPhone */
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%233D4759' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: #AEB6C3; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--navy-900);
  box-shadow: 0 0 0 1px var(--navy-900), 0 0 0 4px rgba(201, 168, 76, .45);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger);
}
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--danger), 0 0 0 4px rgba(180, 35, 24, .18); }
.input[disabled], .input[readonly], .select[disabled] { background: #F6F7F9; color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--danger); line-height: 1.4; font-weight: 500; }
.field-error svg { width: 14px; height: 14px; margin-top: 2px; flex: none; }

/* Campo com prefixo e sufixo (US$ ... USD) */
.affix { position: relative; display: flex; align-items: center; }
.affix .input { padding-left: 52px; padding-right: 58px; }
.affix-pre, .affix-post {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--ink-3); pointer-events: none;
}
.affix-pre { left: 14px; }
.affix-post { right: 14px; font-size: 12px; letter-spacing: .08em; }

/* Caixa de seleção */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; margin-top: 0;
  border: 1.5px solid var(--line-strong); border-radius: 6px; background: #fff; display: grid; place-items: center;
  transition: background-color .15s ease, border-color .15s ease; cursor: pointer;
}
.check input::after {
  content: ""; width: 11px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.check input:checked { background: var(--navy-900); border-color: var(--navy-900); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.check input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.check a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.check b { color: var(--ink); font-weight: 600; }

/* Interruptor (liga/desliga) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-text { display: grid; gap: 2px; font-size: 14px; }
.switch-text b { font-weight: 600; color: var(--ink); }
.switch-text small { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0;
  border-radius: 999px; background: #C3C9D3; transition: background-color .15s ease; cursor: pointer;
}
.switch input::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(10, 22, 40, .3); transition: transform .15s ease;
}
.switch input:checked { background: var(--navy-900); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- Alertas ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; line-height: 1.5;
}
.alert-icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }
.alert-danger .alert-icon { color: var(--danger); }
.alert-danger .link-btn, .alert-danger a { color: var(--danger-ink); }
.alert-success { background: var(--success-bg); border-color: var(--success-line); color: #054F31; }
.alert-success .alert-icon { color: var(--success); }
.alert-pending { background: var(--pending-bg); border-color: var(--pending-line); color: #5C3B00; }
.alert-pending .alert-icon { color: var(--pending); }
.alert-info { background: #F4F6FA; border-color: var(--line); color: var(--ink-2); }
.alert-info .alert-icon { color: var(--ink-3); }

/* ---------- Selos de status (texto + ícone, nunca só cor) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px 2px 8px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge svg { width: 13px; height: 13px; flex: none; }
.badge-paid { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.badge-pending { background: var(--pending-bg); color: var(--pending); border-color: var(--pending-line); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge-expired { background: var(--neutral-bg); color: var(--neutral); border-color: #DADEE5; }
.badge-test { background: #FBF6E9; color: var(--gold-ink); border-color: #EBD9A6; letter-spacing: .02em; }

/* ---------- Esqueleto (carregando) ---------- */
.sk {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, #ECEEF2 0%, #F6F7F9 45%, #ECEEF2 90%);
  background-size: 220% 100%; animation: sk 1.4s ease-in-out infinite;
}
.on-navy .sk { background: linear-gradient(90deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.14) 45%, rgba(255,255,255,.07) 90%); background-size: 220% 100%; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -120% 0; } }
.sk-h10 { height: 10px; } .sk-h12 { height: 12px; } .sk-h14 { height: 14px; } .sk-h20 { height: 20px; }
.sk-h28 { height: 28px; } .sk-h44 { height: 44px; } .sk-h46 { height: 46px; } .sk-h48 { height: 48px; } .sk-h54 { height: 54px; }
.sk-w20 { width: 20%; } .sk-w30 { width: 30%; } .sk-w40 { width: 40%; } .sk-w50 { width: 50%; }
.sk-w60 { width: 60%; } .sk-w70 { width: 70%; } .sk-w80 { width: 80%; } .sk-w100 { width: 100%; }
.sk-round { border-radius: 999px; }

/* ---------- Medalhão de ícone ---------- */
.medal {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 30% 25%, #E8D5A0 0%, var(--gold) 55%, #A9862F 100%);
  color: var(--navy-900);
  box-shadow: 0 0 0 6px rgba(201, 168, 76, .14), 0 10px 24px -8px rgba(169, 134, 47, .6);
}
.medal svg { width: 28px; height: 28px; }
.medal-neutral { background: #EEF0F3; color: var(--ink-2); box-shadow: 0 0 0 6px rgba(10, 22, 40, .04); }
.medal-soft { background: #FBF6E9; color: var(--gold-ink); box-shadow: 0 0 0 6px rgba(201, 168, 76, .10); }
.medal-danger { background: var(--danger-bg); color: var(--danger); box-shadow: 0 0 0 6px rgba(180, 35, 24, .06); }

/* ---------- Aviso flutuante ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: calc(100vw - 32px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3);
  transition: opacity .2s ease, transform .2s ease;
}
.toast svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Selo do modo de demonstração (só local, ?demo=1) ---------- */
.rp-demo {
  display: block; width: max-content; max-width: calc(100% - 24px); margin: 16px auto;
  grid-column: 1 / -1;
  background: rgba(6, 14, 28, .92); color: var(--gold-light); border: 1px solid rgba(201, 168, 76, .45);
  border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner { animation: spin 1.6s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: 1.6s !important; }
}
