/* ==========================================================================
   "Cuéntanos tu proyecto": canales de contacto y formulario.
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.25fr);
  gap: 3rem clamp(40px,7vw,120px);
}

.contact h2 {
  font-size: clamp(2.3rem,4.8vw,4.2rem);
  font-weight: 850;
  font-stretch: 115%;
  line-height: .98;
  letter-spacing: -.025em;
}

.contact-intro {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 1.2rem;
  max-width: 36ch;
}

form {
  display: grid;
  gap: 26px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend, .field label {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .7rem;
  padding: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  --c: 9px;
  display: block;
  padding: .55rem .95rem .55rem .85rem;
  border: 1px solid var(--line);
  font-size: .95rem;
  font-weight: 500;
  transition: background .2s,border-color .2s;
}

.chip:hover span {
  border-color: var(--ink);
}

.chip input:checked+span {
  background: var(--teal);
  border-color: var(--teal);
  color: #000;
  clip-path: polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%);
}

.chip input:focus-visible+span {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.field {
  display: grid;
}

.field input, .field textarea {
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  padding: .5rem 0 .7rem;
  border-radius: 0;
  transition: border-color .2s;
}

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

.field input:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--teal);
}

.field input::placeholder, .field textarea::placeholder {
  color: var(--muted);
  opacity: .7;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.err {
  color: #C42A1B;
  font-size: .9rem;
  margin-top: .4rem;
  min-height: 0;
}

:root[data-theme="dark"] .err {
  color: #FF8A7A;
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) .err {
    color: #FF8A7A;
  }
}

.field.invalid input, .field.invalid textarea {
  border-bottom-color: #C42A1B;
}

.sent {
  display: none;
  padding: 40px;
  background: var(--surface);
}

.sent h3 {
  font-size: 2rem;
  font-weight: 800;
  font-stretch: 112%;
}

.sent p {
  margin: .8rem 0 1.6rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.contact.done form {
  display: none;
}

.contact.done .sent {
  display: block;
}

/* Contacto en el celeste de la marca (igual en modo claro y oscuro) */
.contact {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #000000;
  --muted: #00262C;
  --line: rgba(0,0,0,.28);
  --teal: #000000;
  --teal-ink: #FFFFFF;
  background: var(--sect);
  color: #000000;
}

.contact ::selection {
  background: #000000;
  color: #FFFFFF;
}

.contact .chip span {
  background: #FFFFFF;
  color: #000000;
  border-color: #FFFFFF;
  clip-path: polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%);
  transition: background .25s,color .25s,border-color .25s;
}

.contact .chip span, .contact .chip:hover span, .contact .chip input:checked+span {
  border: 0;
  padding: calc(.55rem + 1px) calc(.95rem + 1px) calc(.55rem + 1px) calc(.85rem + 1px);
}

.contact .chip input:checked+span {
  background: #000000;
  border-color: #000000;
  color: #FFFFFF;
}

.contact .chip input:focus-visible+span {
  outline: 2px solid #019EB5;
  outline-offset: -5px;
}

/* Pequeño rebote al seleccionar una opción */
.contact .chip span.pop {
  animation: chipPop .38s cubic-bezier(.3,1.6,.5,1);
}

@media (prefers-reduced-motion:reduce) {
  .contact .chip span.pop {
    animation: none;
  }
}

.contact .field input:focus, .contact .field textarea:focus {
  border-bottom-color: #000000;
}

.contact .field input::placeholder, .contact .field textarea::placeholder {
  color: #00262C;
  opacity: .6;
}

