/* ════════════════════════════════════════════
   RESET CRÍTICO — neutralizar estilos del tema WordPress
   que sobreescriben el color del botón principal
════════════════════════════════════════════ */
#alsfrs-root .alsfrs-btn,
#alsfrs-root .alsfrs-btn:visited,
#alsfrs-root .alsfrs-btn:link {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  letter-spacing: .02em;
  box-sizing: border-box;
  -webkit-appearance: none;
  text-decoration: none;
  border: none;
  outline: none;
}

#alsfrs-root .alsfrs-btn-primary,
#alsfrs-root button.alsfrs-btn-primary,
#alsfrs-root input[type=submit].alsfrs-btn-primary {
  background: #0A1F3D !important;
  background-color: #0A1F3D !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(10,31,61,.35) !important;
  border: none !important;
}

#alsfrs-root .alsfrs-btn-primary:hover {
  background: #132D5A !important;
  background-color: #132D5A !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(10,31,61,.45) !important;
}

#alsfrs-root .alsfrs-btn-export,
#alsfrs-root button.alsfrs-btn-export {
  background: #ffffff !important;
  color: #0A1F3D !important;
  border: 2px solid #0A1F3D !important;
}

#alsfrs-root .alsfrs-btn-export:hover {
  background: #0A1F3D !important;
  color: #ffffff !important;
}

#alsfrs-root .alsfrs-btn-ghost,
#alsfrs-root button.alsfrs-btn-ghost {
  background: transparent !important;
  color: #4A4A6A !important;
  border: 2px solid #DDDDDD !important;
}

#alsfrs-root .alsfrs-btn-ghost:hover {
  border-color: #4A4A6A !important;
  color: #1A1A2E !important;
}


/* ================================================================
   ALSFRS-R · Centro Médico Monobe · v2.0
   Paleta: Navy #0A1F3D · Gold #C9A14B · Cream #FAF7F0
   Tipografía: Cormorant Garamond (display) + DM Sans (body)
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
  --navy:      #0A1F3D;
  --navy-90:   rgba(10,31,61,.9);
  --navy-08:   rgba(10,31,61,.08);
  --gold:      #C9A14B;
  --gold-light:#E8C97A;
  --gold-dark: #A8822C;
  --cream:     #FAF7F0;
  --cream2:    #F2EDE3;
  --white:     #ffffff;
  --text-1:    #1A1A2E;
  --text-2:    #4A4A6A;
  --text-3:    #8888A8;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(10,31,61,.10);
  --shadow-lg: 0 12px 48px rgba(10,31,61,.16);
  --font-d:    'Cormorant Garamond', Georgia, serif;
  --font-b:    'DM Sans', -apple-system, sans-serif;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset dentro del plugin ── */
.alsfrs-root *, .alsfrs-root *::before, .alsfrs-root *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
}

.alsfrs-root {
  font-family: var(--font-b);
  color: var(--text-1);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
}

/* ════════════════════════════════════════════
   HEADER
════════════════════════════════════════════ */
.alsfrs-header {
  background: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}

.alsfrs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

.alsfrs-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.alsfrs-logo-wrap {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.alsfrs-brand-name {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .01em;
}

.alsfrs-brand-sub {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 1px;
}

.alsfrs-header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,161,75,.15);
  border: 1px solid rgba(201,161,75,.35);
  border-radius: 20px;
  padding: 5px 14px;
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
}

.alsfrs-version {
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
}

.alsfrs-progress-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,.1);
}

.alsfrs-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width .5s ease;
}

/* ════════════════════════════════════════════
   SECCIÓN FORMULARIO
════════════════════════════════════════════ */
.alsfrs-section-form {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Hero */
.alsfrs-hero {
  text-align: center;
  margin-bottom: 40px;
}

.alsfrs-title {
  font-family: var(--font-d);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 12px;
}

.alsfrs-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.alsfrs-desc {
  font-size: 15px;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto;
}

/* Cards */
.alsfrs-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(10,31,61,.06);
  transition: box-shadow var(--transition), transform var(--transition);
}

