/* Contacto y vista previa del formulario */
#contacto {
  position: relative;
  isolation: isolate;
  padding-block: clamp(88px, 8vw, 138px) clamp(42px, 5.5vw, 90px);
  scroll-margin-top: 0;
}

#contacto::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 13% 26%, #6260c453, transparent 58%),
    radial-gradient(ellipse at 83% 4%, #6196aa24, transparent 54%),
    repeating-linear-gradient(135deg, #efefff09 0 1px, transparent 1px 24px);
  mask-image: linear-gradient(transparent, #000 20%, #000 55%, transparent);
  pointer-events: none;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "intro form" "channels form";
  align-items: start;
  column-gap: clamp(26px, 5vw, 95px);
  row-gap: clamp(26px, 3vw, 51px);
}

.contact-intro { grid-area: intro; }

.contact-intro .eyebrow { color: var(--mint-soft); }

.contact-intro .eyebrow .short-line {
  display: block;
  width: 2.6em;
  height: 1px;
  background: currentColor;
}

#contact-title {
  margin: clamp(15px, 1.7vw, 30px) 0 0;
  font-size: clamp(2.58rem, 5.2vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -.071em;
  line-height: .96;
  text-wrap: balance;
}

#contact-title em {
  display: block;
  color: var(--mint-soft);
}

.contact-lead {
  max-width: 37ch;
  margin-top: clamp(17px, 2vw, 28px);
  color: #edf0fd;
  font-size: clamp(.96rem, 1.35vw, 1.19rem);
  line-height: 1.59;
}

.contact-channels { grid-area: channels; }

.contact-route {
  display: grid;
  justify-items: start;
  padding-block: clamp(13px, 1.5vw, 23px);
  border-top: 1px solid #f1f5ff4d;
}

.contact-route h3 {
  margin-bottom: .21rem;
  color: #e0e1fb;
  font-size: .82rem;
  font-weight: 700;
}

.contact-route a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: .5em;
  text-decoration-thickness: 1px;
}

.contact-route .contact-email {
  color: var(--mint-soft);
  font-size: clamp(1.17rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.035em;
  text-decoration: none;
}

.contact-route .contact-external {
  color: var(--on-dark);
  font-size: .89rem;
  font-weight: 600;
}

.contact-route a:hover { color: #fff; }
.contact-route a:focus-visible { outline-color: var(--mint-soft); }

.contact-preview {
  grid-area: form;
  position: relative;
  display: grid;
  min-width: 0;
  padding: clamp(23px, 3.25vw, 54px);
  overflow: clip;
  scroll-margin-top: calc(var(--header-h) + 16px);
  border: 1px solid #dedfec;
  border-radius: clamp(20px, 2.6vw, 37px);
  background: linear-gradient(155deg, #f0f3fb, #fff 32%);
  box-shadow: 0 28px 85px -40px #131237bc;
  color: var(--ink);
}

.contact-preview::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #a2ebcd, #67c9b9 28%, #7675d9 81%, #bdbdf2);
}

.contact-form-head, .contact-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.contact-form-head {
  justify-content: space-between;
  gap: 9px 12px;
}

.contact-form-head h3 {
  font-size: clamp(1.8rem, 3.05vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.057em;
  line-height: 1.06;
}

.contact-preview-mode {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .37rem .67rem;
  border: 1px solid #cbcde6;
  border-radius: 99px;
  background: #eef0fa;
  color: #38376f;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.contact-preview-mode::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5456a4;
}

.contact-form-required {
  margin-top: .47rem;
  color: #525972;
  font-size: .76rem;
  line-height: 1.38;
}

.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.34vw, 22px) clamp(13px, 1.65vw, 25px);
  margin-block: clamp(17px, 1.8vw, 29px) clamp(17px, 2.1vw, 36px);
}

.contact-field {
  display: grid;
  align-content: end;
  min-width: 0;
  gap: .35rem;
}

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

.contact-field label {
  font-size: clamp(.79rem, 1.11vw, .94rem);
  font-weight: 700;
  line-height: 1.35;
}

.contact-field label span, .contact-form-required span { color: #4947a4; }
.contact-field label small {
  margin-inline-start: .25rem;
  color: #575d74;
  font-size: .7rem;
  font-weight: 500;
}

.contact-field :is(input, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .68rem .78rem;
  border: 1px solid #bfc5d9;
  border-radius: 10px;
  background: #f8f9fd;
  color: #161935;
  font: 500 1rem/1.3 Montserrat, "Helvetica Neue", Arial, sans-serif;
  scroll-margin-top: calc(var(--header-h) + 16px);
  transition: background-color .2s, border-color .2s;
}

.contact-field :is(input, textarea):hover { border-color: #7c85a9; }
.contact-field :is(input, textarea):focus {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
  background: #fff;
}

.contact-field :is(input, textarea):user-invalid {
  border-color: #a13758;
  background: #fff6f7;
}

.contact-field textarea {
  min-height: 84px;
  resize: vertical;
}

.contact-field-hint {
  min-height: 1.4em;
  color: #505770;
  font-size: .78rem;
  line-height: 1.45;
}

.contact-form-actions { gap: .7rem 1.15rem; }

.contact-preview-action {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: .64rem 1.1rem;
  border: 1px solid #29276b;
  border-radius: 9px;
  background: #29276b;
  color: #fff;
  font-size: .91rem;
  font-weight: 700;
  transition: background-color .22s, border-color .22s;
}

.contact-preview-action:hover:enabled {
  border-color: #3c3a96;
  background: #3c3a96;
}

.contact-preview-action:disabled { opacity: .62; }
.contact-preview-action span { color: var(--mint-soft); font-size: 1.22em; }

#contact-preview-note {
  margin-top: .75rem;
  color: #4d5571;
  font-size: .74rem;
  line-height: 1.42;
}

.contact-preview-result:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1.15rem;
  margin-top: .95rem;
  padding: .75rem .9rem;
  border: 1px solid #91bdaf;
  border-radius: 10px;
  background: #e8f8f1;
  color: #133c32;
}

.contact-preview-result h4 {
  margin-bottom: .15rem;
  font-size: .88rem;
}

.contact-preview-result p {
  font-size: .77rem;
  line-height: 1.4;
}

.contact-preview-result button {
  min-height: 40px;
  padding: .35rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: underline;
}

.contact-preview :is(button, .contact-preview-result):focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (max-width: 850px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "intro" "form" "channels";
  }
  #contact-title { font-size: clamp(2.58rem, 8vw, 5rem); }
}