.contact .btn {
  clip-path: none;
  color: #000000;
  background: linear-gradient(225deg,#000000 0 15px,#FFFFFF 15px);
}

.contact .btn:hover {
  color: #FFFFFF;
  background: linear-gradient(225deg,#FFFFFF 0 15px,#000000 15px);
}

.contact .sent .btn {
  color: #FFFFFF;
  background: linear-gradient(225deg,#019EB5 0 15px,#000000 15px);
}

.contact .sent .btn:hover {
  color: #000000;
  background: linear-gradient(225deg,#000000 0 15px,#019EB5 15px);
}

.contact .btn:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

.contact .err, :root[data-theme="dark"] .contact .err {
  color: #5A0A02;
  font-weight: 600;
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) .contact .err {
    color: #5A0A02;
  }
}

.contact .field.invalid input, .contact .field.invalid textarea {
  border-bottom-color: #5A0A02;
}

.contact .sent p {
  color: #00262C;
}

/* Canales de contacto */
.c-links {
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.c-link {
  --c: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 12px;
  background: #FFFFFF;
  color: #000000;
  text-decoration: none;
  clip-path: polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%);
  transition: background .3s,color .3s,transform .25s;
}

.c-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: #000000;
  color: #FFFFFF;
  font-weight: 850;
  font-stretch: 112%;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: background .3s,color .3s;
}

.c-ico svg {
  width: 22px;
  height: 22px;
}

.c-txt {
  flex: 1;
  min-width: 0;
  display: grid;
}

.c-txt small {
  font-size: .8rem;
  font-weight: 600;
  color: #44585C;
  transition: color .3s;
}

.c-txt b {
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-arrow {
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .25s;
}

.c-link:hover {
  background: #000000;
  color: #FFFFFF;
  transform: translateX(4px);
}

.c-link:hover .c-ico {
  background: #FFFFFF;
  color: #000000;
}

.c-link:hover .c-txt small {
  color: #A9C2C6;
}

.c-link:hover .c-arrow {
  transform: translateX(3px) rotate(45deg);
}

.c-link:focus-visible {
  outline: 2px solid #019EB5;
  outline-offset: -5px;
}

/* Formulario dinámico: campos blancos con etiqueta flotante, línea que se dibuja al escribir y barra de avance */
.contact form {
  gap: 22px;
}

.contact .field {
  position: relative;
  transition: transform .25s ease;
}

.contact .field:focus-within {
  transform: translateY(-3px);
}

.contact .field label {
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  z-index: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: #44585C;
  pointer-events: none;
  transition: top .2s ease,font-size .2s ease,color .2s ease;
}

.contact .field:focus-within label, .contact .field.filled label {
  top: .5rem;
  font-size: .78rem;
  font-weight: 700;
  color: #000000;
}

.contact .field input, .contact .field textarea {
  border: 0;
  border-radius: 0;
  padding: 1.6rem 2.8rem .6rem 1rem;
  font-size: 1.08rem;
  color: #000000;
  background: #FFFFFF linear-gradient(#000000,#000000) 0 100%/0 3px no-repeat;
  clip-path: polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,0 100%);
  transition: background-size .4s cubic-bezier(.65,0,.25,1);
}

.contact .field textarea {
  min-height: 150px;
}

/* Campo completo: el recuadro pasa a negro con texto blanco */
.contact .field input, .contact .field textarea {
  transition: background-size .4s cubic-bezier(.65,0,.25,1),background-color .35s ease,color .35s ease;
}

.contact .field.ok input, .contact .field.ok textarea {
  background-color: #000000;
  color: #FFFFFF;
  caret-color: #FFFFFF;
  background-image: linear-gradient(#13B3CA,#13B3CA);
}

.contact .field.ok label {
  color: #FFFFFF;
}

.contact .field.ok::after {
  border-color: #13B3CA;
}

.contact .field.ok input:-webkit-autofill, .contact .field.ok input:-webkit-autofill:hover, .contact .field.ok input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #000000 inset;
  box-shadow: 0 0 0 1000px #000000 inset;
  -webkit-text-fill-color: #FFFFFF;
  caret-color: #FFFFFF;
}

/* Evita que el autocompletado del navegador pinte los campos de otro color */
.contact .field input:-webkit-autofill, .contact .field input:-webkit-autofill:hover, .contact .field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset;
  box-shadow: 0 0 0 1000px #FFFFFF inset;
  -webkit-text-fill-color: #000000;
  caret-color: #000000;
  transition: background-color 99999s ease 0s;
}

.contact .field input:autofill {
  background-color: #FFFFFF;
}

.contact .field input:focus, .contact .field textarea:focus {
  outline: none;
  border: 0;
  background-size: 100% 3px;
}

.contact .field.invalid input, .contact .field.invalid textarea {
  background-image: linear-gradient(#B3261E,#B3261E);
  background-size: 100% 3px;
}

.contact .field.ok::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  top: 1.15rem;
  z-index: 1;
  width: 7px;
  height: 13px;
  border-right: 2.5px solid #006A7A;
  border-bottom: 2.5px solid #006A7A;
  transform: rotate(45deg);
  animation: okIn .32s cubic-bezier(.3,1.6,.5,1);
}

@keyframes okIn {
  from {
    transform: rotate(45deg) scale(0);
  }
  to {
    transform: rotate(45deg) scale(1);
  }
}

.contact .hint {
  position: absolute;
  left: 1rem;
  right: 2.8rem;
  top: 1.6rem;
  z-index: 1;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #6B7C80;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease,transform .2s ease;
}

.contact .field:focus-within:not(.filled) .hint {
  opacity: 1;
  transform: none;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  margin-top: 4px;
}

.prog {
  flex: 1;
  min-width: 220px;
}

.prog-bar {
  display: flex;
  gap: 5px;
}

.prog-bar i {
  position: relative;
  flex: 1;
  height: 6px;
  overflow: hidden;
  background: #FFFFFF;
}

.prog-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000000;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.65,0,.25,1);
}

