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

:root {
  --lavanda: #4040E3;
  --lavanda-light: #ececfc;
  --negro: #000000;
  --negro-90: rgba(0, 0, 0, 0.9);
  --negro-80: rgba(0, 0, 0, 0.8);
  --negro-70: rgba(0, 0, 0, 0.7);
  --negro-40: rgba(0, 0, 0, 0.4);
  --blanco: #ffffff;
  --gris-bg: #f2f2f7;
  --gris-border: #e0e0ea;
  --shadow: 0px 0px 20px 0px rgba(135, 141, 150, 0.2);
  --radius-sm: 8px;
  --radius: 16px;

  /* Type scale */
  --scale: 1.14;
  --b-size: 16px;
  --tD-weight: 800;
  --tD-size: calc(var(--scale) * var(--b-size));
  --tD-line: 26px;
  --tC-weight: 800;
  --tC-size: calc(var(--scale) * var(--tD-size));
  --tC-line: 28px;
  --tB-weight: 800;
  --tB-size: calc(var(--scale) * var(--tC-size));
  --tB-line: 31px;
  --tA-weight: 800;
  --tA-size: calc(var(--scale) * var(--tB-size));
  --tA-line: 34px;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: "Montserrat", sans-serif;
  background: var(--gris-bg);
}

.cs-label {
  font-family: 'Montserrat', sans-serif;
}

/* ── LAYOUT ── */
.app {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.contenido {
  flex-grow: 1;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--gris-border);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--lavanda);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Header nav */
.top-nav {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-inner {
  width: 100%;
  max-width: 1068px;
  height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav-logo {
  display: flex;
  align-items: center;
}

.top-nav-logo .logo-brand {
  color: var(--negro);
  letter-spacing: -0.3px;
}

.top-nav-logo .logo-sep {
  width: 1px;
  height: 18px;
  background: var(--gris-border);
}

.top-nav-logo .logo-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--lavanda);
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.top-nav-phone {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-phone .phone-claim {
  color: #000000;
  opacity: 90%;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.top-nav-phone .phone-btn-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  padding: 4px;
}

.top-nav-phone a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  padding: 12px 8px;
  background: var(--lavanda);
  color: #fff;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  transition: opacity 0.15s;
}

.top-nav-phone a:hover {
  opacity: 0.85;
}

.top-nav-phone a img {
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.back-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.back-btn:hover {
  background: var(--gris-bg);
}

.cta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: calc(100% - 120px);
  max-width: 540px;
  margin: 0 auto;
}

.cta-row .btn-primary {
  flex: 1;
  width: auto;
  max-width: none;
  margin: 0;
}

.cta-row .back-btn {
  width: auto;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--lavanda);
  border-radius: var(--radius);  
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--lavanda);
  white-space: nowrap;
}

.cta-row .back-btn img {
  flex-shrink: 0;
  filter: invert(27%) sepia(99%) saturate(1600%) hue-rotate(224deg) brightness(95%) contrast(97%);
  transition: transform 0.2s;
}

.cta-row .back-btn:hover img {
  transform: translateX(-4px);
}

.cta-row .back-btn:hover {
  background: var(--gris-bg);
  border-color: var(--negro-70);
}

.top-nav-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--negro-70);
}

.global-footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 16px 40px;
  font-size: 12px;
  line-height: 22px;
}

/* Screens */
.screens-wrapper {
  flex: 1;
}

.screen {
  display: none;
  width: 100%;
  padding: 48px 16px 80px;
  flex-direction: column;
  align-items: center;
}

.screen.active {
  display: flex;
}

.screen.exit {
  display: none;
}

.inner {
  width: 100%;
  max-width: 704px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Screen 4 has sidebar layout */
.inner-wide {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Form header */
.form-header {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.form-header-icon {
  width: 56px;
  height: 56px;
  background-color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-header-icon svg {
  width: 28px;
  height: 28px;
  color: var(--lavanda);
}

.form-header-icon img {
  width: 28px;
  height: 28px;
  filter: invert(27%) sepia(99%) saturate(1600%) hue-rotate(224deg) brightness(95%) contrast(97%);
}

.form-title {
  font-size: var(--tC-size);
  font-weight: var(--tC-weight);
  line-height: var(--tC-line);
  color: var(--negro);
  max-width: 704px;
}

.form-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--negro-70);
}

/* Card */
.card {
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 704px;
}

.card-label {
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 30px;
  color: var(--lavanda);  
  border-bottom: 1.5px solid var(--gris-border);
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-label-info {
  cursor: help;
}

/* Grid */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-full {
  grid-column: 1 / -1;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--negro-80);
  letter-spacing: 0.2px;
}

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

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  height: 48px;
  border: 2px solid var(--gris-border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--negro);
  background: var(--blanco);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder,
.input-wrap select::placeholder {
  color: var(--negro-40);
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
}

.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--lavanda);
  
}

.input-wrap select {
  cursor: pointer;
  color: var(--negro-70);
  -webkit-text-fill-color: var(--negro-70);
}