@media (max-width: 560px) {
  .contact-fields { grid-template-columns: minmax(0, 1fr); }
  [data-contact-step="query"] .contact-preview-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-preview :is(input, textarea, button) { transition: none; }
}

.contact-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 21px);
  margin-block: clamp(16px, 2vw, 27px) clamp(21px, 2.4vw, 34px);
  padding: 0;
  list-style: none;
}

.contact-progress li {
  display: flex;
  align-items: center;
  gap: .52rem;
  padding-block: .67rem;
  border-bottom: 2px solid #d7daea;
  color: #555d77;
  font-size: clamp(.71rem, 1.05vw, .86rem);
  font-weight: 700;
}

.contact-progress li span {
  display: inline-grid;
  min-width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 1px solid #c8cee2;
  border-radius: 50%;
  font-size: .71rem;
}

.contact-progress li[aria-current="step"] {
  border-color: #4c49a4;
  color: #262469;
}

.contact-progress li[aria-current="step"] span {
  border-color: #3d398a;
  background: #3d398a;
  color: #fff;
}

.contact-stage, .contact-profiles {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-stage-title {
  font-size: clamp(1.22rem, 2vw, 1.64rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.15;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.contact-stage-title:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 4px;
  border-radius: 3px;
}

.contact-stage-lead {
  margin-top: .5rem;
  color: #505770;
  font-size: .84rem;
  line-height: 1.5;
}

.contact-choices, .contact-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .52rem;
  padding: 0;
}

.contact-choices {
  margin-block: .85rem 1.25rem;
}

.contact-choice {
  display: inline-flex;
  position: relative;
  max-width: 100%;
}

.contact-choice > input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.contact-choice > span {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .62rem .85rem;
  border: 1px solid #b7bed8;
  border-radius: 999px;
  background: #f5f6fc;
  color: #252846;
  font-size: .81rem;
  font-weight: 700;
  line-height: 1.3;
  transition: background-color .18s, border-color .18s, color .18s;
}

.contact-choice > span::before {
  box-sizing: border-box;
  content: "";
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border: 1px solid #6d779b;
  border-radius: 50%;
}

.contact-choice:hover > span {
  border-color: #6b72a3;
  background: #e9ebf9;
}

.contact-choice > input:checked + span {
  border-color: #5b9e8d;
  background: #e2f5ed;
  color: #183f35;
}

.contact-choice > input:checked + span::before {
  border: 3px solid #277864;
  background: #c9ebdf;
}

.contact-choice > input:focus-visible + span {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.contact-topic-error {
  margin: -.48rem 0 .85rem;
  color: #a13758;
  font-size: .77rem;
  font-weight: 700;
}

.contact-profiles legend {
  padding: 0;
  font-size: .9rem;
  font-weight: 700;
}

.contact-profiles legend small {
  margin-inline-start: .25rem;
  color: #575d74;
  font-size: .7rem;
  font-weight: 500;
}

.contact-summary {
  margin-block: .72rem .8rem;
  list-style: none;
}

.contact-summary li {
  padding: .29rem .57rem;
  border: 1px solid #a9cdbf;
  border-radius: 99px;
  background: #eaf7f1;
  color: #214b40;
  font-size: .73rem;
  font-weight: 700;
  line-height: 1.3;
}

.contact-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 49px;
  padding: .6rem .8rem;
  border: 1px solid #c2c8df;
  border-radius: 9px;
  background: #f8f9fd;
  color: #29276b;
  font-size: .86rem;
  font-weight: 700;
}

.contact-back:hover {
  border-color: #817eb5;
  background: #ececfa;
}

@media (max-width: 560px) {
  .contact-form-actions { gap: .65rem; }
  .contact-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-choice > span {
    width: 100%;
    gap: .4rem;
    padding-inline: .66rem;
    font-size: .76rem;
  }
}

@media (max-width: 350px) {
  .contact-choices { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .contact-choice > span { transition: none; }
}

.contact-summary[hidden] { display: none; }
.contact-profile-summary { margin-top: -.34rem; }
.contact-profile-summary li {
  border-color: #c8cce4;
  background: #f0f1fa;
  color: #38376f;
}
