/* ─── Digital Shield — estilos específicos del módulo ─── */

/* ── Tokens de producto ─────────────────────────────── */
:root {
  --ds-blue: var(--p-shield, #0066FF);
  --ds-blue-soft: rgba(0,102,255,.08);
  --ds-glow: radial-gradient(60% 60% at 65% 35%, rgba(0,102,255,.13) 0%, rgba(0,209,255,.06) 45%, transparent 70%);
}

/* ── Layout de páginas DS ───────────────────────────── */
.ds-page {
  background: var(--bg);
  min-height: 100vh;
}

/* ── Hero landing ───────────────────────────────────── */
.ds-hero {
  position: relative;
  overflow: hidden;
  padding-block: 96px 80px;
  background: var(--bg);
}
.ds-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ds-glow);
  pointer-events: none;
}
.ds-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16, 64px);
  align-items: center;
}
.ds-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ds-blue);
  margin-bottom: 20px;
}
.ds-hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ds-blue);
  animation: ds-pulse 2s ease-in-out infinite;
}
@keyframes ds-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) { .ds-hero-eyebrow .dot { animation: none; } }
.ds-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text);
  max-width: 16ch;
  text-wrap: balance;
  margin: 0 0 20px;
}
.ds-hero-lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-3);
  max-width: 42ch;
  margin: 0 0 32px;
}
.ds-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Mockup ilustrativo ─────────────────────────────── */
.ds-mockup-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.ds-mockup-label {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
  z-index: 2;
}
.ds-mockup-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg, 0 24px 64px -16px rgba(0,40,120,.18));
  padding: 28px;
  width: 100%;
  max-width: 420px;
}
.ds-mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.ds-mock-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ds-mock-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.ds-mock-badge.low  { background: rgba(34,197,94,.12); color: #16a34a; }
.ds-mock-badge.med  { background: rgba(251,191,36,.12); color: #b45309; }
.ds-mock-badge.high { background: rgba(249,115,22,.12); color: #c2410c; }
.ds-mock-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.ds-mock-gauge-sm {
  width: 56px; height: 56px; flex-shrink: 0;
}
.ds-mock-score-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ds-blue);
  line-height: 1;
}
.ds-mock-score-lbl {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.ds-mock-findings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-mock-finding {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: 8px;
}
.sev-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sev-dot.critical { background: var(--sev-critical, #DC2626); }
.sev-dot.high     { background: var(--sev-high, #F97316); }
.sev-dot.medium   { background: var(--sev-medium, #FBBF24); }
.sev-dot.low      { background: var(--sev-low, #22C55E); }
.sev-dot.info     { background: var(--text-3, #4B5563); }

/* ── Sección "qué analiza" ──────────────────────────── */
.ds-section { padding-block: 80px; }
.ds-section-alt { background: var(--bg-subtle); }
.ds-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
  margin: 0 0 12px;
  text-align: center;
  text-wrap: balance;
}
.ds-section-lead {
  font-size: 1rem;
  color: var(--text-3);
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 48px;
  line-height: 1.6;
}
.ds-motors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.ds-motor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-top: 3px solid var(--ds-blue);
  padding: 24px;
  transition: transform 200ms, box-shadow 200ms;
}
.ds-motor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 8px 24px -8px rgba(0,40,120,.12));
}
.ds-motor-icon {
  width: 40px; height: 40px;
  background: var(--ds-blue-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--ds-blue);
}
.ds-motor-name {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  margin: 0 0 6px;
}
.ds-motor-desc {
  font-size: .875rem;
  color: var(--text-3);
  line-height: 1.5;
  margin: 0;
}

/* ── Pasos "cómo funciona" ──────────────────────────── */
.ds-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  counter-reset: ds-step;
}
.ds-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  counter-increment: ds-step;
}
.ds-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ds-blue);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-step-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  margin: 0;
}
.ds-step-desc {
  font-size: .875rem;
  color: var(--text-3);
  line-height: 1.55;
  margin: 0;
}

/* ── Wizard ─────────────────────────────────────────── */
.ds-wizard-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background: var(--bg);
}
.ds-wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: 48px;
  width: 100%;
  max-width: 500px;
}
.ds-wizard-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.ds-wizard-sub {
  font-size: .9375rem;
  color: var(--text-3);
  margin: 0 0 32px;
  line-height: 1.5;
}
.ds-field { margin-bottom: 20px; }
.ds-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ds-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 150ms;
  box-sizing: border-box;
}
.ds-input:focus {
  outline: none;
  border-color: var(--ds-blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,.1);
}
.ds-input.invalid { border-color: var(--sev-critical); }
.ds-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234B5563' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.ds-field-hint {
  font-size: .8125rem;
  color: var(--text-3);
  margin-top: 4px;
}
.ds-error-msg {
  font-size: .875rem;
  color: var(--sev-critical);
  margin-top: 16px;
  display: none;
}
.ds-error-msg.visible { display: block; }
.ds-wizard-cta {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--ds-blue);
  color: #fff;
  transition: background 150ms, opacity 150ms;
}
.ds-wizard-cta:hover:not(:disabled) { background: #0052cc; }
.ds-wizard-cta:disabled { opacity: .5; cursor: not-allowed; }
.ds-back-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: .875rem;
  color: var(--text-3);
}
.ds-back-link a { color: var(--ds-blue); text-decoration: none; }
.ds-back-link a:hover { text-decoration: underline; }

