/* ============================================================
   DIAGNOSTICO VISIBILIDAD IA — Estilos
   ============================================================ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #f3f4f6;
  --bg-card-hover: #e5e7eb;
  --accent: #7d2b6d;
  --accent-hover: #651f58;
  --accent-glow: rgba(125, 43, 109, 0.1);
  --text-primary: #1a1a1a;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #d1d5db;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7d2b6d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Screens --- */

.screen {
  display: none;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: block;
}

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

/* --- Header --- */

.header {
  text-align: center;
  padding: 32px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.header__brand {
  font-size: 22px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 6px;
}

.header__title {
  font-size: 17px;
  color: var(--text-muted);
}

/* --- Intro screen --- */

.intro {
  text-align: center;
  padding: 48px 0 64px;
}

.intro__badge {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid rgba(125, 43, 109, 0.25);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 32px;
}

.intro__headline {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.intro__headline span {
  color: var(--accent);
}

.intro__text {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 16px;
  line-height: 1.7;
}

.intro__detail {
  font-size: 15px;
  color: var(--text-primary);
  max-width: 520px;
  margin: 0 auto 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: left;
  line-height: 1.6;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 40px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(125, 43, 109, 0.25);
}

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

.btn--large {
  font-size: 18px;
  padding: 18px 48px;
}

.btn--full {
  width: 100%;
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn--secondary:hover {
  background: var(--accent-glow);
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* --- Progress bar --- */

.progress {
  margin-bottom: 32px;
}

.progress__bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress__block-name {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress__counter {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Block header --- */

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

.block-header__icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.block-header__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.block-header__desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Question --- */

.question {
  margin-bottom: 40px;
  padding-bottom: 32px;
}

.question__number {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.question__text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* --- Options --- */

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 15px;
  color: var(--text-primary);
  position: relative;
}

.option:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.option__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}

.option.selected .option__radio {
  border-color: var(--accent);
  background: var(--accent);
}

.option.selected .option__radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}

.option__label {
  flex: 1;
}

/* --- Navigation --- */

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 48px;
  gap: 16px;
}

.quiz-nav .btn {
  min-width: 140px;
}

.btn--back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn--back:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-card);
  box-shadow: none;
  transform: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Form screen --- */

.form-screen {
  padding: 48px 0 64px;
  text-align: center;
}

.form-screen__icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.form-screen__headline {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.form-screen__sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  margin: 0 auto;
}

.form-card__field {
  margin-bottom: 16px;
}

.form-card__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-card__input::placeholder {
  color: var(--text-muted);
}

.form-card__input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-card__input.error {
  border-color: var(--danger);
}

.form-card__error {
  font-size: 13px;
  color: var(--danger);
  text-align: left;
  margin-top: 6px;
  display: none;
}

.form-card__error.visible {
  display: block;
}

.form-card .btn {
  margin-top: 8px;
}

.form-card__privacy {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
}

.form-card__skip {
  display: none;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
}

.form-card__skip:hover {
  color: var(--text-secondary);
}

/* --- Preview score (shown above form) --- */

.preview-score {
  margin-bottom: 36px;
}

.preview-score__circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  position: relative;
}

.preview-score__circle::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--border) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
}

.preview-score__label {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Results screen --- */

.results {
  padding: 48px 0 64px;
}

.results__header {
  text-align: center;
  margin-bottom: 48px;
}

.results__score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-card);
}

.results__score-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(var(--level-color, var(--accent)) calc(var(--pct) * 1%), var(--border) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff calc(100% - 4px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff calc(100% - 4px));
}

.results__score-number {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.results__score-total {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.results__level-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.results__level-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.results__description {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Block results --- */

.block-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.block-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.block-result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.block-result__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.block-result__icon {
  font-size: 20px;
}

.block-result__score {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.block-result__bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.block-result__bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
  width: 0%;
}

.block-result__diagnosis {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- CTA final --- */

.results__cta {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  margin-top: 24px;
}

.results__cta-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.results__cta-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Footer --- */

.footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.footer__text {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer__slogan {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 12px auto 0;
  line-height: 1.6;
  font-style: italic;
}

.footer__privacy {
  margin-top: 16px;
}

.footer__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer__link--privacy {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.footer__link:hover {
  text-decoration: underline;
}

/* --- Utilities --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .intro {
    padding: 32px 0 48px;
  }

  .btn--large {
    font-size: 16px;
    padding: 16px 32px;
    width: 100%;
  }

  .form-card {
    padding: 24px 20px;
  }

  .results__score-ring {
    width: 120px;
    height: 120px;
  }

  .results__score-number {
    font-size: 36px;
  }

  .block-result {
    padding: 20px;
  }

  .quiz-nav .btn {
    min-width: 0;
    flex: 1;
  }

  .results__cta {
    padding: 28px 20px;
  }
}
