/* =====================================================
   Checkout Nortia — tokens extraídos de D:\nortia\branding
   Roxo #8C01FF (principal) · Rosa #EE28DE (acento)
   Fundo escuro validado · Tipografia Matter → Switzer
   ===================================================== */

/* O atributo hidden precisa vencer qualquer display: flex/grid declarado depois —
   sem isto, elemento escondido por JS (barra de garantia, selos, caixa do link) continua visível. */
[hidden] { display: none !important; }

:root {
  /* Brand */
  --n-primary: #8C01FF;
  --n-primary-warm: #9C1EE7;
  --n-accent: #EE28DE;
  --n-black: #000000;
  --n-white: #FFFFFF;
  --n-gradient: linear-gradient(135deg, #8C01FF 0%, #EE28DE 100%);

  /* Superfícies escuras */
  --bg: #0D1024;
  --surface: #161A38;
  --surface-raised: #1E2348;
  --border: #2B3160;
  --muted: #5B638F;
  --text-muted: #8791C4;
  --text: #F2F4FF;

  /* Estados */
  --success: #3DDC97;
  --danger: #FF6B81;

  --radius: 18px;
  --radius-sm: 11px;
  --shadow-card: 0 30px 80px -24px rgba(0, 0, 0, 0.65);
  --shadow-btn: 0 14px 34px -10px rgba(140, 1, 255, 0.55);
  --font: 'Switzer', 'General Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ============ BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(140, 1, 255, 0.22) 0%, transparent 60%),
    radial-gradient(820px 500px at 92% 4%, rgba(238, 40, 222, 0.14) 0%, transparent 55%),
    radial-gradient(1000px 640px at 50% 118%, rgba(140, 1, 255, 0.16) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fio de marca no topo */
.brand-strip {
  height: 4px;
  background: var(--n-gradient);
}

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 22px 20px 6px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  transition: opacity 0.2s, transform 0.2s;
}
.brand:hover .brand-logo { opacity: 0.85; transform: translateY(-1px); }

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #B9C2F2;
  background: rgba(140, 1, 255, 0.14);
  border: 1px solid rgba(140, 1, 255, 0.4);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.trust-pill svg { color: var(--n-accent); }

/* ============ LAYOUT ============ */
.layout {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 20px 48px;
  flex: 1;
  animation: fadeUp 0.5s ease both;
}

/* ============ CARD CHECKOUT ============ */
.checkout {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, #141735 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.checkout::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--n-gradient);
}

.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 28px 28px 24px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--n-accent);
  margin-bottom: 10px;
}
h1 {
  font-size: clamp(30px, 6vw, 38px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.05;
  color: var(--n-white);
  margin-bottom: 8px;
}
h1 em {
  font-style: normal;
  background: var(--n-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.product-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
}
.price-box { text-align: right; flex-shrink: 0; padding-top: 26px; }
.price {
  display: block;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--n-white);
  line-height: 1;
}
.price-installments {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-accent);
}

/* ============ FORM ============ */
form { padding: 0 28px 28px; }
fieldset { border: none; margin-top: 22px; }
legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  width: 100%;
}
legend::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--n-white);
  background: var(--n-gradient);
  box-shadow: 0 4px 12px -3px rgba(140, 1, 255, 0.5);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.field { position: relative; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #AAB3E0;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 12.5px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-raised);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--n-primary);
  background: #232a55;
  box-shadow: 0 0 0 4px rgba(140, 1, 255, 0.22);
}
.field input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.16);
}
.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23EE28DE' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* Bandeiras */
.brand-icons {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  min-height: 20px;
  flex-wrap: wrap;
}
.bi {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--muted);
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
}
.bi.active {
  opacity: 1;
  transform: translateY(-1px);
  border-color: var(--n-primary);
  color: var(--n-white);
  background: rgba(140, 1, 255, 0.18);
}

/* Abas de pagamento */
.payment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #10142e;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 18px;
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 11px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s;
}
.tab svg { flex-shrink: 0; }
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--n-gradient);
  color: var(--n-white);
  box-shadow: 0 6px 18px -6px rgba(140, 1, 255, 0.6);
}
.tab-panel { display: none; animation: fadeUp 0.3s ease both; }
.tab-panel.active { display: block; }

