/* ---------- Base ---------- */
html, body {
  margin: 0;
  height: 100%;
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;            /* kiosko: sin selección de texto */
  touch-action: manipulation;   /* evita zoom por doble toque */
  padding-bottom: env(safe-area-inset-bottom);
}

/* El campo de texto sí debe poder seleccionarse */
input {
  -webkit-user-select: text;
  user-select: text;
  font-size: 1.25rem;           /* >=16px evita el zoom automático en iOS */
}

::-webkit-scrollbar {
  display: none;
}

/* ---------- Fondo ---------- */
/* La ruta es relativa a este archivo: css/ -> ../img/ */
.fondo {
  position: fixed;
  inset: 0;
  z-index: -10;
  background: #eaf8fb url("../img/fondo.webp") center / cover no-repeat;
}

/* Velo suave para que la tarjeta destaque en pantallas horizontales */
.fondo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
              rgba(255, 255, 255, 0.55) 0%,
              rgba(255, 255, 255, 0) 70%);
}

/* Fondo para orientación HORIZONTAL (apaisado) */
@media (orientation: landscape) {
  .fondo {
    background-image: url("../img/fondo_h.webp");
  }
}

/* ---------- Tarjeta ---------- */
div.tarjeta {
  background-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(47, 158, 120, 0.6);
  animation: entrada 0.5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes entrada {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Campo de nombre ---------- */
.campo {
  min-height: 4rem;
  transition: box-shadow .2s ease, background-color .2s ease;
}

input.campo {
  background-color: rgba(255, 255, 255, 0.8);
}

.campo:focus {
  box-shadow: 0 0 0 4px rgba(47, 158, 120, 0.2);
}

/* ---------- Botón de videollamada ---------- */
button.btn-llamada {
  position: relative;
  overflow: hidden;
  min-height: 7rem;
  background-color: #0b5d75;
  background-image: linear-gradient(to right, #0b5d75, #08455a, #0b5d75);
}

/* Destello que cruza el botón cada pocos segundos */
.btn-llamada::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .18), transparent);
  transform: skewX(-20deg);
  animation: destello 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes destello {
  0%, 60% { left: -60%; }
  100%    { left: 130%; }
}

/* ---------- Selector de idioma ---------- */
.selector-idioma a {
  min-width: 7rem;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mensaje de error ---------- */
.error-msg {
  animation: sacudir .4s ease;
}

@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ---------- Enlaces del pie (términos / privacidad) ---------- */
.enlace-legal {
  background: none;
  border: 0;
  padding: 0.5rem 0.75rem;
  min-height: 2.75rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color .15s ease;
}
.enlace-legal:hover { color: #2f9e78; }

/* ---------- Modal legal ---------- */
dialog.modal-legal {
  width: min(80rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 3rem);
  margin: auto;
  padding: 0;
  border: 2px solid rgba(47, 158, 120, 0.6);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.96);
  color: #0f2a35;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

dialog.modal-legal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-entrada .25s cubic-bezier(.2, .8, .2, 1) both;
}

dialog.modal-legal::backdrop {
  background: rgba(15, 42, 53, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@keyframes modal-entrada {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(47, 158, 120, 0.25);
}

.modal-cabecera h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #2f9e78, #0b5d75);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-x {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 9999px;
  background: rgba(47, 158, 120, 0.12);
  color: #2f9e78;
  cursor: pointer;
}
.modal-x:hover { background: rgba(47, 158, 120, 0.22); }

.modal-cuerpo {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

.modal-cuerpo h3 {
  margin: 1.5rem 0 0.4rem;
  padding-left: 0.75rem;
  border-left: 4px solid #2f9e78;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0b5d75;
}
.modal-cuerpo h3:first-child { margin-top: 0; }

.modal-cuerpo p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #46646f;
}

.modal-pie {
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(47, 158, 120, 0.25);
}

.btn-modal {
  min-width: 12rem;
  min-height: 3.25rem;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 9999px;
  background: #2f9e78;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  transition: filter .15s ease, transform .15s ease;
}
.btn-modal:hover  { filter: brightness(1.1); }
.btn-modal:active { transform: translateY(2px); }

/* ---------- Accesibilidad: respetar "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  .tarjeta, .btn-llamada::after, .error-msg, dialog.modal-legal[open] {
    animation: none;
  }
}