/* ==========================================================================
   PROTOCOLO LIBRE — SERVICIOS DIGITALES & DIAGNÓSTICO INTERACTIVO
   Silicon Valley Post-SaaS & Cyberpunk Glassmorphic Esthetic
   ========================================================================== */

:root {
  --bg-dark: #030509;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --cyan: #00d4ff;
  --indigo: #6366f1;
  --text-white: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-sans);
  line-height: 1.6;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Cyber Grid Background */
.bio-ambient-grid {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Ambient Radial Glows */
.glow-spot-primary {
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  width: min(550px, 90vw);
  height: min(550px, 90vw);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(3, 5, 9, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.glow-spot-emerald {
  position: absolute;
  bottom: 10%;
  right: -5%;
  width: min(500px, 85vw);
  height: min(500px, 85vw);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, rgba(3, 5, 9, 0) 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* Top Navigation Bar */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(3, 5, 9, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
}

.nav-container {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-brand-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 9999px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-back-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}

/* Page Shell Container */
.page-shell {
  width: min(100% - 32px, 860px);
  margin: 16px auto 60px;
  position: relative;
  z-index: 10;
}

/* Intro Section */
.intro {
  text-align: center;
  padding: 20px 16px 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
  margin: 16px 0 10px;
  font-weight: 800;
  color: #ffffff;
}

.intro-copy {
  max-width: 580px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  line-height: 1.6;
}

/* Wizard Glassmorphic Card */
.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(0, 212, 255, 0.08);
  padding: clamp(20px, 4.5vw, 42px);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Progress Bar */
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #34d399;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.progress-meta span:last-child {
  color: var(--text-muted);
  font-weight: 500;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-track span {
  display: block;
  width: 14.285%;
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #10b981, #05df72);
  border-radius: 9999px;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Form Steps */
.form-step h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.8vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: #ffffff;
}

.step-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* Option List & Cards */
.option-list {
  display: grid;
  gap: 12px;
}

.option-card {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 16px;
  min-height: 76px;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: rgba(10, 15, 26, 0.75);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.option-card:hover {
  border-color: var(--border-hover);
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-1px);
}

.option-card:has(input:checked),
.option-card.is-checked {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 25px -4px var(--emerald-glow), inset 0 0 0 1px var(--emerald);
}

.option-card:focus-within {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

.option-card input[type="radio"],
.option-card input {
  position: absolute !important;
  opacity: 0 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  z-index: 2 !important;
}

.option-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #34d399;
  font-size: 1.15rem;
  font-weight: 700;
  transition: all 0.2s;
  flex-shrink: 0;
  pointer-events: none;
}

.option-card:has(input:checked) .option-icon,
.option-card.is-checked .option-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #ffffff;
}

.option-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.option-copy strong {
  font-size: 0.98rem;
  line-height: 1.35;
  color: #f1f5f9;
  font-weight: 700;
}

.option-copy small {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.option-card:has(input:checked) .option-copy strong,
.option-card.is-checked .option-copy strong {
  color: #ffffff;
}

.option-check {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  position: relative;
  transition: all 0.2s;
  margin-left: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.option-card:has(input:checked) .option-check,
.option-card.is-checked .option-check {
  border-color: var(--emerald);
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.option-card:has(input:checked) .option-check::after,
.option-card.is-checked .option-check::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: #030509;
}

/* Conditional Question Container */
.conditional-question {
  padding: 20px;
  margin: 0 0 24px;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.conditional-question .option-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
}

.conditional-heading {
  margin: 0 0 14px;
  color: #38bdf8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.conditional-prompt {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.conditional-field + .conditional-field {
  margin-top: 18px;
}

.conditional-question label:not(.option-card) {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.conditional-question select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 16px;
  background: #090d16;
  color: #ffffff;
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.conditional-question select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.conditional-help {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Contact Step Fields */
.contact-fields {
  display: grid;
  gap: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.field label > span:not(.optional) {
  color: #34d399;
}

.field .optional {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

.field input, .field textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #090d16;
  padding: 14px 16px;
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input {
  min-height: 54px;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.field input:focus, .field textarea:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.field input::placeholder, .field textarea::placeholder {
  color: #475569;
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Consent Box */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  user-select: none;
}

.consent input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--emerald);
}

.consent a {
  color: #34d399;
  text-underline-offset: 3px;
}

.consent strong {
  color: #34d399;
}

/* Summary Box before submit */
.summary-preview {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #34d399;
  font-weight: 700;
  font-size: 0.95rem;
}

.summary-heading span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  font-size: 0.8rem;
}

.summary-preview p {
  font-size: 0.86rem;
  color: #94a3b8;
  margin: 8px 0 0;
  line-height: 1.6;
}

/* Form Navigation Buttons */
.form-navigation {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border: 0;
  border-radius: 16px;
  padding: 14px 24px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.btn:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 3px;
}

.btn-primary {
  flex: 1;
  color: #030509;
  background: linear-gradient(135deg, #10b981, #05df72);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #05df72, #34d399);
  box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  flex: 0 0 32%;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #05df72, #059669);
  color: #030509;
}

.form-error {
  margin: 15px 0 0;
  color: #f87171;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 10px 14px;
  border-radius: 12px;
}

.form-error:empty {
  display: none;
}

.privacy-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 18px 0 0;
}

.bottom-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 28px 10px 0;
}

.bottom-note a {
  color: #34d399;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Site Footer */
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer a:first-child {
  font-weight: 800;
  color: #e2e8f0;
}

.site-footer span {
  flex: 1;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 640px) {
  .site-nav {
    padding: 8px 12px;
  }

  .nav-container {
    gap: 8px;
  }

  .nav-brand {
    font-size: 0.8rem;
    gap: 6px;
  }

  .nav-brand-dot {
    width: 7px;
    height: 7px;
  }

  .nav-badge {
    display: none;
  }

  .nav-back-link {
    font-size: 0.72rem;
    padding: 4px 10px;
    gap: 4px;
  }

  .page-shell {
    width: min(100% - 24px, 860px);
    margin: 8px auto 40px;
  }

  .intro {
    padding: 18px 8px 24px;
  }

  .wizard-card {
    border-radius: 20px;
    padding: 18px 14px;
  }

  .conditional-question {
    padding: 14px 10px;
    border-radius: 16px;
    margin-bottom: 18px;
  }

  .progress-track {
    margin-bottom: 22px;
  }

  .option-card {
    gap: 12px;
    padding: 14px 14px;
    min-height: 70px;
    border-radius: 16px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }

  .option-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1rem;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .option-copy strong {
    font-size: 0.92rem;
  }

  .option-copy small {
    font-size: 0.78rem;
  }

  .option-check {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .form-navigation {
    gap: 8px;
  }

  .btn {
    min-height: 52px;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .btn-secondary {
    flex-basis: 30%;
  }

  .site-footer {
    padding: 20px 18px;
    justify-content: center;
    text-align: center;
  }

  .site-footer span {
    flex-basis: 100%;
    order: 3;
    margin-top: 6px;
  }
}
