@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap");

:root {
  --bg-dark: #080606;
  --bg-surface: #100d0c;
  --bg-card: rgba(20, 16, 15, 0.78);
  --bg-card-hover: rgba(28, 22, 20, 0.94);
  --border-subtle: rgba(255, 140, 0, 0.14);
  --border-glow: rgba(255, 115, 0, 0.45);

  --accent-gold: #ffbe3b;
  --accent-orange: #ff5e14;
  --accent-red: #e02424;
  --accent-glow: #ff7700;
  --accent-gradient: linear-gradient(135deg, #ffc44d 0%, #ff641a 48%, #e32222 100%);

  --text-primary: #ffffff;
  --text-secondary: #c7bebe;
  --text-muted: #847878;

  --card-radius: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: break-word;
}

/* Ambient glow animado en el fondo */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-circle-1 {
  position: absolute;
  top: -180px;
  left: 28%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(255, 94, 20, 0.28) 0%, rgba(255, 190, 59, 0.08) 45%, transparent 70%);
  filter: blur(90px);
  animation: floatOrb 14s ease-in-out infinite alternate;
}

.ambient-circle-2 {
  position: absolute;
  top: 45%;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(224, 36, 36, 0.2) 0%, rgba(255, 94, 20, 0.05) 50%, transparent 70%);
  filter: blur(100px);
  animation: floatOrb 20s ease-in-out infinite alternate-reverse;
}

.ambient-circle-3 {
  position: absolute;
  bottom: -150px;
  left: -80px;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.16) 0%, transparent 65%);
  filter: blur(85px);
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(35px) scale(1.08) rotate(4deg); }
  100% { transform: translateY(-25px) scale(0.96) rotate(-3deg); }
}

/* Malla estética de fondo */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}

/* Contenedor principal */
.legales-container {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 50px 24px 70px;
  max-width: 1240px;
  margin: 0 auto;
}

/* Header & Brand */
.legales-header {
  text-align: center;
  margin-bottom: 54px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo con aura interactiva */
.logo-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.logo-glow-aura {
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, rgba(255, 100, 26, 0.45) 0%, rgba(255, 190, 59, 0.15) 50%, transparent 70%);
  filter: blur(25px);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseAura 4s ease-in-out infinite alternate;
}

@keyframes pulseAura {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

.logo-wrapper {
  position: relative;
  z-index: 1;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-wrapper:hover {
  transform: translateY(-4px) scale(1.04);
}

.brand-logo {
  max-height: 95px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(255, 94, 20, 0.4));
}

/* Título */
.main-title {
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 16px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.title-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 0 20px rgba(255, 94, 20, 0.35));
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.65;
}

/* Grid de Cards */
.legales-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 50px;
}

@media (max-width: 1040px) {
  .legales-content {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Card con borde degradado neon y glassmorphism */
.section-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-subtle);
  padding: 36px 30px;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.85),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease,
              background 0.35s ease;
  overflow: hidden;
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.6;
  transition: all 0.4s ease;
}

.section-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  background: radial-gradient(circle at top, rgba(255, 140, 0, 0.12), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

@media (hover: hover) {
  .section-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.92),
                0 0 45px -5px rgba(255, 94, 20, 0.32);
  }

  .section-card:hover::before {
    opacity: 1;
    height: 4px;
  }

  .section-card:hover::after {
    opacity: 1;
  }

  .section-card:hover .card-icon {
    transform: scale(1.08) rotate(-4deg);
  }
}

/* Header de la tarjeta */
.card-header-flex {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 190, 59, 0.16) 0%, rgba(255, 94, 20, 0.28) 100%);
  border: 1px solid rgba(255, 179, 71, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(255, 94, 20, 0.25);
  transition: transform 0.3s ease;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.section-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  line-height: 1.3;
}

.section-card p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 22px;
}

/* Lista de puntos */
.section-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: auto;
}

.section-list li {
  position: relative;
  padding-left: 28px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.58;
}

.section-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px rgba(255, 94, 20, 0.85);
}

