/* Fase 4 — Hero y prototipo de formulario */
.hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(2.75rem, 7vw, 5.75rem);
  background: linear-gradient(135deg, var(--brand-sand) 0%, var(--white) 48%, var(--brand-mist) 100%);
}
.hero::before {
  content: "";
  position: absolute;
  width: 26rem;
  height: 26rem;
  top: -17rem;
  left: -12rem;
  border-radius: 50%;
  background: rgba(185, 83, 63, .08);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .88fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero__copy { max-width: 680px; }
.hero__copy h1 { max-width: 15ch; margin-bottom: var(--space-5); }
.hero__copy .lead { max-width: 58ch; margin-bottom: var(--space-6); }
.hero__actions { margin-bottom: var(--space-6); }
.hero__signals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--neutral-700);
  font-size: var(--fs-14);
  font-weight: 700;
}
.hero__signals li { display: inline-flex; align-items: center; gap: .55rem; }
.hero__signals li::before {
  content: "";
  width: .62rem;
  height: .62rem;
  flex: 0 0 auto;
  border: 2px solid var(--brand-petrol);
  border-radius: 50%;
  background: var(--white);
}
.hero__media {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(29, 43, 58, .12);
  border-radius: var(--radius-xl);
  background: var(--neutral-100);
  box-shadow: var(--shadow-2);
}
.hero__media img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  object-position: center;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(29,43,58,.20));
  pointer-events: none;
}
.hero__image-note {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1;
  max-width: 26ch;
  margin: 0;
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  color: var(--white);
  background: rgba(29, 43, 58, .82);
  font-size: var(--fs-12);
  line-height: 1.35;
  backdrop-filter: blur(8px);
}

.quote-section {
  padding-block: clamp(2.75rem, 6vw, 5rem);
  scroll-margin-top: calc(var(--header-height) + 1rem);
  background: var(--white);
}
.quote-layout {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.quote-intro { position: sticky; top: calc(var(--header-height) + 2rem); }
.quote-intro h2 { margin-bottom: var(--space-4); }
.quote-intro p { color: var(--text-secondary); }
.quote-principles {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.quote-principles li {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: var(--space-3);
  align-items: start;
  color: var(--neutral-700);
  font-size: var(--fs-14);
}
.quote-principles li::before {
  content: "✓";
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-petrol-dark);
  background: var(--brand-mist);
  font-weight: 900;
}

.quote-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-1);
}
.prototype-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  margin-bottom: var(--space-5);
  border: 1px solid rgba(49,95,135,.24);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--info-700);
  background: var(--info-100);
  font-size: var(--fs-14);
}
.prototype-banner__icon {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--info-700);
  font-weight: 900;
}

.form-progress {
  display: none;
  margin-bottom: var(--space-6);
}
.js .form-progress { display: block; }
.form-progress__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--neutral-700);
  font-size: var(--fs-14);
  font-weight: 800;
}
.form-progress__track {
  height: .5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-200);
}
.form-progress__bar {
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-petrol);
  transition: width var(--motion-base) var(--ease-standard);
}
.form-progress[data-current-step="2"] .form-progress__bar { width: 100%; }

.quote-form fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
.quote-form fieldset + fieldset { margin-top: var(--space-8); }
.js .quote-form fieldset[hidden] { display: none; }
.form-legend {
  width: 100%;
  margin-bottom: var(--space-5);
  padding: 0;
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, var(--fs-24));
  font-weight: 800;
  line-height: var(--lh-heading);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.form-field { display: grid; gap: var(--space-2); align-content: start; }
.form-field--full { grid-column: 1 / -1; }
.form-label { color: var(--brand-ink); font-size: var(--fs-14); font-weight: 800; }
.form-label__optional { color: var(--neutral-600); font-weight: 600; }
.form-control {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .78rem .9rem;
  color: var(--brand-ink);
  background: var(--white);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background-color var(--motion-fast);
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control:hover { border-color: var(--neutral-600); }
.form-control:focus { outline: 0; border-color: var(--brand-petrol); box-shadow: var(--focus-ring); }
.form-control[aria-invalid="true"] {
  border-color: var(--error-700);
  background: linear-gradient(90deg, var(--error-100) 0 5px, var(--white) 5px);
}
.form-hint,
.form-error { margin: 0; font-size: var(--fs-12); line-height: 1.45; }
.form-hint { color: var(--text-secondary); }
.form-error { min-height: 1.1em; color: var(--error-700); font-weight: 750; }
.form-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}
.form-check input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--brand-petrol); }
.form-check label { color: var(--neutral-700); font-size: var(--fs-14); }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.form-actions--end { justify-content: flex-end; }
.form-errors {
  margin-bottom: var(--space-5);
  border: 1px solid rgba(181,58,69,.30);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--error-700);
  background: var(--error-100);
}
.form-errors h3 { margin-bottom: var(--space-2); color: inherit; font-size: var(--fs-18); }
.form-errors ul { margin: 0; padding-left: 1.2rem; }
.form-nojs {
  margin: 0 0 var(--space-5);
  border-left: 4px solid var(--warning-700);
  padding: var(--space-3) var(--space-4);
  color: var(--warning-700);
  background: var(--warning-100);
  font-size: var(--fs-14);
}
.js .form-nojs { display: none; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }

