/* ============================================================
   landing.css - Portada pública SAC + página de login
   Hero animado, orbes flotantes, scroll reveal, focus glow
   ============================================================ */

:root {
  --bg:        #0b1026;
  --surface:   #ffffff;
  --ink:       #0f172a;
  --primary:   #6366f1;
  --primary-2: #8b5cf6;
  --accent:    #22d3ee;
  --grad:      linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #22d3ee 130%);
  --ease:      cubic-bezier(.22,1,.36,1);
  --font:      'Inter', system-ui, sans-serif;
  --font-head: 'Poppins', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); -webkit-font-smoothing: antialiased; }

/* ---------- Fondos animados ---------- */
.landing, .login-body { background: var(--bg); color: #e2e8f0; overflow-x: hidden; }
.landing-bg, .login-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: orbFloat 16s ease-in-out infinite;
}
.orb-1 { width: 480px; height: 480px; top: -140px; left: -100px; background: #6366f1; }
.orb-2 { width: 420px; height: 420px; top: 30%; right: -140px; background: #8b5cf6; animation-delay: -5s; }
.orb-3 { width: 360px; height: 360px; bottom: -120px; left: 35%; background: #22d3ee; opacity: .35; animation-delay: -9s; }
@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,60px) scale(1.12); }
  66%     { transform: translate(-30px,20px) scale(.94); }
}

/* ---------- Nav ---------- */
.hero { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; padding: 0 6vw; }
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 26px 0; backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.logo span { letter-spacing: .3px; }
.logo small { display: block; font-size: 10px; font-weight: 500; letter-spacing: 2.6px; color: #94a3b8; }
.logo-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; color: #fff; font-size: 20px;
  background: var(--grad); box-shadow: 0 12px 30px -8px rgba(99,102,241,.7);
  animation: floaty 6s var(--ease) infinite;
}
.btn-acceso {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 13px; border: 1px solid rgba(255,255,255,.18);
  color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
  backdrop-filter: blur(10px); background: rgba(255,255,255,.08);
  transition: all .3s var(--ease);
}
.btn-acceso svg { width: 18px; height: 18px; }
.btn-acceso:hover { background: var(--grad); border-color: transparent; transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(99,102,241,.8); }