/* Enlaces */
.link-inline,
.link-destacado {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.25s ease;
  word-break: break-all;
}

.link-inline::after,
.link-destacado::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent-gold);
  transform: scaleX(0.8);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0.7;
}

.link-inline:hover,
.link-destacado:hover {
  color: #fff;
}

.link-inline:hover::after,
.link-destacado:hover::after {
  transform: scaleX(1);
  opacity: 1;
  background: #ffffff;
}

/* Caja de Acción de Contacto */
.contact-action-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 22px;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 12px 28px -6px rgba(255, 94, 20, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.mail-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.mail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -4px rgba(255, 94, 20, 0.7);
  filter: brightness(1.08);
}

.mail-btn:hover::before {
  left: 100%;
}

.mail-btn:active {
  transform: scale(0.98);
}

.mail-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Footer */
.legales-footer {
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-badge {
  color: var(--accent-gold);
  font-weight: 700;
}

/* ========================================================
   RESPONSIVE DESIGN Y OPTIMIZACIONES PARA MOBILE
   ======================================================== */

/* Tablets y pantallas medianas */
@media (max-width: 900px) {
  .legales-container {
    padding: 38px 20px 56px;
  }

  .legales-header {
    margin-bottom: 40px;
  }

  .brand-logo {
    max-height: 82px;
  }

  .main-title {
    font-size: 2.5rem;
  }

  .header-subtitle {
    font-size: 1.02rem;
  }
}

/* Teléfonos móviles estándar (<= 640px) */
@media (max-width: 640px) {
  .legales-container {
    padding: 28px 16px 44px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(44px, env(safe-area-inset-bottom));
  }

  .legales-header {
    margin-bottom: 32px;
  }

  .logo-container {
    margin-bottom: 18px;
  }

  .logo-glow-aura {
    inset: -10px;
    filter: blur(20px);
  }

  .brand-logo {
    max-height: 68px;
  }

  .main-title {
    font-size: 1.85rem;
    line-height: 1.2;
    margin-bottom: 12px;
  }

  .header-subtitle {
    font-size: 0.95rem;
    line-height: 1.55;
    padding: 0 4px;
  }

  .legales-content {
    gap: 20px;
    margin-bottom: 36px;
  }

  .section-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .card-header-flex {
    gap: 12px;
    margin-bottom: 16px;
  }

  .card-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .card-icon svg {
    width: 22px;
    height: 22px;
  }

  .section-card h2 {
    font-size: 1.12rem;
    letter-spacing: 0.02em;
  }

  .section-card p {
    font-size: 0.94rem;
    line-height: 1.62;
    margin-bottom: 18px;
  }

  .section-list {
    gap: 12px;
  }

  .section-list li {
    padding-left: 24px;
    font-size: 0.91rem;
    line-height: 1.52;
  }

  .section-list li::before {
    top: 6px;
    width: 7.5px;
    height: 7.5px;
  }

  .contact-action-box {
    padding: 16px;
    border-radius: 15px;
    gap: 12px;
  }

  .mail-btn {
    padding: 13px 16px;
    font-size: 0.92rem;
    border-radius: 12px;
    width: 100%;
  }

  .legales-footer {
    padding-top: 24px;
    font-size: 0.82rem;
    gap: 6px;
  }
}

/* Pantallas pequeñas (iPhone SE, Galaxy A series <= 380px) */
@media (max-width: 380px) {
  .legales-container {
    padding: 22px 12px 36px;
  }

  .brand-logo {
    max-height: 58px;
  }

  .main-title {
    font-size: 1.62rem;
  }

  .header-subtitle {
    font-size: 0.88rem;
  }

  .section-card {
    padding: 20px 14px;
  }

  .card-icon {
    width: 38px;
    height: 38px;
  }

  .card-icon svg {
    width: 19px;
    height: 19px;
  }

  .section-card h2 {
    font-size: 1.02rem;
  }

  .mail-btn {
    font-size: 0.86rem;
    padding: 12px 12px;
  }
}