/* ── Pantalla de escaneo ────────────────────────────── */
.ds-scanning-page {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background: var(--bg);
  text-align: center;
}
.ds-scan-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.ds-scan-sub {
  font-size: .9375rem;
  color: var(--text-3);
  margin: 0 0 32px;
}
.ds-progress-wrap {
  width: 100%;
  max-width: 420px;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 auto 32px;
}
.ds-progress-bar {
  height: 100%;
  background: var(--ds-blue);
  border-radius: 99px;
  width: 0%;
  transition: width 600ms ease;
  animation: ds-progress-flow 90s linear forwards;
}
@keyframes ds-progress-flow {
  0%  { width: 0%; }
  40% { width: 60%; }
  70% { width: 78%; }
  90% { width: 88%; }
  100% { width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-progress-bar { animation: none; width: 40%; }
}
.ds-motor-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 360px;
  text-align: left;
}
.ds-motor-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9375rem;
  color: var(--text-2);
}
.ds-motor-item:last-child { border-bottom: none; }
.ds-motor-status {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-motor-status.pending  { background: var(--bg-muted); }
.ds-motor-status.running  { background: rgba(0,102,255,.1); animation: ds-spin 1s linear infinite; }
.ds-motor-status.done     { background: rgba(34,197,94,.1); color: #16a34a; }
.ds-motor-status.error    { background: rgba(220,38,38,.1); color: var(--sev-critical); }
@keyframes ds-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .ds-motor-status.running { animation: none; } }
.ds-timeout-msg {
  margin-top: 24px;
  font-size: .9375rem;
  color: var(--text-3);
  display: none;
}
.ds-timeout-msg.visible { display: block; }

/* ── Página de resultados ───────────────────────────── */
.ds-results-page { padding-block: 48px; }
.ds-results-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}
.ds-score-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: sticky;
  top: 96px;
  text-align: center;
}
.ds-score-title {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 20px;
}
.ds-gauge-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
}
.ds-gauge-wrap svg { overflow: visible; }
.ds-gauge-track { fill: none; stroke: var(--bg-muted); stroke-width: 10; }
.ds-gauge-arc   { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ds-gauge-text  {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  fill: var(--text);
}
.ds-gauge-sub   { font-size: .75rem; fill: var(--text-3); }
.ds-risk-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.ds-risk-label.critical { color: var(--sev-critical); }
.ds-risk-label.high     { color: var(--sev-high); }
.ds-risk-label.medium   { color: #b45309; }
.ds-risk-label.low      { color: #15803d; }
.ds-risk-label.unknown  { color: var(--text-3); }
.ds-score-summary {
  font-size: .875rem;
  color: var(--text-3);
  line-height: 1.55;
  margin: 0 0 20px;
  text-align: left;
}
.ds-score-actions { display: flex; flex-direction: column; gap: 8px; }
.ds-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--ds-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 150ms;
}
.ds-btn-primary:hover { background: #0052cc; }
.ds-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 150ms;
}
.ds-btn-secondary:hover { border-color: var(--ds-blue); color: var(--ds-blue); }
.ds-findings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.ds-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ds-tab {
  padding: 8px 16px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
  border-radius: 0;
}
.ds-tab:hover { color: var(--text); }
.ds-tab[aria-selected="true"] {
  color: var(--ds-blue);
  border-bottom-color: var(--ds-blue);
  font-weight: 600;
}
.ds-tab-panel { display: none; }
.ds-tab-panel.active { display: block; }
.ds-finding-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.ds-finding-card.critical { border-left-color: var(--sev-critical); }
.ds-finding-card.high     { border-left-color: var(--sev-high); }
.ds-finding-card.medium   { border-left-color: var(--sev-medium); }
.ds-finding-card.low      { border-left-color: var(--sev-low); }
.ds-finding-card.info     { border-left-color: var(--border-strong); }
.ds-finding-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ds-finding-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  flex: 1;
  margin: 0;
}
.ds-sev-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ds-sev-badge.critical { background: rgba(220,38,38,.1); color: #b91c1c; }
.ds-sev-badge.high     { background: rgba(249,115,22,.1); color: #c2410c; }
.ds-sev-badge.medium   { background: rgba(251,191,36,.1); color: #92400e; }
.ds-sev-badge.low      { background: rgba(34,197,94,.1);  color: #15803d; }
.ds-sev-badge.info     { background: var(--bg-muted); color: var(--text-3); }
.ds-finding-desc {
  font-size: .875rem;
  color: var(--text-3);
  margin: 6px 0 0;
  line-height: 1.5;
}
.ds-finding-toggle {
  background: none;
  border: none;
  font-size: .8125rem;
  color: var(--ds-blue);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
  display: inline-block;
  margin-top: 6px;
}
.ds-finding-detail {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border-radius: 8px;
  font-size: .8125rem;
  color: var(--text-2);
  line-height: 1.55;
  display: none;
}
.ds-finding-detail.open { display: block; }
.ds-no-findings {
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: .9375rem;
}
.ds-no-findings::before { content: '✓  '; color: var(--sev-low); font-weight: 700; }
.ds-report-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Plan de remediación ────────────────────────────── */
.ds-remed-page { padding-block: 48px; }
.ds-remed-header { margin-bottom: 32px; }
.ds-remed-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.ds-remed-sub { font-size: .9375rem; color: var(--text-3); margin: 0; }
.ds-remed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}
.ds-remed-item {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.ds-remed-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ds-blue);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-remed-body { flex: 1; }
.ds-remed-name {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  margin: 0 0 4px;
}
.ds-remed-action {
  font-size: .875rem;
  color: var(--text-3);
  line-height: 1.55;
  margin: 0 0 10px;
}
.ds-remed-steps {
  margin: 0 0 10px;
  padding-left: 18px;
  list-style: disc;
}
.ds-remed-steps li {
  font-size: .8125rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 3px;
}
.ds-remed-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ds-remed-urgency {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}
.ds-remed-urgency.immediate  { background: rgba(220,38,38,.08); color: #b91c1c; }
.ds-remed-urgency.short-term { background: rgba(249,115,22,.08); color: #c2410c; }
.ds-remed-urgency.continuous { background: rgba(34,197,94,.08);  color: #15803d; }
.ds-remed-cta-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}
.ds-remed-cta-box h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.ds-remed-cta-box p {
  font-size: .9375rem;
  color: var(--text-3);
  margin: 0 0 20px;
}

/* ── CTA final (landing) ────────────────────────────── */
.ds-cta-section {
  padding-block: 80px;
  text-align: center;
  background: var(--bg);
}
.ds-cta-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  text-wrap: balance;
}

/* ── Responsivo ─────────────────────────────────────── */
@media (max-width: 900px) {
  .ds-hero-grid { grid-template-columns: 1fr; }
  .ds-mockup-wrap { display: none; }
  .ds-results-grid { grid-template-columns: 1fr; }
  .ds-score-panel { position: static; }
  .ds-wizard-card { padding: 28px 20px; }
}
@media (max-width: 600px) {
  .ds-hero { padding-block: 60px 48px; }
  .ds-section { padding-block: 56px; }
  .ds-motors-grid { grid-template-columns: 1fr 1fr; }
  .ds-steps { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .ds-motors-grid { grid-template-columns: 1fr; }
}