/* ---------- Hero content ---------- */
.hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 0 70px; max-width: 900px; margin: 0 auto; width: 100%; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .4px; color: #c7d2fe; background: rgba(99,102,241,.16);
  border: 1px solid rgba(99,102,241,.35); margin-bottom: 26px;
  animation: fadeDown .8s var(--ease) both;
}
.hero-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease infinite; }
.hero-content h1 {
  font-family: var(--font-head); font-size: clamp(34px, 6vw, 62px); font-weight: 700;
  line-height: 1.08; margin: 0 0 22px; letter-spacing: -1.5px; color: #fff;
  animation: fadeDown .8s .05s var(--ease) both;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub {
  font-size: clamp(15px, 2.2vw, 18px); line-height: 1.7; color: #cbd5e1;
  max-width: 640px; margin: 0 0 36px; animation: fadeDown .8s .12s var(--ease) both;
}

/* ---------- Buscador ---------- */
.hero-search { width: 100%; max-width: 620px; animation: fadeDown .8s .2s var(--ease) both; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 8px 8px 8px 22px;
  backdrop-filter: blur(12px); transition: all .35s var(--ease);
}
.search-box:focus-within {
  border-color: rgba(99,102,241,.9); background: rgba(255,255,255,.14);
  box-shadow: 0 0 0 5px rgba(99,102,241,.25), 0 20px 50px -20px rgba(99,102,241,.6);
  transform: scale(1.015);
}
.search-icon { width: 20px; height: 20px; color: #94a3b8; flex-shrink: 0; }
.search-box input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: #fff; font-size: 15px; font-family: var(--font); padding: 6px 0;
}
.search-box input::placeholder { color: #7c8db5; }
.search-box .btn { border-radius: 999px; padding: 12px 24px; }

/* ---------- Hero stats ---------- */
.hero-stats { display: flex; gap: 44px; margin-top: 46px; flex-wrap: wrap; justify-content: center; animation: fadeDown .8s .3s var(--ease) both; }
.stat { text-align: center; }
.stat strong {
  display: block; font-family: var(--font-head); font-size: 30px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { color: #94a3b8; font-size: 13px; }

/* ---------- Secciones ---------- */
.section { position: relative; z-index: 1; padding: 90px 6vw; }
.section.section-dark { background: #0d1330; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 54px; }
.section-tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: #a5b4fc; margin-bottom: 14px;
  padding: 6px 14px; border-radius: 999px; background: rgba(99,102,241,.14);
  border: 1px solid rgba(99,102,241,.3);
}
.section-head h2 { font-family: var(--font-head); font-size: clamp(26px, 4vw, 38px); color: #fff; margin: 0 0 14px; letter-spacing: -.6px; }
.section-head p { color: #94a3b8; font-size: 15.5px; line-height: 1.7; margin: 0; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; max-width: 1020px; margin: 0 auto; }
.reveal-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 30px 26px; backdrop-filter: blur(10px);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .3s;
}
.reveal-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px -20px rgba(99,102,241,.5); background: rgba(255,255,255,.09); }
.reveal-card h3 { font-family: var(--font-head); color: #fff; font-size: 18px; margin: 18px 0 10px; }
.reveal-card p { color: #94a3b8; font-size: 14px; line-height: 1.65; margin: 0; }
.icon-wrap {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  color: #fff; transition: transform .4s var(--ease);
}
.icon-wrap svg { width: 25px; height: 25px; }
.reveal-card:hover .icon-wrap { transform: rotate(-8deg) scale(1.1); }
.grad-1 { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.grad-2 { background: linear-gradient(135deg,#0ea5e9,#22d3ee); }
.grad-3 { background: linear-gradient(135deg,#8b5cf6,#ec4899); }

/* Canales */
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; text-align: center; }
.channel { padding: 28px 20px; }
.channel-icon {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 14px 30px -10px rgba(99,102,241,.7);
  transition: transform .4s var(--ease);
}
.channel-icon svg { width: 26px; height: 26px; }
.channel:hover .channel-icon { transform: translateY(-6px) rotate(10deg); }
.channel h4 { color: #fff; font-family: var(--font-head); margin: 0 0 8px; }
.channel p { color: #94a3b8; font-size: 13.5px; margin: 0; line-height: 1.6; }

/* ---------- Normatividad / split ---------- */
.section-body.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; max-width: 1000px; margin: 0 auto; }
@media (max-width: 820px) { .section-body.split { grid-template-columns: 1fr; } }
.split-text h2 { font-family: var(--font-head); font-size: clamp(26px, 4vw, 36px); color: #fff; margin: 0 0 14px; }
.split-text > p { color: #94a3b8; line-height: 1.7; font-size: 15px; }
.norm-list { list-style: none; padding: 0; margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.norm-list li {
  display: flex; align-items: flex-start; gap: 12px; color: #cbd5e1; font-size: 14.5px;
  padding: 13px 16px; border-radius: 13px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}
.norm-list li::before {
  content: ""; width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%; background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.norm-list strong { color: #fff; }

.split-visual { text-align: center; padding: 46px 30px; }
.ring-demo { position: relative; width: 180px; height: 180px; margin: 0 auto 18px; }
.ring-demo svg { width: 180px; height: 180px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-center strong { font-family: var(--font-head); font-size: 44px; color: #fff; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring-center span { color: #94a3b8; font-size: 13px; }
.caption { color: #94a3b8; font-size: 13.5px; margin: 0; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding-bottom: 40px; }
.cta h2 { font-family: var(--font-head); font-size: clamp(26px,4vw,36px); color: #fff; margin: 0 0 12px; }
.cta p { color: #94a3b8; margin: 0 0 30px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font); font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 14px 26px; border-radius: 14px; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.96); }
.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 16px 34px -12px rgba(99,102,241,.85); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -14px rgba(99,102,241,1); }
.btn-arrow { transition: transform .3s var(--ease); }
.btn-primary:hover .btn-arrow, .btn-acceso:hover svg, .btn-ghost:hover .btn-arrow { transform: translateX(5px); }
.btn-ghost {
  color: #e2e8f0; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: rgba(255,255,255,.5); transform: translateY(-3px); }

.footer { position: relative; z-index: 1; text-align: center; padding: 40px 6vw 44px; color: #64748b; font-size: 13px; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Scroll reveal ---------- */
.reveal-section { opacity: 0; transform: translateY(36px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-section.visible { opacity: 1; transform: translateY(0); }
.reveal-section .reveal-card { opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-section.visible .reveal-card:nth-child(1) { opacity: 1; transform: none; transition-delay: .05s; }
.reveal-section.visible .reveal-card:nth-child(2) { opacity: 1; transform: none; transition-delay: .15s; }
.reveal-section.visible .reveal-card:nth-child(3) { opacity: 1; transform: none; transition-delay: .25s; }
.reveal-section.visible .reveal-card:nth-child(4) { opacity: 1; transform: none; transition-delay: .35s; }
.reveal-section.visible .reveal-card:hover { transform: translateY(-8px); }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  position: relative; z-index: 2; width: min(420px, 94vw);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px); border-radius: 24px; padding: 38px 34px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
  animation: fadeDown .7s var(--ease) both;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.brand-badge {
  width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 20px;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 18px 40px -12px rgba(99,102,241,.9);
  animation: floaty 6s var(--ease) infinite;
}
.brand-badge svg { width: 32px; height: 32px; }
.login-brand h1 { font-family: var(--font-head); color: #fff; font-size: 24px; margin: 0; }
.login-brand p { color: #94a3b8; font-size: 14px; margin: 6px 0 0; }

.login-footer { margin-top: 22px; text-align: center; font-size: 12.5px; color: #94a3b8; }
.login-footer code {
  display: inline-block; margin-top: 6px; padding: 5px 12px; border-radius: 8px;
  background: rgba(99,102,241,.18); border: 1px solid rgba(99,102,241,.35);
  color: #a5b4fc; font-size: 12.5px;
}
.back-home { display: block; margin-top: 22px; text-align: center; color: #a5b4fc; text-decoration: none; font-size: 13.5px; font-weight: 500; transition: color .2s; }
.back-home:hover { color: #fff; }

/* ---------- Animaciones base ---------- */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.ripple-effect {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.4); transform: scale(0);
  animation: ripple .6s ease-out;
}
.btn-ghost .ripple-effect { background: rgba(255,255,255,.16); }

/* ---------- Formulario de Radicación Pública en Landing ---------- */
.public-form-card {
  position: relative; z-index: 2; width: min(860px, 94vw); margin: 0 auto;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(20px); border-radius: 26px; padding: 36px 32px;
  box-shadow: 0 35px 80px -20px rgba(0,0,0,.65);
}
@media (min-width: 640px) {
  .public-form-card { padding: 44px 40px; }
}
.public-form-card .form-row {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px;
}
@media (min-width: 640px) {
  .public-form-card .form-row { grid-template-columns: 1fr 1fr; }
}
.field-dark { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field-dark label { font-size: 13px; font-weight: 600; color: #cbd5e1; letter-spacing: .2px; }
.field-dark .input-dark, .field-dark .select-dark, .field-dark .textarea-dark {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(15,23,42,.65);
  color: #f8fafc; font-family: var(--font); font-size: 14.5px;
  outline: none; transition: all .25s var(--ease);
}
.field-dark .select-dark { cursor: pointer; color: #f8fafc; }
.field-dark .select-dark option { background: #0f172a; color: #f8fafc; }
.field-dark .textarea-dark { resize: vertical; min-height: 105px; line-height: 1.5; }
.field-dark .input-dark:focus, .field-dark .select-dark:focus, .field-dark .textarea-dark:focus {
  border-color: #818cf8; background: rgba(15,23,42,.85);
  box-shadow: 0 0 0 3px rgba(99,102,241,.3);
}
.field-dark input[type="file"] {
  padding: 10px; color: #94a3b8; font-size: 13.5px;
}
.field-dark input[type="file"]::file-selector-button {
  background: var(--grad); color: #fff; border: 0; padding: 6px 14px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-right: 12px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}