/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --color-primary:       #0041ff;
  --color-primary-light: #0e9bff;
  --color-border:        rgba(209, 213, 219, 0.9);
  --color-border-soft:   rgba(229, 231, 235, 0.5);
  --color-text-main:     #374151;
  --color-text-muted:    #6b7280;
  --color-bg:            #f3f4f6;
  --color-white-90:      rgba(255, 255, 255, 0.9);
  --radius-card:         20px;
  --radius-input:        8px;
  --transition:          0.25s ease;
  --shadow-card:         0 8px 32px rgba(0, 65, 255, 0.10), 0 2px 8px rgba(0,0,0,0.04);
}

/* ============================================================
   Reset / Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(150deg, #eef2ff 0%, #f3f4f6 55%, #eaf5ff 100%);
  background-attachment: fixed;
  color: var(--color-text-main);
  min-height: 100vh;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
}

@media (min-width: 640px) {
  .navbar { height: 64px; }
}

.navbar-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .navbar-container { justify-content: space-between; }
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo img {
  height: 38px;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .navbar-logo img { height: 44px; }
}

.navbar-app-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1.5px solid var(--color-border);
}

@media (min-width: 1024px) {
  .navbar-app-name { display: none; }
}

.navbar-menu-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .navbar-menu-desktop {
    display: flex;
    gap: 32px;
  }
}

.navbar-link {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-bottom: 3px;
  transition: color var(--transition);
}

.navbar-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--color-primary);
}

.navbar-link:hover::after,
.navbar-link.active::after {
  width: 100%;
}

.navbar-space {
  height: 56px;
}

@media (min-width: 640px) {
  .navbar-space { height: 64px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius-input);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px -2px rgba(0, 65, 255, 0.28);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 14px 20px -6px rgba(14, 155, 255, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.btn-full {
  width: 100%;
  margin-top: 10px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  border-radius: var(--radius-input);
  text-decoration: none;
  background: #25d366;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
  transition: filter var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.08);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
  cursor: pointer;
}

.btn-whatsapp i {
  font-size: 1.1em;
}

.btn-whatsapp:hover {
  filter: brightness(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-whatsapp:focus-visible {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(37, 211, 102, 0.22);
}

/* SweetAlert footer: keep CTA centered and mobile-friendly */
.swal2-popup.swal-popup .swal2-footer .btn-whatsapp {
  width: 100%;
  max-width: 340px;
}

/* ============================================================
   Main Layout
   ============================================================ */
.main-container {
  width: 100%;
  padding: 20px 12px;
}

@media (min-width: 480px) {
  .main-container { padding: 24px 16px; }
}

@media (min-width: 640px) {
  .main-container { padding: 32px 24px; }
}

.charge-hero {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

/* ============================================================
   Glass Card
   ============================================================ */

/* Always include .glass-background as a direct child of .glass-card */
.glass-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 600px;
}

.glass-background {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.92);
}

.charge-content {
  position: relative;
  z-index: 10;
  padding: 36px 24px;
}

@media (min-width: 480px) {
  .charge-content { padding: 40px 32px; }
}

@media (min-width: 640px) {
  .charge-content { padding: 44px 40px; }
}

@media (min-width: 768px) {
  .glass-card { border-radius: 28px; }
  .charge-content { padding: 48px 44px; }
}

@media (min-width: 1024px) {
  .main-container { padding: 32px 0; }
  .glass-card { max-width: 900px; }
  .charge-content { padding: 40px 44px; }

  #registrationForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 0;
  }

  #registrationForm .form-row--full,
  #registrationForm .form-row-split,
  #registrationForm .card-scene,
  #registrationForm .checkbox-row,
  #registrationForm .btn-full,
  #registrationForm .form-section {
    grid-column: 1 / -1;
  }
}


/* ============================================================
   Step headings
   ============================================================ */
.charge-header {
  text-align: center;
  margin-bottom: 32px;
}

.charge-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.charge-subheading {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (min-width: 640px) {
  .charge-heading { font-size: 1.75rem; }
  .charge-header { margin-bottom: 36px; }
}

/* ============================================================
   Form elements
   ============================================================ */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-main);
}

.form-input {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background-color: rgba(243, 244, 246, 0.9);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-text-main);
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input::placeholder {
  color: rgba(107, 114, 128, 0.55);
  font-size: 0.875rem;
}

.form-input:focus {
  border-color: var(--color-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 65, 255, 0.09);
}

.form-input--readonly {
  background-color: rgba(243, 244, 246, 0.6);
  border-color: transparent;
  color: var(--color-text-muted);
  cursor: default;
}

/* Input with left icon */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 16px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-icon-wrap .form-input {
  padding-left: 42px;
}

.form-error {
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  margin-top: 2px;
}

/* ============================================================
   Radio group — segmented control (iOS-style)
   ============================================================ */
.radio-group {
  display: flex;
  flex-direction: row;
  gap: 3px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.radio-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 9px 6px;
  border-radius: 9px;
  background: transparent;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  text-align: center;
  user-select: none;
  line-height: 1.3;
}

.radio-item:has(input:checked) {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.13);
}

.radio-item input[type="radio"] {
  display: none;
}

/* ============================================================
   Checkbox row
   ============================================================ */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1.5px solid var(--color-border);
  background: var(--color-white-90);
  transition: border-color var(--transition), background var(--transition);
}