.alsfrs-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Card paciente */
.alsfrs-card-patient {
  border-left: 4px solid var(--navy);
}

.alsfrs-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alsfrs-patient-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.alsfrs-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.alsfrs-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #DDD;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-b);
  color: var(--text-1);
  background: var(--cream);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.alsfrs-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,161,75,.15);
  background: var(--white);
}

/* ── Grupos por área ── */
.alsfrs-area-group {
  margin-bottom: 8px;
}

.alsfrs-area-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 8px;
  margin-bottom: 4px;
}

.alsfrs-area-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--area-color, var(--navy));
  flex-shrink: 0;
}

.alsfrs-area-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--area-color, var(--navy));
}

/* ── Pregunta ── */
.alsfrs-q-card {
  padding: 20px 24px;
  border-left: 4px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.alsfrs-q-card.is-answered {
  border-left-color: var(--gold);
}

.alsfrs-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alsfrs-q-num {
  min-width: 28px; height: 28px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.alsfrs-q-icon { font-size: 18px; }

.alsfrs-q-title {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
}

.alsfrs-q-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity var(--transition), transform var(--transition);
}

.alsfrs-q-card.is-answered .alsfrs-q-check {
  opacity: 1;
  transform: scale(1);
}

/* Opciones de respuesta */
.alsfrs-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.alsfrs-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #E8E8E8;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.alsfrs-opt input[type="radio"] { display: none; }

.alsfrs-opt-score {
  min-width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.alsfrs-opt-text {
  font-size: 14px;
  color: var(--text-2);
  transition: color var(--transition);
}

.alsfrs-opt:hover {
  border-color: var(--gold-light);
  background: rgba(201,161,75,.06);
}

.alsfrs-opt:hover .alsfrs-opt-score {
  color: var(--gold-dark);
  border-color: var(--gold);
}

.alsfrs-opt.is-selected {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(201,161,75,.08), rgba(201,161,75,.03));
}

.alsfrs-opt.is-selected .alsfrs-opt-score {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

.alsfrs-opt.is-selected .alsfrs-opt-text {
  color: var(--navy);
  font-weight: 500;
}

/* Botones */
.alsfrs-actions {
  margin-top: 40px;
  text-align: center;
}

.alsfrs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: .02em;
  text-decoration: none;
}

.alsfrs-btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(10,31,61,.3);
}

.alsfrs-btn-primary:hover {
  background: #132D5A;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(10,31,61,.4);
}

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

.alsfrs-btn-export {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}

.alsfrs-btn-export:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.alsfrs-btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 2px solid #DDD;
}

.alsfrs-btn-ghost:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.alsfrs-btn-icon { font-size: 16px; }

.alsfrs-actions-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
}

/* Mensaje de estado */
.alsfrs-msg {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: fadeIn .3s ease;
}

.alsfrs-msg.ok {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  color: #166534;
}

.alsfrs-msg.err {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #991b1b;
}

/* ════════════════════════════════════════════
   RESULTADOS / REPORTE EXPORTABLE
════════════════════════════════════════════ */
.alsfrs-section-results {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.alsfrs-export-panel {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(10,31,61,.08);
}

/* Cabecera del reporte */
.alsfrs-report-header {
  background: var(--navy);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.alsfrs-report-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.alsfrs-report-icon {
  font-size: 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.alsfrs-report-clinic {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 600;
  color: var(--white);
}

.alsfrs-report-model {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: .04em;
  margin-top: 2px;
}

.alsfrs-report-meta {
  text-align: right;
  color: var(--gold-light);
  font-size: 13px;
  line-height: 1.8;
}

.alsfrs-report-meta strong { color: var(--white); }

/* Score hero */
.alsfrs-score-hero {
  padding: 48px 36px;
  display: flex;
  align-items: center;
  gap: 48px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--cream2);
}

/* Ring SVG */
.alsfrs-score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.alsfrs-ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.alsfrs-ring-bg {
  fill: none;
  stroke: var(--cream2);
  stroke-width: 10;
}

.alsfrs-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .5s ease;
}

.alsfrs-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.alsfrs-ring-score {
  font-family: var(--font-d);
  font-size: 46px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}

.alsfrs-ring-total {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 2px;
}

.alsfrs-score-interp { flex: 1; }

.alsfrs-interp-label {
  font-family: var(--font-d);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
}

.alsfrs-interp-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 380px;
}

