@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #FF5A1F; /* Um laranja vibrante e moderno */
  --primary-gradient: linear-gradient(135deg, #FF7A45 0%, #FF2E00 100%);
  --background: #F4F7FA; /* Claro suave */
  --surface: #FFFFFF; /* Brancos nos cards */
  --surface-hover: #F8FBFF;
  --text: #1A202C; /* Texto escuro para contraste */
  --text-dim: #718096; /* Texto secundário */
  --success: #00B874;
  --danger: #E53E3E;
  --border-radius: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  user-select: none;
}

body {
  background-color: var(--background);
  color: var(--text);
  overflow-x: hidden;
  font-size: 16px;
}

.glow-ambient {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.04) 0%, rgba(255, 90, 31, 0) 70%);
  top: -100px;
  right: -100px;
  z-index: -1;
  filter: blur(50px);
}

.glow-ambient-2 {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 184, 116, 0.03) 0%, rgba(0, 184, 116, 0) 70%);
  bottom: -50px;
  left: -100px;
  z-index: -1;
  filter: blur(40px);
}

/* Layout container */
.checkout-wrapper {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 30px;
  position: relative;
}

@media (max-width: 900px) {
  .checkout-wrapper {
    grid-template-columns: 1fr;
    margin: 20px auto;
  }
}

/* --- Form Column --- */
.form-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-container {
  background: var(--surface);
  border: 1px solid #E2E8F0;
  box-shadow: 0 8px 30px rgba(148, 163, 184, 0.06);
  padding: 30px;
  border-radius: var(--border-radius);
  /* Custom Global Rule for Squircle */
  corner-shape: squircle;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.step-container.active {
  border-color: rgba(255, 90, 31, 0.4);
}

.step-container.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.step-number {
  width: 36px;
  height: 36px;
  background: rgba(255, 90, 31, 0.08);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgba(255, 90, 31, 0.2);
}

.step-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1A202C;
}

/* Inputs design */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

input, select {
  width: 100%;
  background: #F7FAFC;
  border: 1.5px solid #E2E8F0;
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  border-radius: 12px;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.08);
}

input::placeholder {
  color: #A0AEC0;
}

/* Step Buttons */
.next-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 90, 31, 0.25);
}

.next-btn:active {
  transform: translateY(0);
}

/* --- Summary Column --- */
.summary-column {
  position: sticky;
  top: 40px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  corner-shape: squircle;
  padding: 25px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 8px 30px rgba(148, 163, 184, 0.06);
}

.product-info {
  display: flex;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid #EDF2F7;
}

.product-image {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  overflow: hidden;
  background: #FFF;
  border: 1px solid #E2E8F0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #1A202C;
}

.product-details .rating {
  font-size: 12px;
  color: #FFB800;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 8px;
}

.product-details .rating span {
  color: var(--text-dim);
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.totals {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-dim);
}

.totals-row.shipping .value {
  color: var(--success);
  font-weight: 600;
}

.totals-row.grand-total {
  border-top: 1px dashed #E2E8F0;
  padding-top: 15px;
  margin-top: 5px;
  font-size: 18px;
  color: #1A202C;
  font-weight: 700;
}

.totals-row.grand-total .value {
  font-size: 22px;
  color: #1A202C;
}

/* Trusted badge */
.trusted-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  background: #F7FAFC;
  padding: 12px;
  border-radius: 12px;
  margin-top: 15px;
  border: 1px solid #E2E8F0;
}

/* Payment Methods Grid */
.payment-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 25px;
}

.payment-option {
  background: #F7FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.payment-option:hover {
  background: #EDF2F7;
  border-color: #CBD5E0;
}

.payment-option.active {
  background: rgba(255, 90, 31, 0.04);
  border-color: var(--primary);
}

.payment-option svg {
  width: 24px;
  height: 24px;
}

.payment-option span {
  font-size: 14px;
  font-weight: 600;
  color: #2D3748;
}

/* Overlay / Loading screen */
.overlay-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  color: #1A202C;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 90, 31, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Checkmark Success screen */
.pix-screen {
  background: var(--surface);
  border-radius: var(--border-radius);
  corner-shape: squircle;
  padding: 30px;
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(148, 163, 184, 0.15);
  border: 1px solid #E2E8F0;
}

.qr-code {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: #FFF;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #E2E8F0;
}

.qr-code img {
  width: 100%;
  height: 100%;
}

.copy-box {
  background: #F7FAFC;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  margin: 15px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #E2E8F0;
}

.copy-box input {
  background: transparent;
  border: none;
  font-size: 13px;
  padding: 0;
  text-overflow: ellipsis;
  color: #4A5568;
}

.copy-box button {
  background: var(--primary);
  border: none;
  color: #FFF;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.shipping-benefit {
  background: rgba(0, 184, 116, 0.08);
  color: var(--success);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Help CSS */
.hidden { display: none !important; }

/* Validation Styles */
input.error {
  border-color: var(--danger) !important;
}

.error-message {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Radio check button */
.payment-option {
  position: relative;
}

.payment-option.active .radio-check {
  background: var(--primary);
  border-color: var(--primary);
}

.radio-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #CBD5E0;
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.radio-check::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: scale(0);
  transition: var(--transition);
}

.payment-option.active .radio-check::after {
  transform: scale(1);
}

/* Steps Transition */
.step-container {
  max-height: 1000px;
  transition: max-height 0.5s ease-out, opacity 0.3s ease;
}

.step-container.disabled {
  max-height: 85px; /* Altura do header */
  overflow: hidden;
  opacity: 0.4;
}

.step-container.disabled .step-content {
  display: none;
}

/* Cartão de Crédito Formulário */
#form-cartao {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  background: #F7FAFC;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
}

/* Animção de Sucesso */
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-screen {
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #FFF;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #00B874;
  background: rgba(0, 184, 116, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 25px;
}