.checkbox-row:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(0, 65, 255, 0.05);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-row label {
  font-size: 0.8125rem;
  color: var(--color-text-main);
  line-height: 1.4;
  cursor: pointer;
}

/* ============================================================
   Form section divider
   ============================================================ */
.form-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.form-section:first-child {
  margin-top: 0;
}

.form-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(107, 114, 128, 0.7);
  white-space: nowrap;
}

.form-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(209, 213, 219, 0.8), transparent);
}

/* ============================================================
   intlTelInput fix
   ============================================================ */
.iti {
  width: 100%;
}

.iti input {
  width: 100%;
}

/* ============================================================
   Split row (Expiry + CVC)
   ============================================================ */
.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle .form-input {
  padding-right: 42px;
}

.cvc-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}

.cvc-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.cvc-toggle-icon {
  font-size: 0.9rem;
  color: var(--color-primary);
}

.cvc-toggle.cvc-toggle--active .cvc-toggle-icon {
  color: var(--color-text-muted);
}

/* ============================================================
   3D Card Component
   ============================================================ */
.card-scene {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1.586;
  perspective: 1000px;
  margin: 0.75rem auto 1rem;
}

@media (min-width: 480px) {
  .card-scene { max-width: 380px; }
}

.card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 24px 48px -8px rgba(0, 30, 120, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.card-face--front {
  background: linear-gradient(
    135deg,
    #001a80 0%,
    #0030cc 40%,
    #0058ff 75%,
    #0e9bff 100%
  );
  color: #fff;
}

/* Light shimmer overlay */
.card-face--front::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(255,255,255,0.18) 0%, transparent 55%),
    linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%);
  pointer-events: none;
}

.card-face--back {
  background: linear-gradient(
    135deg,
    #001a80 0%,
    #0030cc 50%,
    #0058ff 100%
  );
  color: #fff;
  transform: rotateY(180deg);
}

.card-chip {
  width: 42px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffe066 0%, #d4a017 50%, #ffd700 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5), 0 1px 3px rgba(0,0,0,0.3);
}

.card-chip::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px solid rgba(0,0,0,0.18);
  border-radius: 3px;
}

.card-chip::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1.5px;
  background: rgba(0,0,0,0.15);
  transform: translateX(-50%);
}

.card-number-display {
  font-size: clamp(0.9rem, 3.5vw, 1.15rem);
  letter-spacing: 0.2em;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.card-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-meta-label {
  font-size: 0.58rem;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.card-meta-value {
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.card-brand {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.95;
  align-self: center;
}

.card-stripe {
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  margin: 0 -1.5rem;
}

.card-sig-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0.75rem;
}

.card-sig-box {
  flex: 1;
  height: 36px;
  border-radius: 4px;
  background: repeating-linear-gradient(
    90deg,
    #e5e7eb 0px, #e5e7eb 4px,
    #fff    4px, #fff    8px
  );
  opacity: 0.9;
}

.card-cvc-box {
  background: #fff;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.2em;
  font-family: 'Courier New', monospace;
  min-width: 52px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ============================================================
   SweetAlert2 Custom Theme
   ============================================================ */
.swal2-popup.swal-popup {
  font-family: 'Montserrat', sans-serif;
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  box-shadow:
    0 20px 48px rgba(0, 65, 255, 0.10),
    0 4px 12px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: calc(100% - 2rem);
  max-width: 400px;
}

.swal2-popup.swal-popup.swal2-show {
  animation: swal-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.swal2-popup.swal-popup.swal2-hide {
  animation: swal-out 0.18s ease-in both;
}

@keyframes swal-in {
  from { opacity: 0; transform: scale(0.88) translateY(-10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes swal-out {
  from { opacity: 1; transform: scale(1)    translateY(0); }
  to   { opacity: 0; transform: scale(0.94) translateY(4px); }
}

.swal2-popup.swal-popup .swal2-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.01em;
  padding-bottom: 0.25rem;
}

.swal2-popup.swal-popup .swal2-html-container,
.swal2-popup.swal-popup .swal2-content {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.swal2-popup.swal-popup .swal2-actions {
  margin-top: 1.25rem;
  gap: 8px;
}

.swal2-popup.swal-popup .swal2-confirm {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 28px;
  border-radius: 8px;
  background: linear-gradient(to right, #0041ff, #0e9bff);
  box-shadow: 0 6px 16px -2px rgba(0, 65, 255, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.swal2-popup.swal-popup .swal2-confirm:hover {
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 14px 20px -6px rgba(14, 155, 255, 0.35);
}

.swal2-popup.swal-popup .swal2-footer {
  border-top: 1px solid rgba(209, 213, 219, 0.5);
  margin: 0.5rem 0 0;
  padding: 1rem 0 0;
  justify-content: center;
}

/* ============================================================
   Error pages (404, 500)
   ============================================================ */
.charge-hero--center {
  min-height: calc(100vh - 56px);
  align-items: center;
}

@media (min-width: 640px) {
  .charge-hero--center { min-height: calc(100vh - 64px); }
}

.glass-card--narrow {
  max-width: 440px;
}

.charge-content--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.charge-title {
  font-size: 5.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .charge-title { font-size: 7.5rem; }
}

.charge-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin-bottom: 28px;
}