.prog-bar i.on::after {
  transform: scaleX(1);
}

/* Indicador de lo que falta: contador y etiquetas que pasan a negro al completarse */
.prog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: .85rem;
}

.prog-count {
  display: inline-flex;
  align-items: baseline;
  padding: .22rem .65rem;
  border-radius: 99px;
  background: #000000;
  color: #FFFFFF;
  font-weight: 800;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  transition: background .3s,color .3s;
}

.prog-count b {
  font-size: 1.05rem;
  font-weight: 850;
}

.prog-title {
  font-weight: 750;
  font-size: 1rem;
  color: #000000;
}

.prog-list {
  list-style: none;
  margin: .65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prog-list button {
  --c: 8px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .8rem .4rem .65rem;
  border: 0;
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  background: #FFFFFF;
  color: #000000;
  cursor: pointer;
  clip-path: polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%);
  transition: background .3s,color .3s;
}

.prog-list button::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D7263D;
  animation: erPulse 1.4s ease-in-out infinite;
}

.prog-list button:focus-visible {
  outline: 2px solid #000000;
  outline-offset: -4px;
}

.prog-list li.done button {
  background: #000000;
  color: #FFFFFF;
}

.prog-list li.done button::before {
  width: 5px;
  height: 9px;
  border-radius: 0;
  background: none;
  border-right: 2px solid #13B3CA;
  border-bottom: 2px solid #13B3CA;
  transform: rotate(45deg) translate(-1px,-2px);
  animation: none;
}

.prog-list button.pop {
  animation: chipPop .38s cubic-bezier(.3,1.6,.5,1);
}

.contact.ready .prog-count {
  background: #FFFFFF;
  color: #000000;
}

@media (prefers-reduced-motion:reduce) {
  .prog-list button.pop, .prog-list button::before {
    animation: none;
  }
}

.contact.ready .form-foot .btn {
  animation: btnNudge 1.6s ease-in-out infinite;
}

@keyframes btnNudge {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.contact .form-foot .btn.pop, .contact.ready .form-foot .btn.pop {
  animation: chipPop .38s cubic-bezier(.3,1.6,.5,1);
}

@media (prefers-reduced-motion:reduce) {
  .contact .field, .contact.ready .form-foot .btn {
    animation: none;
    transition: none;
  }
}

@media (max-width:860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:560px) {
  .two {
    grid-template-columns: 1fr;
  }
  .sent {
    padding: 28px;
  }
}

/* Envío real del formulario: trampa antispam, verificación y estados */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-turnstile:empty {
  display: none;
}

.form-status {
  min-height: 0;
  margin: 0;
  font-weight: 650;
  font-size: .95rem;
  color: #5A0A02;
}

.form-status:empty {
  display: none;
}

.contact .form-foot .btn[aria-busy="true"] {
  opacity: .7;
  cursor: progress;
  animation: none;
}
