/* ============================================================
   CHECKOUTSX — CSS Principal
   Baseado no design de checkout.s6x.xyz/assinar
   Bootstrap 5 + Bootstrap Icons + Inter font
   ============================================================ */

/* --- Import Inter font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Variables --- */
:root {
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --header-bg:    #000000;
  --primary:      #000000;
  --primary-hover:#222222;
  --accent:       #22c55e;
  --accent-pale:  #dcfce7;
  --text:         #171717;
  --text-muted:   #525252;
  --text-light:   #737373;
  --border:       #e5e5e5;
  --border-focus: #171717;
  --radius-card:  12px;
  --radius-input: 8px;
  --radius-btn:   8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  --transition:   .18s ease;
}

/* --- Base --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
}

/* ============================================================
   HEADER
   ============================================================ */
.sx-header {
  background: var(--header-bg);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sx-header-logo {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sx-header-logo img { height: 28px; filter: brightness(0) invert(1); }

/* ============================================================
   BANNER (product image above card)
   ============================================================ */
.sx-banner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.sx-banner img {
  width: 100%;
  display: block;
  max-height: 340px;
  object-fit: cover;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.sx-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ============================================================
   CARD
   ============================================================ */
.sx-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ============================================================
   STEPS BAR
   ============================================================ */
.sx-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--primary);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  overflow: hidden;
}
.sx-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  cursor: default;
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  font-weight: 500;
  transition: background var(--transition);
  border-right: 1px solid rgba(255,255,255,.08);
  user-select: none;
}
.sx-step:last-child { border-right: none; }
.sx-step.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
}
.sx-step.done {
  color: rgba(255,255,255,.75);
}
.sx-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  background: rgba(255,255,255,.15);
  color: #fff;
  flex-shrink: 0;
  transition: all var(--transition);
}
.sx-step.active .sx-step-num {
  background: var(--accent);
  color: #fff;
}
.sx-step.done .sx-step-num {
  background: var(--accent);
  color: #fff;
}
.sx-step.active .sx-step-label {
  color: var(--text);
}

/* ============================================================
   STEP CONTENT
   ============================================================ */
.sx-body {
  padding: 28px 24px;
}
.sx-step-content { display: none; }
.sx-step-content.active { display: block; animation: fadeSlide .25s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.sx-section-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sx-section-title i { color: var(--text-muted); font-size: 1rem; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.sx-field {
  margin-bottom: 14px;
}
.sx-field label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sx-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.sx-field input::placeholder { color: var(--text-light); }
.sx-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.sx-field input.has-error { border-color: #ef4444; }
.sx-field .sx-error {
  font-size: .75rem;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}
.sx-field.error .sx-error { display: block; }
.sx-field.error input { border-color: #ef4444; }

/* ============================================================
   PLAN CARDS
   ============================================================ */
.sx-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.sx-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
  gap: 12px;
}
.sx-plan-card:hover { border-color: #a3a3a3; }
.sx-plan-card.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.sx-plan-card input[type=radio] { display: none; }
.sx-plan-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition);
}
.sx-plan-card.selected .sx-plan-radio {
  border-color: var(--text);
}
.sx-plan-card.selected .sx-plan-radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
}
.sx-plan-info { flex: 1; }
.sx-plan-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
.sx-plan-desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.sx-plan-price {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  white-space: nowrap;
}

/* Total row */
.sx-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
}
.sx-total-label {
  font-size: .9rem;
  color: var(--text-muted);
}
.sx-total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

/* ============================================================
   PAYMENT METHOD CARD
   ============================================================ */
.sx-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.sx-pay-method {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color var(--transition);
  background: var(--surface);
  text-align: center;
  position: relative;
}
.sx-pay-method:hover { border-color: #a3a3a3; }
.sx-pay-method.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.sx-pay-method-radio {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
}
.sx-pay-method.selected .sx-pay-method-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.sx-pay-method.selected .sx-pay-method-radio::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  margin: 3px;
}
.sx-pix-icon {
  width: 40px; height: 40px;
}
.sx-pay-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* PIX Box (revelado após clicar Gerar PIX) */
.sx-pix-box {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: #f9fafb;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  text-align: center;
}
.sx-pix-box.show { display: block; animation: fadeSlide .3s ease; }
.sx-pix-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.sx-pix-qr img {
  width: 200px; height: 200px;
  border-radius: 10px;
  border: 4px solid #e5e5e5;
}
.sx-pix-code-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.sx-pix-code-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .72rem;
  color: var(--text-muted);
  background: #fff;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  margin-bottom: 10px;
}
.sx-pix-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 14px;
}
.sx-pix-copy-btn:hover { background: #f5f5f5; }
.sx-pix-copy-btn.copied {
  background: var(--accent-pale);
  border-color: var(--accent);
  color: #16a34a;
}
.sx-pix-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.sx-pix-waiting i { color: var(--text-light); }
.sx-pix-expire {
  font-size: .78rem;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
}

/* ============================================================
   BUTTON
   ============================================================ */
.sx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  font-family: inherit;
  text-decoration: none;
}
.sx-btn:hover { background: var(--primary-hover); opacity: .92; }
.sx-btn:active { opacity: .8; }
.sx-btn:disabled { opacity: .5; cursor: not-allowed; }
.sx-btn i { font-size: 1.05rem; }

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */
.sx-success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent-pale);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.6rem;
  color: var(--accent);
}
.sx-success-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.sx-success-sub {
  font-size: .88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

/* ============================================================
   FOOTER (below card)
   ============================================================ */
.sx-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  font-size: .78rem;
  color: var(--text-light);
}
.sx-trust span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sx-trust i { font-size: .9rem; }
.sx-footer {
  text-align: center;
  padding: 12px 0 0;
  font-size: .78rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sx-footer a { color: var(--text-muted); text-decoration: none; }
.sx-footer a:hover { color: var(--text); }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
#sx-loading {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
#sx-loading.show { display: flex; }
.sx-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.sx-loading-text { color: #fff; font-size: .9rem; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(max-width: 480px) {
  .sx-body { padding: 20px 16px; }
  .sx-steps { border-radius: 0; }
  .sx-step-label { display: none; }
  .sx-step { padding: 12px 4px; justify-content: center; }
}
