/* ========================================================
   Security Gateway - Human Verification Stylesheet
   ======================================================== */

:root {
  --navy: #001f3f;
  --navy-950: #001428;
  --royal: #007acc;
  --royal-hover: #005fa3;
  --sky: #cce0ff;
  --sky-light: #f4f8ff;
  --sky-vibrant: #7cc4ff;
  --ink: #1a2233;
  --muted: #5a667d;
  --line: #d8e2ef;
  --bg: #f8fafc;
  --font-head: "Outfit", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(1000px 600px at 100% 0%, rgba(0, 122, 204, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(204, 224, 255, 0.85), transparent 65%),
    linear-gradient(175deg, #f8fbff 0%, #eef5fc 100%);
}

/* Patrón de Rejilla Tecnológica de Fondo (Punto Medio Calibrado) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("/assets/img/pattern-hero.svg");
  background-repeat: repeat;
  background-size: 80px 80px;
  opacity: .55;
  mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,1) 40%, rgba(0,0,0,.45) 85%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,1) 40%, rgba(0,0,0,.45) 85%, transparent 100%);
}

.bridge-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
}

/* Contenedor Principal (Tarjeta Dividida) */
.bridge-card {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0, 51, 102, 0.10);
  box-shadow: 0 35px 85px -25px rgba(0, 31, 63, 0.28), 0 0 0 1px rgba(255,255,255,0.8);
  animation: cardFadeUp .65s var(--ease);
}

@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(22px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================================
   Panel Izquierdo: Presentación Institucional
   ======================================================== */
.bridge-brand {
  position: relative;
  overflow: hidden;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  background:
    radial-gradient(500px 300px at 90% 10%, rgba(0, 122, 204, 0.18), transparent 70%),
    linear-gradient(155deg, #f7faff 0%, #eaf2fc 100%);
  border-right: 1px solid rgba(0, 51, 102, 0.08);
}

.bridge-brand::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -100px;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 196, 255, 0.28), transparent 70%);
  pointer-events: none;
}

.bridge-brand::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  left: -70px;
  top: 30%;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 122, 204, 0.22);
  animation: spinRing 50s linear infinite;
  pointer-events: none;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.bridge-brand > * {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.security-emblem {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emblem-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--royal) 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px -8px rgba(0, 122, 204, 0.55);
}

.emblem-text strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.emblem-text small {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}

.shield-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--royal);
  background: rgba(0, 122, 204, 0.09);
  border: 1px solid rgba(0, 122, 204, 0.18);
}

.brand-body h2 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 12px;
}

.brand-body h2 span {
  color: var(--royal);
}

.brand-body p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.security-badges {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-badges li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px -10px rgba(0, 51, 102, 0.2);
}

.security-badges .badge-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--royal) 100%);
  color: #ffffff;
}

.security-badges strong {
  display: block;
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
}

.security-badges small {
  display: block;
  font-size: .8rem;
  color: var(--muted);
}

.brand-foot {
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid rgba(0, 51, 102, 0.08);
  padding-top: 16px;
}

/* ========================================================
   Panel Derecho: Acción y Verificación Turnstile
   ======================================================== */
.bridge-action {
  padding: 52px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.action-header {
  margin-bottom: 24px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: .04em;
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  transition: all .3s ease;
}

.status-indicator.verified {
  background: #ecfdf3;
  color: #027a48;
  border-color: #a6f4c5;
}

.status-indicator.error {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  animation: pulseDot 2s infinite;
}

.status-indicator.verified .pulse-dot {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.25);
}

.status-indicator.error .pulse-dot {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.25);
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: .7; }
}

.action-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 2.2vw, 1.95rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 8px;
}

.action-header .subtitle {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

/* Caja del Widget Turnstile */
.turnstile-box {
  margin: 18px 0 16px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Estado de Feedback */
.verification-status {
  min-height: 38px;
  margin-bottom: 22px;
}

.status-msg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  animation: fadeIn .3s ease;
}

.status-msg.waiting {
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.status-msg.verifying {
  color: var(--royal);
  background: #eff8ff;
  border: 1px solid #b2ddff;
}

.status-msg.verifying .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 122, 204, 0.25);
  border-top-color: var(--royal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.status-msg.success {
  color: #027a48;
  background: #ecfdf3;
  border: 1px solid #a6f4c5;
}

.status-msg.error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   Botón de Redirección (Disabled vs Enabled)
   ======================================================== */
.action-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
}

/* Estado Deshabilitado */
.btn-bridge.disabled {
  background: #e2e8f0;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-bridge.disabled .arrow-ico {
  opacity: .35;
}

/* Estado Activado / Verificado */
.btn-bridge.active {
  background: linear-gradient(135deg, #007acc 0%, #004b8f 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 16px 36px -12px rgba(0, 122, 204, 0.65), 0 0 0 1px rgba(0, 122, 204, 0.4);
  animation: pulseButton 2.2s infinite;
}

.btn-bridge.active:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #008be6 0%, #0059aa 100%);
  box-shadow: 0 20px 42px -12px rgba(0, 122, 204, 0.8);
}

.btn-bridge.active:active {
  transform: translateY(0);
}

.btn-bridge.active .arrow-ico {
  transform: translateX(0);
  transition: transform .25s ease;
}

.btn-bridge.active:hover .arrow-ico {
  transform: translateX(4px);
}

@keyframes pulseButton {
  0%, 100% {
    box-shadow: 0 14px 34px -10px rgba(0, 122, 204, 0.6), 0 0 0 0 rgba(0, 122, 204, 0.5);
  }
  50% {
    box-shadow: 0 16px 38px -10px rgba(0, 122, 204, 0.75), 0 0 0 6px rgba(0, 122, 204, 0);
  }
}

.disclaimer {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.disclaimer strong {
  color: var(--navy);
  word-break: break-all;
}

/* ========================================================
   Responsive Breakpoints
   ======================================================== */
@media (max-width: 860px) {
  .bridge-card {
    grid-template-columns: 1fr;
  }
  .bridge-brand {
    padding: 36px 30px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
  }
  .bridge-action {
    padding: 40px 30px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }
  .bridge-brand {
    padding: 28px 20px;
  }
  .bridge-action {
    padding: 32px 20px;
  }
  .brand-body h2 {
    font-size: 1.5rem;
  }
  .action-header h1 {
    font-size: 1.45rem;
  }
}