.prototype-review {
  padding-block: var(--space-8);
  background: var(--surface-subtle);
}
.prototype-review__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--space-5); }
.prototype-review .card h2 { font-size: var(--fs-20); }
.prototype-review .card p { margin-bottom: 0; color: var(--text-secondary); }

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy h1 { max-width: 18ch; }
  .hero__media { min-height: 320px; }
  .hero__media img { min-height: 320px; max-height: 480px; }
  .quote-layout { grid-template-columns: 1fr; }
  .quote-intro { position: static; }
}

@media (max-width: 680px) {
  .hero { padding-block: 2.6rem 2rem; }
  .hero__copy h1 { font-size: clamp(2.05rem, 10vw, 3rem); }
  .hero__copy .lead { margin-bottom: var(--space-5); }
  .hero__actions .button { width: 100%; }
  .hero__signals { display: grid; gap: var(--space-2); }
  .hero__media { min-height: 225px; border-radius: var(--radius-lg); }
  .hero__media img { min-height: 225px; max-height: 300px; }
  .hero__image-note { right: var(--space-3); bottom: var(--space-3); max-width: 22ch; }
  .quote-section { padding-top: 2.5rem; }
  .quote-card { border-radius: var(--radius-lg); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .button { width: 100%; }
  .form-actions .button--secondary { order: 2; }
  .prototype-review__grid { grid-template-columns: 1fr; }
}

/* Compactación específica para móviles bajos: mantiene H1 + imagen, pero acerca el formulario. */
@media (max-width: 370px) and (max-height: 700px) {
  .hero { padding-block: 1.6rem 1.25rem; }
  .hero__copy h1 { font-size: 1.95rem; margin-bottom: var(--space-3); }
  .hero__copy .lead { font-size: 1rem; margin-bottom: var(--space-4); }
  .hero__actions { margin-bottom: var(--space-3); }
  .hero__actions .button--secondary { min-height: 42px; padding-block: .55rem; }
  .hero__signals { grid-template-columns: 1fr 1fr; font-size: var(--fs-12); }
  .hero__signals li:last-child { grid-column: 1 / -1; }
  .hero__media { min-height: 180px; margin-top: var(--space-5); }
  .hero__media img { min-height: 180px; height: 180px; }
  .hero__image-note { display: none; }
}


/* Form heading added during the post-Phase 8 form correction. */
.form-intro {
  margin: 0 0 1.25rem;
  text-align: center;
}

.form-intro__title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.15;
}

.form-intro__text {
  max-width: 42rem;
  margin: 0.65rem auto 0;
  font-size: 1rem;
  line-height: 1.55;
}


/* Post-Phase 8 visual emphasis for the form area. */
.quote-section {
  background: var(--neutral-100);
}

.quote-card {
  background: var(--white);
  border-color: var(--neutral-200);
  box-shadow: 0 18px 45px rgba(16, 35, 52, 0.12);
}

.form-intro {
  margin-bottom: 1.4rem;
}

.form-intro__title {
  color: var(--brand-ink);
}

.form-intro__text {
  max-width: 38rem;
  margin-top: 0.5rem;
  color: var(--neutral-700);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", var(--font-body), sans-serif;
  font-size: clamp(0.84rem, 1.5vw, 0.92rem);
  font-stretch: condensed;
  letter-spacing: -0.02em;
  line-height: 1.42;
}


/* Post-Phase 8 compact friendly form refinement. */
.form-intro {
  margin-bottom: 1rem;
}

