/* Modal del recomendador. Figma, nodos 351:138, 343:490, 343:871, 343:1583, 343:2639.
   Usa los tokens de css/style-v2.css (--color-brand, --color-navy, --color-surface...). */

.rec-open { overflow: hidden; }

.rec { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.rec[hidden] { display: none; }
.rec__overlay { position: fixed; inset: 0; background: rgba(2, 1, 90, 0.7); }

.rec__box {
  position: relative; width: 100%; max-width: 900px; margin: 1.5rem auto; padding: 1.5rem 1.25rem 1.25rem;
  color: var(--color-white); background: var(--color-brand) url('/assets/icons/recommender/modal-glow.svg') no-repeat right top / cover;
  border-radius: 20px; box-shadow: 0 4px 40px rgba(0, 0, 0, 0.8); outline: none;
}
.rec__box--light { color: var(--color-navy); background: var(--color-white); }

.rec__close { position: absolute; top: 1.25rem; right: 1.25rem; padding: 0.25rem; border: none; background: none; cursor: pointer; line-height: 0; }
.rec__close-icon--dark { display: none; }
.rec__box--light .rec__close-icon--light { display: none; }
.rec__box--light .rec__close-icon--dark { display: inline; }

.rec__view[hidden] { display: none; }
.rec__view--center { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3rem 1rem; text-align: center; }

.rec__heading { max-width: 520px; margin: 0.5rem auto 1.5rem; font-size: 1.375rem; font-weight: 500; line-height: 1.2; text-align: center; }
.rec__heading strong { font-weight: 500; color: #f8fe4c; text-transform: none; }
.rec__heading--stack { max-width: 698px; }
.rec__heading--stack span { display: block; color: #f8ff40; }

.rec__card { overflow: clip; color: var(--color-navy); background: var(--color-surface); border-radius: 20px; }
.rec__card--padded { padding: 2rem 1.25rem; text-align: center; }
.rec__card-head { padding: 1rem 1.25rem; background: var(--color-white); text-align: center; }
.rec__question { margin: 0; font-size: 1.25rem; font-weight: 300; color: var(--color-navy); }
.rec__counter { margin: 0.5rem 0 0; font-size: 1rem; color: var(--color-text-light); }
.rec__card-body { padding: 1.5rem 1.25rem; }

.rec__options { display: grid; gap: 1rem; }
.rec__options--icon { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; margin: 0 auto; }
.rec__options--text { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rec__options--multiple { grid-template-columns: 1fr; gap: 0.75rem 2rem; }

.rec__opt { font: inherit; color: var(--color-brand); cursor: pointer; }
.rec__opt--icon, .rec__opt--text { border: none; border-radius: var(--radius-md); background: var(--color-white); transition: background-color 0.15s, color 0.15s; }
.rec__opt--icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; aspect-ratio: 1; max-width: 100%; padding: 1rem; font-size: 1.25rem; }
.rec__opt--icon img { width: 56px; height: 56px; }
.rec__opt--text { min-height: 62px; padding: 0.75rem 1rem; font-size: 1.125rem; text-align: center; }
.rec__opt--icon:hover, .rec__opt--text:hover, .rec__opt.is-selected { color: var(--color-white); background: var(--color-brand); }
.rec__opt--icon:hover img, .rec__opt--icon.is-selected img { filter: brightness(0) invert(1); }
.rec__opt:focus-visible { outline: 3px solid var(--color-lilac); outline-offset: 2px; }

.rec__opt--check { display: flex; align-items: flex-start; gap: 0.625rem; font-size: 1rem; }
.rec__opt--check input { flex-shrink: 0; width: 23px; height: 23px; margin: 0; accent-color: var(--color-brand); border-radius: 3px; }

.rec__error, .rec__field-error { margin: 0.75rem 0 0; font-size: 0.875rem; color: #c0262d; }
.rec__error { text-align: center; }
.rec__error[hidden], .rec__field-error[hidden] { display: none; }

.rec__nav { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 0.5rem; background: var(--color-surface); }
.rec__back, .rec__continue { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 50px; padding: 0 1.5rem; font: inherit; font-size: 1rem; border: none; border-radius: var(--radius-md); cursor: pointer; }
.rec__back { color: var(--color-text-light); background: var(--color-white); }
.rec__continue { margin-left: auto; color: var(--color-white); background: var(--color-brand); }
.rec__back img { transform: scaleX(-1); }
.rec__back[hidden], .rec__continue[hidden] { display: none; }

.rec__entry-title { margin: 1rem 0 0.25rem; font-size: 1.75rem; font-weight: 500; text-align: center; color: var(--color-navy); }
.rec__entry-lead { margin: 0 0 1.5rem; text-align: center; color: var(--color-text-light); }
.rec__entry-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.rec__entry-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 249px; padding: 1.5rem 1rem; font: inherit; color: var(--color-white);
  text-align: center; border: none; border-radius: var(--radius-md); cursor: pointer;
  background: var(--color-brand) url('/assets/icons/recommender/entry-card-bg-a.svg') no-repeat center / cover;
}
.rec__entry-card:nth-child(2) { background-image: url('/assets/icons/recommender/entry-card-bg-b.svg'); }
.rec__entry-card:focus-visible { outline: 3px solid var(--color-lilac); outline-offset: 2px; }
.rec__entry-card > img:first-child { width: auto; height: auto; max-width: 80px; max-height: 80px; }
.rec__entry-card strong { font-size: 1.375rem; }
.rec__entry-card span { max-width: 178px; font-size: 1rem; }
.rec__entry-arrow { margin-top: 0.5rem; }
/* Tests picker: more cards, so smaller ones. The category icons are the brand-colored ones from
   the home; the filter turns them white over the purple card. */
.rec__entry-grid--tests { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.rec__entry-card--test { min-height: 170px; padding: 1.25rem 0.75rem 1rem; gap: 0.375rem; }
.rec__entry-card--test:nth-child(2) { background-image: url('/assets/icons/recommender/entry-card-bg-a.svg'); }
.rec__entry-card--test:nth-child(4n+2), .rec__entry-card--test:nth-child(4n+3) { background-image: url('/assets/icons/recommender/entry-card-bg-b.svg'); }
.rec__entry-card--test > img:first-child { max-width: 48px; max-height: 48px; filter: brightness(0) invert(1); }
.rec__entry-card--test strong { font-size: 1.125rem; }
.rec__entry-card--test span { font-size: 0.875rem; line-height: 1.3; }
.rec__entry-card--test .rec__entry-arrow { margin-top: 0.25rem; }
.rec__nav--picker { justify-content: center; margin-top: 1rem; }
.rec__nav--picker .rec__back { background: var(--color-surface); }

.rec__contact-head { text-align: center; }
.rec__contact-lead strong { font-weight: 700; }
.rec__contact-lead {max-width: 588px; margin: 0 auto 1.5rem; font-size: 1.125rem; font-weight: 300; }
.rec__form { display: grid; gap: 0.75rem; padding: 1.5rem 1.25rem; }
.rec__benefits { display: grid; justify-items: center; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: 1.125rem; font-weight: 300; }
.rec__benefits li { display: flex; align-items: center; gap: 0.5rem; }
.rec__field input, .rec__field select {
  width: 100%; min-height: 62px; padding: 0 1.25rem; font: inherit; font-size: 1rem; color: var(--color-navy);
  background: var(--color-white); border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
}
.rec__field--phone { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0.5rem; }
.rec__field--phone .rec__field-error { grid-column: 1 / -1; margin-top: 0; }
.rec__consent { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.875rem; color: var(--color-text-light); }
.rec__consent input { flex-shrink: 0; width: 23px; height: 23px; margin: 0; accent-color: var(--color-brand); }
.rec__consent a { color: inherit; }
.rec__submit { justify-self: center; min-height: 62px; padding: 0 2rem; font: inherit; font-size: 1.125rem; color: var(--color-white); background: var(--color-brand); border: none; border-radius: var(--radius-md); cursor: pointer; }
.rec__submit--ghost { color: var(--color-brand); background: var(--color-white); border: 1px solid var(--color-brand); }
.rec__submit[disabled] { opacity: 0.6; cursor: progress; }
.rec__thanks { margin: 0 0 1.5rem; font-size: 1rem; }
.rec__status { margin: 0; font-size: 1.125rem; }

.rec__spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.35); border-top-color: var(--color-white); border-radius: 50%; animation: rec-spin 0.9s linear infinite; }
.rec__box--light .rec__spinner { border-color: var(--color-surface-alt); border-top-color: var(--color-brand); }
@keyframes rec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rec__spinner { animation: none; } }

@media (max-width: 767px) {
  .rec { padding: 0; }
  .rec__box { min-height: 100%; margin: 0; border-radius: 0; }
}

@media (min-width: 768px) {
  .rec__box { padding: 1.5rem 1.25rem 1.25rem; }
  .rec__heading { font-size: 1.875rem; }
  .rec__entry-title { font-size: 2.5rem; }
  .rec__entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rec__entry-grid--tests { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
  .rec__options--text { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; margin: 0 auto; }
  .rec__options--icon { grid-template-columns: repeat(auto-fit, minmax(160px, 200px)); justify-content: center; max-width: none; }
  .rec__options--multiple { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 2.5rem; }
  .rec__card-body { padding: 2rem 2.5rem; }
  .rec__form { padding: 2rem 4.5rem; }
}
