/* ════════════════════════════════════════
   TERMS — Sección de Privacidad y Datos:
   tarjeta compacta con botón + modal completo
   ════════════════════════════════════════ */

#terms {
  padding: 5rem 2rem;
  background: var(--gray-light);
}

/* ── Tarjeta visible en la landing ── */
.terms-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.09);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.terms-card-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.terms-card-body { flex: 1; min-width: 220px; }

.terms-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 0.5rem;
}

.terms-card-body p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Tags de normativas */
.terms-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.terms-card-tags li {
  background: #fff3e0;
  color: var(--orange-dark);
  border: 1px solid #ffcc80;
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

/* Botón de abrir modal */
.btn-terms-open {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: var(--white);
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 30px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(255,140,0,0.35);
  flex-shrink: 0;
}

.btn-terms-open:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,140,0,0.5);
}

/* ════════════════════════════════════════
   MODAL OVERLAY + PANEL
   ════════════════════════════════════════ */

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.terms-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.terms-modal {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.terms-modal-overlay.active .terms-modal {
  transform: translateY(0) scale(1);
}

/* Header fijo del modal */
.terms-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.terms-modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 0.15rem;
}

.terms-modal-header p {
  font-size: 0.82rem;
  color: var(--gray);
}

.terms-modal-close {
  background: var(--gray-light);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--gray-dark);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
}

.terms-modal-close:hover {
  background: var(--orange);
  color: var(--white);
}

/* Cuerpo scrolleable del modal */
.terms-modal-body {
  overflow-y: auto;
  padding: 1.75rem 2rem;
  flex: 1;
}

/* Footer fijo del modal */
.terms-modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--white);
}

/* ── Contenido interior del modal (reutiliza estilos de terms-section) ── */
.terms-modal-body .terms-section { margin-bottom: 2rem; }

.terms-modal-body .terms-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #ffe0b2;
}

.terms-modal-body .terms-section p {
  font-size: 0.91rem;
  color: #555;
  line-height: 1.75;
  margin-bottom: 0.65rem;
}

.terms-modal-body .terms-section ul {
  padding-left: 0;
  list-style: none;
  margin-bottom: 0.65rem;
}

.terms-modal-body .terms-section ul li {
  font-size: 0.91rem;
  color: #555;
  padding: 0.25rem 0 0.25rem 1.5rem;
  position: relative;
  line-height: 1.6;
}

.terms-modal-body .terms-section ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}

/* Cajas de alerta dentro del modal */
.terms-modal-body .alert-box {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.terms-modal-body .alert-box.yellow { background: #fff8e1; border-left: 4px solid #ffc107; color: #6d4c00; }
.terms-modal-body .alert-box.blue   { background: #e3f2fd; border-left: 4px solid #2196f3; color: #0d47a1; }
.terms-modal-body .alert-box strong { display: block; margin-bottom: 0.25rem; font-family: 'Poppins', sans-serif; }

/* ── Bloque Meta API dentro del modal ── */
.meta-api-block {
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1rem;
}

.meta-api-header {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.meta-logo { font-size: 2rem; flex-shrink: 0; }

.meta-api-header strong {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.meta-api-header span { font-size: 0.76rem; opacity: 0.85; }

.meta-subsection {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.meta-subsection:last-child { border-bottom: none; }

.meta-subsection h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-subsection p { font-size: 0.88rem; color: #555; line-height: 1.7; margin-bottom: 0.5rem; }

.meta-subsection ul { padding-left: 0; list-style: none; margin-bottom: 0.5rem; }

.meta-subsection ul li {
  font-size: 0.88rem;
  color: #555;
  padding: 0.2rem 0 0.2rem 1.4rem;
  position: relative;
  line-height: 1.5;
}

.meta-subsection ul li::before { content: "→"; position: absolute; left: 0; color: var(--orange); font-weight: 700; }

.meta-subsection a { color: var(--orange); text-decoration: underline; }

/* Caja verde opt-in */
.optin-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-left: 4px solid #43a047;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.65rem;
}

.optin-box strong { display: block; font-family: 'Poppins', sans-serif; font-size: 0.83rem; color: #2e7d32; margin-bottom: 0.3rem; }
.optin-box p { font-size: 0.86rem; color: #388e3c; margin-bottom: 0; }
.optin-box a { color: #1b5e20; }

/* Caja naranja opt-out */
.optout-box {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}

.optout-box strong { display: block; font-family: 'Poppins', sans-serif; font-size: 0.83rem; color: var(--orange-dark); margin-bottom: 0.3rem; }
.optout-box p { font-size: 0.86rem; color: #6d4c00; margin-bottom: 0.4rem; }
.optout-box ul { padding-left: 0; list-style: none; margin-bottom: 0.4rem; }
.optout-box ul li { font-size: 0.86rem; color: #6d4c00; padding: 0.15rem 0 0.15rem 1.4rem; position: relative; }
.optout-box ul li::before { content: "→"; position: absolute; left: 0; color: var(--orange); font-weight: 700; }

/* ── Responsive modal ── */
@media (max-width: 600px) {
  .terms-card { flex-direction: column; text-align: center; }
  .terms-card-tags { justify-content: center; }
  .terms-modal-header, .terms-modal-body, .terms-modal-footer { padding-left: 1.25rem; padding-right: 1.25rem; }
  .terms-modal-footer { justify-content: center; }
}
