/* ===================================================
   DETECTIVES ARGENTINA — Estilos Adicionales
   Módulo: Formulario Dinámico + Modales
=================================================== */

/* ── Prevenir scroll al abrir modal ── */
body.modal-open {
  overflow: hidden;
}

/* ════════════════════════════════════════════════════
   MODALES — BASE
════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; /* oculto por defecto; JS lo activa */
  align-items: flex-start;  /* anclar al tope para que el scroll sea desde arriba */
  justify-content: center;
  padding: 1.5rem 1.25rem 3rem;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Cuando el modal está activo (JS quita el atributo hidden) */
.modal-overlay:not([hidden]) {
  display: flex;
}

.modal-box {
  background: var(--col-surface);
  border: 1px solid rgba(201, 168, 70, .22);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  width: 100%;
  max-width: 520px;
  position: relative;
  /* sin margin:auto para que no quede cortado arriba */
  margin-top: 0;
  box-shadow: 0 8px 48px rgba(0, 0, 0, .7), 0 0 0 1px rgba(201, 168, 70, .06);
  animation: modal-entrada .22s ease;
}

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

.modal-box--wide {
  max-width: 640px;
}

.modal-close-btn {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  color: var(--col-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
  flex-shrink: 0;
}
.modal-close-btn:hover {
  background: rgba(201, 168, 70, .12);
  color: var(--col-gold);
}

/* Encabezado de modal */
.modal-header {
  margin-bottom: 1.15rem;
  padding-right: 2rem; /* espacio para botón X */
}
.modal-icon {
  font-size: 2.2rem;
  margin-bottom: .5rem;
  display: block;
}
.modal-titulo {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--col-text);
  line-height: 1.15;
}
.modal-titulo--alerta {
  color: var(--col-red);
}
.modal-titulo--gold {
  color: var(--col-gold);
}
.modal-subtitulo {
  font-size: .85rem;
  color: var(--col-text-muted);
  margin-top: .4rem;
  line-height: 1.6;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--col-border);
  margin-block: 1.1rem;
}

.modal-cuerpo {
  font-size: .94rem;
  color: rgba(255, 255, 255, .82);
  line-height: 1.72;
}
.modal-cuerpo p { margin-bottom: .75rem; }
.modal-cuerpo p:last-child { margin-bottom: 0; }
.modal-cuerpo strong { color: var(--col-text); font-weight: 600; }

/* Alerta de costo dentro del modal */
.modal-alerta-costo {
  background: rgba(201, 168, 70, .07);
  border: 1px solid rgba(201, 168, 70, .2);
  border-radius: var(--radius-md);
  padding: .9rem 1.1rem;
  margin-block: 1rem;
}
.modal-alerta-costo p {
  font-size: .85rem;
  color: var(--col-text);
  line-height: 1.68;
}
.modal-alerta-costo strong {
  color: var(--col-gold);
}
.modal-alerta-titulo {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--col-gold);
  margin-bottom: .45rem;
  display: block;
}

/* Nota gratis */
.modal-nota-gratis {
  font-size: .8rem;
  font-weight: 600;
  color: var(--col-green);
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: .03em;
}

/* Botones de modal */
.modal-botones {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-top: 1.25rem;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  padding: .85rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .18s, transform .15s, box-shadow .18s;
}
.modal-btn:hover  { opacity: .88; transform: translateY(-1px); }
.modal-btn:active { transform: translateY(0); }

.modal-btn--verde {
  background: #2d8a5a;
  color: #fff;
}
.modal-btn--verde:hover {
  background: #34a068;
  box-shadow: 0 4px 18px rgba(45, 138, 90, .35);
}

.modal-btn--rojo {
  background: rgba(169, 44, 35, .30);   /* antes: rgba(201, 82, 82, .14) */
  border: 1px solid rgba(169, 44, 35, .70);  /* antes: rgba(201, 82, 82, .30) */
  color: #c94a3a;                        /* antes: var(--col-red) */
}
.modal-btn--rojo:hover {
  background: rgba(169, 44, 35, .50);   /* antes: rgba(201, 82, 82, .22) */
}

.modal-btn--abandonar {
  background: var(--col-red);
  color: #fff;
  margin-top: .5rem;
}
.modal-btn--abandonar:hover {
  background: #b04040;
}

.modal-btn--gris {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--col-text-muted);
}
.modal-btn--gris:hover { background: rgba(255, 255, 255, .1); }