.input-wrap select.filled {
  color: var(--negro);
  -webkit-text-fill-color: var(--negro);
}

.select-arrow {
  pointer-events: none;
  position: absolute;
  right: 14px;
  color: var(--negro-40);
}

/* ── Custom Select ── */
.cs-wrap {
  position: relative;
  width: 100%;
}

.cs-btn {
  width: 100%;
  height: 48px;
  border: 2px solid var(--gris-border);
  border-radius: var(--radius-sm);
  background: var(--blanco);
  color: var(--negro-40);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.cs-btn.filled {
  color: var(--negro);
}

.cs-btn:focus,
.cs-wrap.open .cs-btn {
  border-color: var(--lavanda);
  
}

.cs-btn .select-arrow {
  position: static;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.cs-wrap.open .cs-btn .select-arrow {
  transform: rotate(180deg);
}

.cs-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--blanco);
  border: 1.5px solid var(--gris-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
}

.cs-wrap.open .cs-list {
  display: block;
}

.cs-item {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--negro);
  transition: background 0.15s;
}

.cs-item:hover {
  background: var(--gris-bg);
}

.cs-item.selected {
  color: var(--lavanda);
  font-weight: 600;
}

.cs-item-hint {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--negro-40);
  font-style: italic;
  pointer-events: none;
}

.field.has-error .cs-btn {
  border-color: #e53e3e;
  background: #fff5f5;
}

.tooltip-badge {
  width: 18px;
  height: 18px;
  background: var(--lavanda-light);
  color: var(--lavanda);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex-shrink: 0;
  position: absolute;
  right: 12px;
  transition: background 0.2s;
}

.tooltip-badge:hover,
.tooltip-badge.active {
  background: var(--lavanda);
  color: white;
}

/* Popover flotante */
#tooltip-pop {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid var(--lavanda-light);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(64, 64, 227, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 14px 16px 14px 14px;
  max-width: 240px;
  min-width: 180px;
}

#tooltip-pop.visible {
  display: block;
  animation: popIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#tooltip-pop .tp-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#tooltip-pop .tp-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: var(--lavanda-light);
  color: var(--lavanda);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

#tooltip-pop .tp-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

#tooltip-pop .tp-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--negro);
  flex: 1;
  text-align: justify;
}

#tooltip-pop .tp-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--negro-70);
  font-size: 16px;
  line-height: 1;
  border-radius: 50%;
  transition:
    background 0.15s,
    color 0.15s;
}

#tooltip-pop .tp-close:hover {
  background: var(--gris-bg);
  color: var(--negro);
}

/* Flecha del popover */
#tooltip-pop {
  --arrow-left: 20px;
}

/* Flecha apunta hacia arriba (popover abre por debajo del badge) */
#tooltip-pop::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1.5px solid var(--lavanda-light);
  border-right: none;
  border-bottom: none;
  left: var(--arrow-left);
  top: -6px;
  transform: rotate(45deg);
}

.input-icon-left {
  position: absolute;
  left: 12px;
  color: var(--negro-40);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-icon-left img {
  width: 16px;
  height: 16px;
  opacity: 0.4;
}

.input-with-icon {
  padding-left: 38px !important;
}

/* Checkbox */
.checkbox-row {
  display: flex;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  align-items: center;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid var(--gris-border);
  border-radius: 5px;
  background: var(--blanco);
  cursor: pointer;
  margin-top: 1px;
  transition: all 0.15s;
  position: relative;
}

.checkbox-row input[type="checkbox"]:checked {
  background: var(--lavanda);
  border-color: var(--lavanda);
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, 1px);
  position: absolute;
  inset: 0;
  margin: auto;
  top: -2px;
  left: 2px;
}

.checkbox-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--negro-90);
  line-height: 1.5;
}

.checkbox-label a {
  color: var(--lavanda);
}

/* ── Validación ── */
.field.has-error .input-wrap input,
.field.has-error .input-wrap select {
  border-color: #e53e3e;
  background: #fff5f5;
}

.field-error-msg {
  display: none;
  font-size: 11px;
  color: #e53e3e;
  margin-top: 4px;
  font-weight: 500;
}

.field.has-error .field-error-msg {
  display: block;
}

.checkbox-row.has-error .checkbox-label {
  color: #e53e3e;
}

.checkbox-row.has-error input[type="checkbox"] {
  border-color: #e53e3e;
}

.pricing-grid.has-error {
  outline: 2px solid #e53e3e;
  outline-offset: 6px;
  border-radius: 16px;
}

.pricing-error-msg {
  display: none;
  font-size: 12px;
  color: #e53e3e;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

.pricing-grid.has-error+.pricing-error-msg,
.pricing-error-msg.visible {
  display: block;
}

.submit-error-msg {
  display: none;
  font-size: 13px;
  color: #e53e3e;
  font-weight: 500;
  text-align: center;
  margin-top: 10px;
}

.submit-error-msg.visible {
  display: block;
}

/* Card de fecha inicio con error */
.card.has-error .field-error-msg {
  display: block;
}

/* Add address button */
.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1.5px dashed var(--gris-border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--lavanda);
  transition:
    border-color 0.2s,
    background 0.2s;
  width: 100%;
}

