*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

.page-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 28px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}
.tagline {
  font-size: 13px;
  color: #64748b;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.card-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.card-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

/* Fieldsets / sections */
.section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 18px 16px;
  margin-bottom: 20px;
}
.section legend {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 6px;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
}
.field:first-child { margin-top: 0; }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.row-2 .field { margin-top: 0; }

label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hint {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}
.optional {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus {
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30,64,175,.12);
}
input.invalid, select.invalid {
  border-color: #dc2626;
}
.err {
  font-size: 12px;
  color: #dc2626;
  min-height: 16px;
}

/* Plan cards */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.plan-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
  user-select: none;
}
.plan-card:hover:not(.disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
}
.plan-card.selected {
  border-color: #1e40af;
  background: #eff6ff;
}
.plan-card.disabled {
  opacity: .55;
  cursor: not-allowed;
  background: #f8fafc;
}
.plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.badge-promo  { background: #fef3c7; color: #92400e; }
.badge-beta   { background: #dbeafe; color: #1e40af; }
.badge-soon   { background: #f1f5f9; color: #94a3b8; }

.plan-name  { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: #1e293b; }
.plan-price { font-size: 22px; font-weight: 800; color: #1e40af; margin-bottom: 2px; }
.plan-price .period { font-size: 13px; font-weight: 400; color: #64748b; }
.plan-desc  { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.4; }
.plan-loading { grid-column: 1/-1; text-align: center; color: #94a3b8; padding: 16px; }

/* Flujos */
.flows-section {
  margin-top: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px;
}
.flows-promo-msg {
  font-size: 13px;
  color: #15803d;
  margin-bottom: 10px;
}
.flows-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  cursor: default;
}
.flow-chip input { accent-color: #16a34a; }

/* Beta plan detail */
.beta-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.beta-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #166534;
}
.beta-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.beta-feature-item > div > strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.beta-feature-item p strong {
  display: inline;
}
.beta-feature-item p {
  margin: 0;
  font-size: 12px;
  color: #15803d;
  line-height: 1.5;
}

/* T&C */
.toc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.toc-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #1e40af;
}
.toc-row a { color: #1e40af; }

/* Form error */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #dc2626;
  margin-bottom: 14px;
}

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: #1e40af;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #1d3d9f; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success card */
.success-card { text-align: center; padding: 48px 32px; }
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: #1e293b; }
.success-card p { color: #64748b; line-height: 1.6; margin-bottom: 12px; }
.success-note { font-size: 13px; background: #f0fdf4; border-radius: 8px; padding: 14px; color: #166534; }

/* Footer */
.footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
}
.footer a { color: #1e40af; }

/* Responsive */
@media (max-width: 500px) {
  .row-2 { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .card { padding: 24px 16px; }
}