.form-intro__title {
  font-family: var(--font-body);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.form-intro__text {
  max-width: 34rem;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.25vw, 0.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.38;
}

.form-progress {
  margin-bottom: 1rem;
}

.form-progress__row {
  justify-content: flex-start;
  margin-bottom: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.form-progress__track {
  height: 0.45rem;
}

.form-progress__bar {
  background: linear-gradient(90deg, #2f80ed 0%, #27ae60 100%);
}

.form-grid {
  column-gap: 0.9rem;
  row-gap: 0.85rem;
}

.form-field {
  gap: 0.35rem;
}

.form-label {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.form-label__optional {
  font-weight: 400;
}

.form-control {
  min-height: 46px;
  padding: 0.68rem 0.82rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 0.85rem;
}

.form-hint,
.form-error {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.35;
}

.form-actions,
.form-actions--end {
  justify-content: center;
  margin-top: 1.15rem;
}

.button--quote {
  min-width: 11.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.65rem;
  color: #ffffff;
  background: #f28c28;
  box-shadow: 0 8px 18px rgba(242, 140, 40, 0.24);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.button--quote:hover {
  background: #dd7617;
  transform: translateY(-1px);
}

.button--quote:focus-visible {
  outline: 3px solid rgba(242, 140, 40, 0.28);
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .form-grid {
    row-gap: 0.75rem;
  }

  .button--quote {
    width: min(100%, 15rem);
  }
}

/* Fase 9 — formulario funcional y estados de envío */
.form-trap {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.form-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 42rem;
  margin: 0.85rem auto 0;
  color: var(--text-muted, #526579);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.form-privacy-note__icon {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0;
  color: #058900;
}

.form-privacy-note a {
  color: var(--brand-blue, #104a9a);
  font-weight: 700;
  text-underline-offset: 0.14em;
}

.form-submit-status {
  margin-top: 1rem;
  border: 1px solid rgba(180, 55, 55, 0.28);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 242, 242, 0.92);
  color: #8c2424;
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-submit-status[data-status="success"] {
  border-color: rgba(5, 137, 0, 0.28);
  background: rgba(239, 250, 238, 0.95);
  color: #176313;
}

[data-submit-form][aria-busy="true"] {
  cursor: wait;
  opacity: 0.76;
}

@media (max-width: 680px) {
  .form-privacy-note {
    align-items: flex-start;
    max-width: 23rem;
    padding-inline: 0.2rem;
    font-size: 0.8rem;
  }
}


/* Fase 9 — iconografía sutil dentro de campos del formulario */
.form-control {
  --field-icon: none;
  background-image: var(--field-icon);
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px 18px;
  padding-left: 2.8rem;
}

textarea.form-control {
  background-position: 14px 14px;
  background-size: 18px 18px;
  padding-top: 0.82rem;
  padding-left: 2.8rem;
}

.form-control::placeholder {
  color: #8d95a3;
}

.form-control[type="number"] {
  padding-right: 0.95rem;
}

.form-control[aria-invalid="true"] {
  border-color: var(--error-700);
  background-color: var(--white);
  background-image: linear-gradient(90deg, var(--error-100) 0 5px, transparent 5px), var(--field-icon);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, 14px center;
  background-size: auto, 18px 18px;
}

textarea.form-control[aria-invalid="true"] {
  background-position: left top, 14px 14px;
  background-size: auto, 18px 18px;
}

#full-name.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 21a6 6 0 0 0-12 0'/%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3C/svg%3E");
}

#phone.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.62 2.62a2 2 0 0 1-.45 2.11L8 9.91a16 16 0 0 0 6.09 6.09l1.46-1.28a2 2 0 0 1 2.11-.45c.84.29 1.72.5 2.62.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

#email.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
}

#age.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
}

#taxable-income.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 8v8'/%3E%3Cpath d='M9.5 9.5c.6-1 4.4-1 5 0s-.3 2-2.5 2-3.1 1.1-2.5 2.1 4.4 1 5 0'/%3E%3C/svg%3E");
}

#rut.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='12' r='1.4'/%3E%3Cpath d='M13 10h4'/%3E%3Cpath d='M13 14h4'/%3E%3C/svg%3E");
}

#dependents-details.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21a4 4 0 0 0-8 0'/%3E%3Ccircle cx='12' cy='11' r='3'/%3E%3Cpath d='M22 21a4 4 0 0 0-4-4'/%3E%3Ccircle cx='18' cy='11' r='3'/%3E%3C/svg%3E");
}

#preferred-provider.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l7-4 7 4v14'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3Cpath d='M10 9h4'/%3E%3Cpath d='M12 7v4'/%3E%3C/svg%3E");
}

#message.form-control {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E");
}

@media (max-width: 680px) {
  .form-control {
    background-position: 13px center;
    background-size: 17px 17px;
    padding-left: 2.65rem;
  }

  textarea.form-control {
    background-position: 13px 13px;
    padding-left: 2.65rem;
  }

  .form-control[aria-invalid="true"] {
    background-position: left top, 13px center;
    background-size: auto, 17px 17px;
  }

  textarea.form-control[aria-invalid="true"] {
    background-position: left top, 13px 13px;
  }
}