.add-btn:hover {
  border-color: var(--lavanda);
  background: var(--lavanda-light);
}

/* Legal text */
.legal-text {
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  color: var(--negro-80);
  text-align: center;
}

.legal-text a {
  color: var(--lavanda);
  text-decoration: underline;
  color: var(--Main-cs-lavanda, #4040E3);
  font-weight: 700;
}

.advise-message {
  font-size: 12px;
  align-self: center;
}

/* CTA */
.btn-primary {
  width: calc(100% - 60px);
  max-width: 540px;
  height: 48px;
  margin-left: auto;
  margin-right: auto;
  background: var(--lavanda);
  color: var(--blanco);
  border: none;
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s,
    opacity 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: var(--lavanda);
  box-shadow: 0 6px 20px rgba(64, 64, 227, 0.3);
  opacity: 0.85;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
  opacity: 0.7;
}

.btn-primary img {
  filter: brightness(0) invert(1);
  transition: transform 0.2s;
}

.btn-primary:hover img {
  transform: translateX(4px);
}

.btn-primary:disabled {
  background: var(--negro-70);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.5;
}

.legal-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.legal-bar-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
}

.legal-bar-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blanco);
  padding: 8px 12px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
}

.legal-bar-chip svg {
  flex-shrink: 0;
  filter: invert(26%) sepia(91%) saturate(5537%) hue-rotate(240deg) brightness(92%) contrast(93%);
}

/* Input type=date color fix */
input[type="date"] {
  color: var(--negro-40);
}

input[type="date"].filled {
  color: var(--negro);
}

/* ══════════════════════════════════════════
     RESPONSIVE SYSTEM
  ══════════════════════════════════════════ */

/* ── ≤ 499px · Móvil ── */
@media (max-width: 499px) {
  .screen {
    padding: 20px 12px 80px;
  }

  .top-nav-inner {
    padding: 4px 16px;
    height: auto;
  }

  .top-nav-phone {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 1px;
  }

  .top-nav-phone .phone-claim {
    font-size: 13px;
    line-height: 16px;
  }

  .top-nav-phone a {
    font-size: 13px;
    padding: 8px 10px;
  }

  .top-nav-phone a img {
    width: 20px;
    height: 20px;
  }

  .card {
    padding: 16px;
    max-width: 100%;
  }

  .inner,
  .fields-grid {
    width: 100%;
    max-width: 100%;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: 1;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .inner-wide {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
  }


  .cta-row {
    width: 80%;
    max-width: 80%;
  }

  .cta-row .back-btn {
    font-size: 0;
    width: 44px;
    min-width: 24px;
    height: 44px;
    padding: 0;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cta-row .back-btn img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .btn-primary {
    width: 100%;
    max-width: 100%;
    font-size: 14px;
  }

  .input-wrap input,
  .input-wrap select,
  .input-wrap textarea {
    font-size: 16px;
  }

  .legal-bar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .legal-bar-name {
    width: 100%;
    text-align: center;
  }
}

/* ── ≤ 767px · Form header centrado + inner-wide en columna ── */
@media (max-width: 767px) {
  .form-header {
    align-items: center !important;
    text-align: center !important;
  }

  .inner-wide {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

  .global-footer {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* ── 500px – 767px · Pricing grid 2 columnas ── */
@media (min-width: 500px) and (max-width: 767px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 768px – 1023px · Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .screen {
    padding: 36px 24px 80px;
  }

  .top-nav-inner {
    padding: 0 24px;
  }

  .card {
    padding: 24px;
  }


  .fields-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inner-wide {
    gap: 20px;
  }

  .sidebar {
    width: 260px;
  }

  .cta-row {
    max-width: 460px;
  }

  .btn-primary {
    max-width: 460px;
  }
}

/* ── 1024px – 1279px · Desktop pequeño ── */
@media (min-width: 1024px) and (max-width: 1279px) {
  .screen {
    padding: 40px 28px 80px;
  }

  .top-nav-inner {
    padding: 0 28px;
  }

  .card {
    padding: 24px;
  }


  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .inner-wide {
    gap: 24px;
  }

  .sidebar {
    width: 280px;
  }

  .cta-row {
    max-width: 500px;
  }

  .btn-primary {
    max-width: 500px;
  }
}

/* ── ≥ 1280px · Desktop grande ── */
@media (min-width: 1280px) {
  .screen {
    padding: 48px 32px 80px;
  }

  .top-nav-inner {
    padding: 0 32px;
  }

  .card {
    padding: 24px;
  }


  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .inner-wide {
    gap: 32px;
  }

  .sidebar {
    width: 300px;
  }

  .cta-row {
    max-width: 540px;
  }

  .btn-primary {
    max-width: 540px;
  }
}

/* ── < 890px · Sidebar full-width ── */
@media (max-width: 889px) {
  .sidebar {
    width: 100%;
    max-width: 100%;
    position: static;
  }
}