.modal-btn-nota {
  font-size: .68rem;
  color: rgba(255, 255, 255, .50);
  text-align: center;
  margin-top: .25rem;
  letter-spacing: .03em;
}

/* Ícono WhatsApp SVG inline en botón */
.btn-wa-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  fill: currentColor;
}

/* ════════════════════════════════════════════════════
   PANELES DE SERVICIO — dentro del form
════════════════════════════════════════════════════ */
.servicio-panel {
  border: 1px solid var(--col-border);
  border-radius: var(--radius-md);
  background: rgba(201, 168, 70, .03);
  padding: 1.1rem 1.15rem;
  margin-top: .25rem;
  margin-bottom: .8rem;
}

.servicio-panel-titulo {
  font-family: var(--font-sans);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--col-gold);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.servicio-panel-info {
  font-size: .85rem;
  color: rgba(255, 255, 255, .78);
  line-height: 1.68;
  background: rgba(255, 255, 255, .03);
  border-left: 2px solid rgba(201, 168, 70, .3);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
}

.servicio-panel-pregunta {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  margin-bottom: .5rem;
  margin-top: .85rem;
  display: block;
}

/* ── Tipo de vigilancia (radio) ── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}

.radio-opcion {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius-sm);
  padding: .5rem .9rem;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  font-size: .85rem;
  color: rgba(255, 255, 255, .75);
}
.radio-opcion input[type="radio"] {
  accent-color: var(--col-gold);
  width: .9rem;
  height: .9rem;
  flex-shrink: 0;
}
.radio-opcion:has(input:checked) {
  border-color: rgba(201, 168, 70, .45);
  background: rgba(201, 168, 70, .07);
  color: var(--col-text);
}

/* ── Tabla días y horarios ── */
.dias-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.dias-tabla th {
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--col-text-muted);
  padding: .3rem .5rem;
  text-align: left;
  border-bottom: 1px solid var(--col-border);
}
.dias-tabla td {
  padding: .3rem .4rem;
  vertical-align: middle;
}
.dias-tabla tr:hover td { background: rgba(201, 168, 70, .03); }

/* Fila de horario (oculta hasta que se tilde el día) */
.fila-horario td {
  padding-top: 0;
  padding-bottom: .4rem;
}
.fila-horario .horario-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  padding-left: 1.8rem;
}
.fila-horario .horario-sep {
  font-size: .78rem;
  color: rgba(255, 200, 80, .9);
}

.dia-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, .75);
  font-size: .86rem;
}
.dia-check input[type="checkbox"] {
  accent-color: var(--col-gold);
  width: .9rem;
  height: .9rem;
  flex-shrink: 0;
}
.dia-check:has(input:checked) { color: var(--col-text); }

.horario-select {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  color: var(--col-text);
  font-family: var(--font-sans);
  font-size: .78rem;
  padding: .28rem .55rem;
  cursor: pointer;
  outline: none;
  transition: border-color .18s;
  max-width: 90px;
}
.horario-select:focus {
  border-color: rgba(201, 168, 70, .5);
}
.horario-select option { background: #181c26; }

/* ── Aviso máximo 4 horas ── */
.aviso-4hs {
  font-size: .76rem;
  color: var(--col-gold);
  background: rgba(201, 168, 70, .07);
  border: 1px solid rgba(201, 168, 70, .2);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  margin-top: .4rem;
  line-height: 1.6;
}

/* ── Checks de movilidad y opciones múltiples ── */
.checks-lista {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .3rem;
}
.checks-lista--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .75rem;
}

.check-opcion {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  cursor: pointer;
  color: var(--col-text-muted);
  font-size: .82rem;
  line-height: 1.45;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.check-opcion input[type="checkbox"] {
  accent-color: var(--col-gold);
  width: .9rem;
  height: .9rem;
  flex-shrink: 0;
  margin-top: .14rem;
}
.check-opcion:has(input:checked) {
  background: rgba(201, 168, 70, .06);
  color: var(--col-text);
}

/* ── Sub-paneles condicionales empresa ── */
.sub-panel-condicional {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--col-border);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  margin-top: .4rem;
  margin-bottom: .2rem;
}
.sub-panel-condicional .form-input {
  margin-top: .3rem;
}

