/* Austral Medical · Tecnovigilancia (página + página de agradecimiento)
   Estilos específicos de la página. Los fallbacks genéricos van dentro de
   :where() (especificidad 0) para que site.css siempre tenga prioridad. */

/* ---------- Fallbacks mínimos (si site.css no cargó) ---------- */
:where(.tv-page) {
  margin: 0;
  background: var(--white, #fff);
  color: var(--dark, #1a2433);
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
:where(.tv-page) h1,
:where(.tv-page) h2,
:where(.tv-page) h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}
:where(.tv-page) *,
:where(.tv-page) *::before,
:where(.tv-page) *::after { box-sizing: border-box; }
:where(.tv-page) [hidden] { display: none !important; }
:where(.tv-page .sr-only) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:where(.tv-page .container) { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

:where(.tv-form .form-group) { margin: 0 0 20px; }
:where(.tv-form label),
:where(.tv-form legend) { display: block; font-weight: 500; margin-bottom: 6px; }
:where(.tv-form input:not([type="radio"]):not([type="hidden"])),
:where(.tv-form select),
:where(.tv-form textarea) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--dark, #1a2433);
  background: var(--white, #fff);
  border: 1px solid var(--border, #dde3ec);
  border-radius: 6px;
}
:where(.tv-form textarea) { min-height: 120px; resize: vertical; }
:where(.tv-form fieldset) { border: 0; padding: 0; margin: 0; min-width: 0; }
:where(.tv-form .field-hint) { margin: 0 0 6px; font-size: 14px; color: var(--gray, #6b7a8d); }
:where(.tv-form .field-error) { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: #b42318; }
:where(.tv-form [aria-invalid="true"]:not([type="radio"])) { border-color: #b42318; border-width: 2px; }
:where(.tv-form .form-error-summary) {
  margin: 0 0 24px; padding: 16px; border: 2px solid #b42318; border-radius: 8px;
  background: #fef3f2;
}
:where(.tv-page .btn-primary),
:where(.tv-page .btn-secondary) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 6px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
:where(.tv-page .btn-primary) { background: var(--blue, #185FA5); color: var(--white, #fff); border: 1px solid var(--blue, #185FA5); }
:where(.tv-page .btn-secondary) { background: transparent; color: var(--blue, #185FA5); border: 1px solid var(--blue, #185FA5); }
:where(.tv-page .page-hero) { background: var(--dark, #1a2433); color: var(--white, #fff); padding: 48px 0 40px; }

/* ---------- Estructura de página ---------- */
.tv-container { max-width: 760px; }

.tv-hero h1 { margin: 0 0 12px; font-size: clamp(1.75rem, 6vw, 2.5rem); }
.tv-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-light, #5ba3e0);
}
.tv-lead { margin: 0; max-width: 60ch; font-size: 17px; opacity: 0.92; }

.tv-section { padding: 32px 0 0; }
.tv-section--form { padding-bottom: 56px; }

.tv-facts {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.tv-facts li {
  padding: 12px 16px;
  background: var(--gray-light, #f4f6f9);
  border-radius: 8px;
}
.tv-facts strong { font-weight: 500; }

/* ---------- Avisos ---------- */
.tv-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border, #dde3ec);
  border-left-width: 5px;
}
.tv-notice p { margin: 0; }
.tv-notice-icon { flex: 0 0 auto; margin-top: 2px; }
.tv-notice a { font-weight: 500; white-space: nowrap; color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.tv-notice--urgent {
  background: #fef3f2;
  border-color: #f3c6c2;
  border-left-color: #b42318;
  color: #7a1a12;
  font-size: 17px;
}
.tv-notice--urgent a {
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

.tv-notice--privacy {
  background: #fff8e6;
  border-color: #f2dca6;
  border-left-color: #b7791f;
  color: #5c3d06;
}

/* ---------- Formulario ---------- */
.tv-form-title { margin: 0 0 4px; font-size: clamp(1.4rem, 4.5vw, 1.75rem); }
.tv-required-note { margin: 0 0 16px; color: var(--gray, #6b7a8d); font-size: 15px; }

.tv-block {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tv-block-title {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border, #dde3ec);
}

.tv-form input,
.tv-form select,
.tv-form textarea { font-size: 16px; max-width: 100%; }
.tv-form input[type="date"] { min-height: 48px; max-width: 16rem; }

.tv-choice-fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tv-choice-fieldset legend { padding: 0; margin-bottom: 6px; font-weight: 500; }
.tv-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.tv-choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--border, #dde3ec);
  border-radius: 6px;
  background: var(--white, #fff);
  font-weight: 400;
  cursor: pointer;
}
.tv-choice input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue, #185FA5);
  flex: 0 0 auto;
}
.tv-choice:has(input:checked) {
  border-color: var(--blue, #185FA5);
  background: var(--blue-pale, #E6F1FB);
}
.tv-choice:has(input:focus-visible) {
  outline: 3px solid var(--blue-light, #5ba3e0);
  outline-offset: 2px;
}
.tv-choice-fieldset.tv-has-error .tv-choice { border-color: #b42318; }

.tv-has-error { border-left: 3px solid #b42318; padding-left: 12px; }

.tv-field-error { color: #b42318; font-weight: 500; }

.tv-error-summary:focus { outline: 3px solid var(--blue-light, #5ba3e0); outline-offset: 3px; }
.tv-error-summary-title {
  margin: 0 0 8px;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: #b42318;
}
.tv-error-summary ul { margin: 0; padding-left: 20px; }
.tv-error-summary li { margin: 4px 0; }
.tv-error-summary a { color: #b42318; font-weight: 500; text-decoration: underline; display: inline-block; padding: 6px 0; }

.tv-submit { padding-top: 8px; border-top: 1px solid var(--border, #dde3ec); }
.tv-next { margin: 16px 0; color: var(--gray, #6b7a8d); font-size: 15px; }
.tv-btn { width: 100%; min-height: 48px; font-size: 16px; }
.tv-btn[disabled] { opacity: 0.7; cursor: progress; }

/* ---------- Página de agradecimiento ---------- */
.tv-thanks { padding: 32px 0 56px; }
.tv-thanks p { max-width: 60ch; }
.tv-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.tv-actions a { min-height: 48px; }

@media (min-width: 600px) {
  .tv-btn { width: auto; min-width: 14rem; }
  .tv-actions { flex-direction: row; flex-wrap: wrap; }
  .tv-facts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-page * { scroll-behavior: auto !important; }
}

/* Evita que el encabezado fijo tape el resumen o el campo enfocado. */
.tv-error-summary,
.tv-form .form-group,
.tv-choice-fieldset { scroll-margin-top: 96px; }
