/* ==========================================================================
   Servicios, contacto, pie, avisos y ficha de proyecto (modal)
   ========================================================================== */

/* ---------- Servicios ---------- */

.servicios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 20px;
}
.servicio {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 34px 32px 36px;
  border-radius: var(--radio);
  background: var(--fondo);
  box-shadow: inset 0 0 0 1px var(--borde);
}
.servicio__icono {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: var(--acento-suave);
  color: var(--acento-texto);
}
.servicio__icono .icono { width: 26px; height: 26px; stroke-width: 1.8; }
.servicio__num {
  position: absolute; top: 28px; right: 30px;
  font-family: var(--fuente-display); font-style: italic;
  font-size: 22px; color: var(--texto-3);
}
.servicio h3 { font-size: 21px; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
.servicio p { color: var(--texto-2); font-size: 15.5px; line-height: 1.6; }

/* ---------- Contacto ---------- */

.contacto {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 56px;
  padding: 64px;
  border-radius: 32px;
  background: var(--oscuro);
  color: #f2f4f9;
  overflow: hidden;
  isolation: isolate;
}
.contacto::before {
  content: "";
  position: absolute; top: -40%; left: -20%; z-index: -1;
  width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(47 92 255 / .45), transparent);
  pointer-events: none;
}
.contacto h2 { margin-bottom: 18px; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.contacto h2 em { font-size: 1.08em; color: #9fb2ff; }
.contacto__texto > p { max-width: 420px; color: #b8bfce; font-size: 17px; }

.canales { display: flex; flex-direction: column; gap: 12px; margin-top: 34px; }
.canales a { display: inline-flex; align-items: center; gap: 14px; font-weight: 700; transition: color .2s; }
.canales a:hover { color: #9fb2ff; }
.canales small { display: block; color: #8d96aa; font-size: 13px; font-weight: 600; }
.canales__icono { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(255 255 255 / .08); }

.formulario { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; align-content: start; }
.campo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.campo--ancho { grid-column: 1 / -1; }
.campo label { color: #d6dbe8; font-size: 13.5px; font-weight: 700; }
.campo label span { color: #8d96aa; font-weight: 500; }
.campo input, .campo select, .campo textarea {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 14px;
  background: rgb(255 255 255 / .06);
  color: #fff;
  font-size: 15.5px; font-weight: 500;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.campo textarea { height: auto; min-height: 136px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.campo select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8bfce' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}
.campo select option { color: #0f1422; }
.campo ::placeholder { color: #7c869b; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: #7d95ff;
  background: rgb(255 255 255 / .09);
  box-shadow: 0 0 0 4px rgb(125 149 255 / .2);
}
.formulario__pie { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 4px; }
.formulario__nota { color: #8d96aa; font-size: 13px; font-weight: 600; }
.formulario__nota a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.formulario__estado { font-weight: 700; }
.formulario__estado:empty { display: none; }
.formulario__estado.ok { color: #7ee2a8; }
.formulario__estado.error { color: #ffa4a4; }
.formulario button[disabled] { opacity: .7; cursor: progress; }

/* ---------- Pie ---------- */

.pie { padding: 36px 0 44px; }
.pie__interior { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 32px; }
.pie__menu { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--texto-2); font-weight: 600; }
.pie__menu a:hover { color: var(--tinta); }
.pie__copy { color: var(--texto-3); font-size: 14px; font-weight: 600; }

/* ---------- Aviso flotante ---------- */

.aviso {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--tinta); color: var(--fondo);
  font-weight: 700; font-size: 14px;
  box-shadow: var(--sombra-l);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Ficha de proyecto (modal) ---------- */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 24px;
  background: rgb(8 11 18 / .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s;
}
.modal.abierto { opacity: 1; }
.modal__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "barra barra" "vista info";
  width: min(1240px, 100%);
  height: min(800px, 100%);
  border-radius: 28px;
  background: var(--superficie);
  box-shadow: var(--sombra-l);
  overflow: hidden;
  transform: translateY(18px) scale(.985);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.modal.abierto .modal__panel { transform: none; }

.modal__barra {
  grid-area: barra;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--borde);
  background: var(--superficie);
}
.segmentos { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--suave); }
.segmentos button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 999px;
  color: var(--texto-2);
  font-size: 14px; font-weight: 700;
  transition: background .2s, color .2s;
}
.segmentos button .icono { width: 16px; height: 16px; }
.segmentos button:hover { color: var(--tinta); }
.segmentos button[aria-selected="true"] { background: var(--superficie); color: var(--tinta); box-shadow: var(--sombra-s); }
.modal__navegacion { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.modal__contador { min-width: 48px; color: var(--texto-3); font-size: 13px; font-weight: 700; text-align: center; }
.boton-icono {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--borde);
  transition: background .2s;
}
.boton-icono .icono { width: 18px; height: 18px; }
.boton-icono:hover { background: var(--suave); }
.boton-icono[disabled] { opacity: .35; cursor: default; background: none; }

.modal__vista {
  grid-area: vista;
  position: relative;
  display: grid; place-items: center;
  padding: 36px;
  background: var(--tinte-p, var(--tinte));
  container-type: size;
  overflow: hidden;
}
.modal__vista .navegador { width: min(100cqw, calc((100cqh - 30px) * 1.6)); box-shadow: var(--sombra-l); animation: entrar .35s ease both; }
.modal__vista .telefono { height: min(100cqh, calc(100cqw * 844 / 390)); box-shadow: var(--sombra-l); animation: entrar .35s ease both; }
@keyframes entrar { from { opacity: 0; transform: translateY(10px) scale(.99); } }

.vivo { position: absolute; top: 0; left: 0; z-index: 2; border: 0; background: #fff; transform-origin: 0 0; }
.cargando {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: var(--suave);
  transition: opacity .4s;
}
.cargando.listo { opacity: 0; pointer-events: none; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid color-mix(in srgb, var(--texto-3) 30%, transparent);
  border-top-color: var(--acento);
  border-radius: 50%;
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.modal__info {
  grid-area: info;
  display: flex; flex-direction: column; gap: 18px;
  padding: 34px 32px 32px;
  border-left: 1px solid var(--borde);
  overflow-y: auto;
}
.modal__meta { color: var(--acento-texto); font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.modal__titulo { font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.modal__desc { color: var(--texto-2); font-size: 16.5px; line-height: 1.6; }
.ficha { margin: 4px 0 0; border-top: 1px solid var(--borde); }
.ficha div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--borde); font-size: 14.5px; }
.ficha dt { color: var(--texto-3); font-weight: 600; }
.ficha dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.ficha a:hover { color: var(--acento-texto); }
.testimonio { margin: 0; padding: 20px 22px; border-radius: 18px; background: var(--suave); }
.testimonio p { font-family: var(--fuente-display); font-style: italic; font-size: 21px; line-height: 1.35; }
.testimonio cite { display: block; margin-top: 10px; color: var(--texto-2); font-size: 13px; font-style: normal; font-weight: 700; }
.modal__acciones { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 6px; }
.modal__acciones .boton { width: 100%; }
.modal__pasos { display: none; }

@media (max-width: 900px) {
  .modal { display: block; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
  .modal__panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "barra" "vista" "info";
    width: 100%; height: auto; min-height: 100%;
    border-radius: 0;
    overflow: visible;
  }
  .modal__barra { position: sticky; top: 0; z-index: 5; padding: 10px 12px; }
  .modal__vista { height: min(64vh, 560px); padding: 24px 20px; }
  .modal__vista[data-modo="escritorio"] { height: auto; padding: 28px 20px; container-type: normal; }
  .modal__vista[data-modo="escritorio"] .navegador { width: 100%; }
  .modal__info { padding: 28px 20px 40px; border-left: 0; overflow: visible; }
  .modal__acciones { margin-top: 8px; }
  .modal__pasos { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
  .modal__pasos .boton { flex: 1; }
}

@media (max-width: 560px) {
  .modal__contador, .modal__navegacion [data-mover] { display: none; }
  .segmentos button { height: 34px; padding: 0 12px; font-size: 13px; }
  .modal__titulo { font-size: 28px; }
}

@media (max-width: 400px) {
  .segmentos button .icono { display: none; }
}

@media (max-width: 1024px) {
  .contacto { grid-template-columns: 1fr; gap: 40px; padding: 48px 40px; }
}

@media (max-width: 760px) {
  .contacto { padding: 40px 22px 32px; border-radius: 26px; }
  .formulario { grid-template-columns: 1fr; }
  .servicio { padding: 28px 24px 30px; }
  .pie__interior { flex-direction: column; align-items: flex-start; }
}

/* ---------- Aviso legal y privacidad ---------- */

.legal { padding: 64px 0 96px; }
.legal__caja { max-width: 780px; }
.legal__idioma { margin-bottom: 18px; font-size: 14px; font-weight: 700; }
.legal__idioma a, .legal__texto a { color: var(--acento-texto); text-decoration: underline; text-underline-offset: 3px; }
.legal .seccion__titulo { margin-bottom: 10px; }
.legal__fecha { color: var(--texto-3); font-size: 14px; font-weight: 600; }
.legal__texto h2 { margin: 44px 0 12px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.legal__texto p, .legal__texto li { color: var(--texto-2); }
.legal__texto p + p { margin-top: 12px; }
.legal__texto strong { color: var(--tinta); }
.legal__texto ul { margin: 0; padding-left: 20px; }
.legal__texto li + li { margin-top: 8px; }
.legal__texto .legal__aaip { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--suave); font-size: 14px; }
.pie__menu a[aria-current="page"] { color: var(--tinta); }