/* ── Textarea del panel de servicio ── */
.panel-textarea {
  width: 100%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius-sm);
  color: var(--col-text);
  font-family: var(--font-sans);
  font-size: .84rem;
  padding: .6rem .85rem;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color .2s, background .2s;
  line-height: 1.6;
}
.panel-textarea::placeholder { color: rgba(255, 255, 255, .38); }
.panel-textarea:focus {
  border-color: rgba(201, 168, 70, .55);
  background: rgba(201, 168, 70, .04);
  box-shadow: 0 0 0 3px rgba(201, 168, 70, .07);
}

/* ── Mensaje de advertencia panel ── */
.panel-advertencia {
  display: flex;
  gap: .6rem;
  background: rgba(201, 82, 82, .07);
  border: 1px solid rgba(201, 82, 82, .2);
  border-radius: var(--radius-sm);
  padding: .75rem .9rem;
  font-size: .83rem;
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
  margin-bottom: .75rem;
}
.panel-advertencia-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: .02rem;
}

/* ── Error de campo inline ── */
.field-error {
  font-size: .73rem;
  color: var(--col-red);
  margin-top: .2rem;
}
.input-error {
  border-color: rgba(201, 82, 82, .5) !important;
  box-shadow: 0 0 0 2px rgba(201, 82, 82, .1) !important;
}

/* ── Botón submit con ícono WhatsApp ── */
.form-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
}
.form-submit-btn .btn-wa-icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE — Paneles y modales en mobile
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .modal-box {
    padding: 1.25rem 1.1rem;
  }
  .modal-botones {
    gap: .55rem;
  }
  .checks-lista--2col {
    grid-template-columns: 1fr;
  }
  .dias-tabla th:last-child,
  .dias-tabla td:last-child {
    /* La columna de horarios se reorganiza */
  }
  /* En mobile la tabla de días se convierte en bloques */
  .dias-tabla,
  .dias-tabla thead,
  .dias-tabla tbody,
  .dias-tabla th,
  .dias-tabla td,
  .dias-tabla tr {
    display: block;
  }
  .dias-tabla thead { display: none; }
  .dias-tabla tr.fila-dia {
    border-bottom: 1px solid var(--col-border);
    padding: .2rem 0;
  }
  .fila-horario .horario-wrap {
    padding-left: 1rem;
  }
  .horario-select {
    max-width: 80px;
  }
  .radio-group {
    flex-direction: column;
  }
  .radio-opcion {
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════
   MODAL SERVICIO — Barra de progreso y navegación
════════════════════════════════════════════════════ */
.modal-progreso {
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  margin-bottom: .4rem;
  overflow: hidden;
}

.modal-progreso-barra {
  height: 100%;
  background: var(--col-gold, #c9a846);
  border-radius: 2px;
  transition: width .35s ease;
}

.modal-progreso-texto {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
  text-align: right;
  margin: 0 0 1rem;
  letter-spacing: .04em;
}

.modal-botones--nav {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.modal-btn--gris {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: .9rem;
  transition: border-color .2s, color .2s;
}
.modal-btn--gris:hover {
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

/* ── Placeholders más claros en campos del modal ── */
.modal-box .form-input::placeholder,
.modal-box input::placeholder {
  color: rgba(255, 255, 255, .35);
}
.modal-box select,
.modal-box .form-select {
  color: rgba(255, 255, 255, .82);
}

/* ════════════════════════════════════════════════════
   BOTÓN FLOTANTE WHATSAPP
════════════════════════════════════════════════════ */
.wa-float {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9000;
  width: 3.25rem;
  height: 3.25rem;
  background: #36a35c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .06),
    0 2px 8px rgba(31, 107, 58, .4);
  text-decoration: none;
  animation: wa-bounce 2.8s ease-in-out infinite;
  transition: background .2s, box-shadow .2s, transform .15s;
}

.wa-float:hover {
  background: #256e40;
  box-shadow:
    0 6px 28px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(201, 168, 70, .18),
    0 4px 14px rgba(31, 107, 58, .5);
  animation-play-state: paused;
  transform: translateY(-3px) scale(1.06);
}

.wa-float:active {
  transform: translateY(0) scale(.97);
}

.wa-float-icon {
  width: 1.65rem;
  height: 1.65rem;
  fill: #e8f5ec;
  flex-shrink: 0;
}

@keyframes wa-bounce {
  0%,  55%, 100% { transform: translateY(0); }
  65%            { transform: translateY(-7px); }
  75%            { transform: translateY(-3px); }
  85%            { transform: translateY(-5px); }
  92%            { transform: translateY(-1px); }
}

@media (max-width: 600px) {
  .wa-float {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 3.3rem;
    height: 3.3rem;
  }
  .wa-float-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}