/* Pix */
.pix-intro {
  background: rgba(140, 1, 255, 0.08);
  border: 1px solid rgba(140, 1, 255, 0.35);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.pix-intro p { font-size: 14px; color: var(--text); line-height: 1.5; }
.pix-intro p strong { color: var(--n-white); }
.pix-intro ul {
  list-style: none;
  margin-top: 10px;
  display: grid;
  gap: 5px;
}
.pix-intro li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: #B9C2F2;
}
.pix-intro li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--n-accent);
  font-weight: 800;
}
.pix-qr {
  text-align: center;
  background: #10142e;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 20px;
}
.pix-qr img {
  width: 190px;
  height: 190px;
  border-radius: 12px;
  background: var(--n-white);
  padding: 10px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  animation: popIn 0.4s ease both;
}
.btn-copy {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--n-primary);
  background: rgba(140, 1, 255, 0.12);
  color: #D9C2FF;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: rgba(140, 1, 255, 0.25);
  color: var(--n-white);
  transform: translateY(-1px);
}
.pix-status {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.pix-status.paid { color: var(--success); }

/* Pagamento */
.pay-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.pay-amount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.pay-amount span { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.pay-amount strong { font-size: 26px; color: var(--n-white); letter-spacing: -0.5px; }

.btn-pay {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 17px;
  font-size: 16.5px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.2px;
  color: var(--n-white);
  background: var(--n-gradient);
  background-size: 170% 100%;
  background-position: 0% 0;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-position 0.4s, transform 0.15s, box-shadow 0.2s;
}
.btn-pay:hover {
  background-position: 100% 0;
  transform: translateY(-1.5px);
  box-shadow: 0 18px 40px -10px rgba(140, 1, 255, 0.7);
}
.btn-pay:active { transform: translateY(0); }
.btn-pay:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-ghost {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 18px;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--n-primary); }

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--n-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.secure-note {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.secure-note svg { color: var(--n-accent); flex-shrink: 0; }

.form-error {
  margin: 16px 28px 0;
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.4);
  color: #FFC2CC;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.5;
}

/* ============ SUCESSO ============ */
.success-card {
  background: linear-gradient(180deg, var(--surface) 0%, #141735 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 44px 30px;
  text-align: center;
}
.success-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--n-gradient);
  color: var(--n-white);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 36px -8px rgba(140, 1, 255, 0.65);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-card h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.success-card > p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.success-card > p strong { color: var(--n-white); }
.success-details {
  margin: 22px 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 13.5px;
  color: #D9C2FF;
  display: grid;
  gap: 4px;
}
.success-steps { text-align: left; }
.success-steps h3 { font-size: 14px; margin-bottom: 10px; color: var(--n-white); }
.success-steps ol { padding-left: 20px; display: grid; gap: 7px; }
.success-steps li { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

/* ============ GARANTIA + CONFIANÇA ============ */
.guarantee-bar {
  margin-top: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: linear-gradient(180deg, var(--surface) 0%, #141735 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.guarantee-badge {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--n-gradient);
  color: var(--n-white);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 10px 24px -8px rgba(140, 1, 255, 0.6);
}
.guarantee-bar p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.guarantee-bar strong { color: var(--n-white); }

.trust-strip {
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.trust-ico { font-size: 14px; }

/* ============ FOOTER ============ */
footer {
  text-align: center;
  padding: 10px 20px 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.footer-secure { font-size: 11px; opacity: 0.85; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--n-primary);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  z-index: 99;
  animation: fadeUp 0.3s ease both;
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ============ ANIMAÇÕES ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVO ============ */
@media (max-width: 560px) {
  .topbar { padding: 16px 16px 4px; }
  .brand-logo { height: 30px; }
  .layout { padding: 16px 12px 40px; }
  .order-summary { padding: 24px 20px 18px; }
  .price-box { text-align: left; padding-top: 6px; }
  .price { font-size: 28px; }
  form { padding: 0 20px 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-error { margin: 14px 20px 0; }
  .checkout, .success-card { border-radius: 20px; }
  .trust-strip { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