/* Secciones internas del reporte */
.alsfrs-breakdown,
.alsfrs-detail-table-wrap,
.alsfrs-chart-wrap {
  padding: 32px 36px;
  border-bottom: 1px solid var(--cream2);
}

.alsfrs-section-title {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

/* Desglose grid */
.alsfrs-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.alsfrs-area-card {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 16px;
  border-left: 4px solid var(--area-color, var(--navy));
}

.alsfrs-area-card-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.alsfrs-area-card-score {
  font-family: var(--font-d);
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
}

.alsfrs-area-card-max {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Tabla detallada */
.alsfrs-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.alsfrs-detail-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 2px solid var(--cream2);
}

.alsfrs-detail-table th.right { text-align: right; }

.alsfrs-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cream2);
  vertical-align: middle;
}

.alsfrs-detail-table tr:last-child td { border-bottom: none; }

.alsfrs-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  float: right;
}

.alsfrs-score-pill.s4 { background:#dcfce7; color:#166534; }
.alsfrs-score-pill.s3 { background:#fef9c3; color:#854d0e; }
.alsfrs-score-pill.s2 { background:#ffedd5; color:#9a3412; }
.alsfrs-score-pill.s1 { background:#fee2e2; color:#991b1b; }
.alsfrs-score-pill.s0 { background:#450a0a; color:#fca5a5; }

/* Área badge en tabla */
.alsfrs-area-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
}

/* Chart */
.alsfrs-chart-wrap { background: var(--cream); }
.alsfrs-chart-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

/* Footer del reporte */
.alsfrs-report-footer {
  padding: 24px 36px;
  background: var(--navy);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  line-height: 1.8;
}

.alsfrs-footer-brand {
  color: var(--gold-light);
  margin-top: 6px;
  font-family: var(--font-d);
  font-size: 13px;
}

/* Botones resultado */
.alsfrs-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  padding-bottom: 20px;
}

/* ── Loading overlay ── */
.alsfrs-loading {
  position: fixed;
  inset: 0;
  background: rgba(10,31,61,.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: var(--white);
  gap: 16px;
}

.alsfrs-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.alsfrs-loading p {
  font-size: 15px;
  color: var(--gold-light);
  font-family: var(--font-d);
}

/* ── Animaciones ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alsfrs-section-form,
.alsfrs-section-results { animation: fadeIn .5s ease; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .alsfrs-header-inner { padding: 14px 16px; }
  .alsfrs-brand-sub    { display: none; }
  .alsfrs-section-form { padding: 28px 14px 60px; }
  .alsfrs-patient-row  { grid-template-columns: 1fr; }
  .alsfrs-score-hero   { flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; gap: 24px; }
  .alsfrs-report-header{ flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 20px; }
  .alsfrs-report-meta  { text-align: left; }
  .alsfrs-breakdown,
  .alsfrs-detail-table-wrap,
  .alsfrs-chart-wrap   { padding: 20px 16px; }
  .alsfrs-report-footer{ padding: 16px 16px; }
  .alsfrs-result-actions { flex-direction: column; align-items: center; }
  .alsfrs-btn          { width: 100%; max-width: 320px; justify-content: center; }
  .alsfrs-interp-label { font-size: 24px; }
  .alsfrs-breakdown-grid { grid-template-columns: 1fr 1fr; }
}
