/* ── Autodiagnóstico Emprendedor COEC · Frontend CSS ── */
:root {
  /* Marca */
  --ae-primary:         #104176;
  --ae-primary-dark:    #0d3460;
  --ae-primary-light:   #e8f0f8;
  --ae-primary-border:  #bfdbfe;
  --ae-primary-soft:    #dbeafe;
  --ae-primary-mid:     #93c5fd;
  --ae-primary-deep:    #1e3a8a;
  --ae-primary-bright:  #1d4ed8;
  --ae-cta:             #F9A138;
  --ae-cta-dark:        #e08920;
  --ae-cta-light:       #fff8ee;
  --ae-cta-border:      #fde68a;

  /* Superficies */
  --ae-paper:           #F2F6F7;
  --ae-surface:         #ffffff;
  --ae-surface-alt:     #f8fafc;

  /* Texto */
  --ae-ink:             #1a1a2e;
  --ae-ink-soft:        #374151;
  --ae-muted:           #6b7280;

  /* Bordes */
  --ae-border:          #e2e8f0;

  /* Estado: verde */
  --ae-green:           #059669;
  --ae-green-light:     #ecfdf5;
  --ae-green-border:    #6ee7b7;
  --ae-green-deep:      #065f46;

  /* Estado: ámbar */
  --ae-amber:           #d97706;
  --ae-amber-light:     #fffbeb;
  --ae-amber-border:    #fcd34d;
  --ae-amber-deep:      #92400e;

  /* Estado: rojo */
  --ae-red:             #dc2626;
  --ae-red-light:       #fef2f2;
  --ae-red-border:      #fca5a5;
  --ae-red-deep:        #991b1b;

  /* Overlays sobre fondos oscuros */
  --ae-on-dark:         rgba(255,255,255,.65);
  --ae-on-dark-dim:     rgba(255,255,255,.55);
  --ae-on-dark-subtle:  rgba(255,255,255,.15);
  --ae-on-dark-ghost:   rgba(255,255,255,.10);
  --ae-on-dark-track:   rgba(255,255,255,.40);
  --ae-on-light-track:  rgba(0,0,0,.15);

  /* Radios */
  --ae-radius:          12px;
  --ae-radius-sm:       8px;
}

.ae-app { font-family: 'Urbanist', sans-serif; color: var(--ae-ink); font-size: 15px; line-height: 1.6; }
.ae-app *, .ae-app *::before, .ae-app *::after { box-sizing: border-box; }

/* ── PROGRESS STEPS ── */
.ae-progress {
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius);
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
}
.ae-progress-inner { display: flex; align-items: center; gap: 0; }
.ae-step-indicator  { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ae-step-dot {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--ae-border); background: var(--ae-paper);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--ae-muted);
  flex-shrink: 0; transition: all .25s;
}
.ae-step-info { display: flex; flex-direction: column; }
.ae-step-num  { font-size: 0.8rem; color: var(--ae-muted); font-weight: 500; }
.ae-step-name { font-size: 0.85rem; font-weight: 600; color: var(--ae-muted); }
.ae-step-line {
  flex: 1; height: 2px; background: var(--ae-border);
  margin: 0 .75rem; min-width: 20px; transition: background .25s;
}

.ae-step-indicator--active .ae-step-dot  { background: var(--ae-primary); border-color: var(--ae-primary); color: var(--ae-surface); }
.ae-step-indicator--active .ae-step-name { color: var(--ae-primary); }
.ae-step-indicator--done   .ae-step-dot  { background: var(--ae-primary); border-color: var(--ae-primary); color: var(--ae-surface); }
.ae-step-indicator--done   .ae-step-dot::after { content: '✓'; font-size: 16px; font-weight: 700; }
.ae-step-indicator--done   .ae-step-dot span   { display: none; }
.ae-step-indicator--done   .ae-step-line,
.ae-step-indicator--active .ae-step-line { background: var(--ae-primary); }

/* ── STEP PAGES ── */
.ae-step-page          { display: none; }
.ae-step-page--active  { display: block; }

/* ── SECTION CARDS ── */
.ae-section-card {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); margin-bottom: 1.25rem; overflow: hidden;
}
.ae-section-header {
  display: flex; align-items: center; gap: 14px;
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--ae-border);
  background: var(--ae-surface-alt);
}
.ae-section-label {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ae-primary); color: var(--ae-surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.ae-section-label--teal  { background: var(--ae-primary); }
.ae-section-title        { font-weight: 700; font-size: 1rem; }
.ae-section-subtitle     { font-size: 12px; color: var(--ae-muted); margin-top: 2px; }
.ae-section-avg          { margin-left: auto; font-size: 13px; color: var(--ae-muted); }
.ae-section-avg strong   { font-size: 16px; font-weight: 700; color: var(--ae-ink); margin-left: 4px; }

/* ── QUESTIONS ── */
.ae-question-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--ae-border);
}
.ae-question-row:last-child { border-bottom: none; }
.ae-question-num  { font-size: 0.85rem; font-weight: 700; color: var(--ae-muted); margin-bottom: 2px; }
.ae-question-text { font-size: 1rem; line-height: 1.55; }

.ae-star-group { display: flex; gap: 4px; }
.ae-app .ae-star {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1.5px solid var(--ae-primary); background: var(--ae-primary-light);
  cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1;
  color: var(--ae-primary); display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0; font-family: 'Urbanist', sans-serif;
}
.ae-app .ae-star:hover, .ae-app .ae-star:focus       { border-color: var(--ae-cta-dark); color: var(--ae-cta-dark); background: var(--ae-cta-light); }
.ae-app .ae-star.ae-star--sel { background: var(--ae-cta); border-color: var(--ae-cta-dark); color: var(--ae-surface); }

/* ── ESTADO TABLE ── */
.ae-estado-table { width: 100%; border-collapse: collapse; border: none; }
.ae-estado-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ae-muted); background: var(--ae-surface-alt);
  padding: .65rem 1rem; border: none; border-bottom: 1px solid var(--ae-border); text-align: center;
}
.ae-estado-table th:first-child { text-align: left; }
.ae-estado-table tbody tr   { background: var(--ae-surface); }
.ae-estado-table td {
  padding: .85rem 1rem; text-align: center; font-size: 14px;
  border: none; border-bottom: 1px solid var(--ae-border);
}
.ae-estado-table td:first-child { text-align: left; font-weight: 500; }
.ae-estado-table tr:last-child td { border-bottom: none; }
.ae-estado-radio { width: 18px; height: 18px; cursor: pointer; accent-color: var(--ae-primary); }

/* ── BUTTONS ── */
.ae-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: .8rem 1.75rem; border-radius: var(--ae-radius-sm);
  font-family: 'Urbanist', sans-serif; font-size: 18px; font-weight: 700;
  cursor: pointer; transition: all .18s; border: none; text-decoration: none;
}
.ae-btn--primary        { background: var(--ae-primary);  color: var(--ae-surface); }
.ae-btn--primary:hover, .ae-btn--primary:focus  { background: var(--ae-primary-dark); }
.ae-btn--cta            { background: var(--ae-cta);      color: var(--ae-surface); }
.ae-btn--cta:hover, .ae-btn--cta:focus      { background: var(--ae-cta-dark); }
.ae-btn--outline        { background: var(--ae-surface);  color: var(--ae-primary); border: 1.5px solid var(--ae-primary); }
.ae-btn--outline:hover, .ae-btn--outline:focus  { background: var(--ae-primary-light); color: var(--ae-primary); }
.ae-btn--ghost          { background: transparent; color: var(--ae-muted); border: 1.5px solid var(--ae-border); }
.ae-btn--ghost:hover, .ae-btn--ghost:focus { background: var(--ae-paper); color: var(--ae-ink); }
.ae-btn:disabled        { opacity: .45; cursor: not-allowed; }
.ae-btn:active:not(:disabled) { transform: scale(.98); }

.ae-step-nav        { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.ae-step-nav--end   { justify-content: flex-end; }

/* ── RESULTS: HERO ── */
.ae-results-hero {
  background: var(--ae-primary); color: var(--ae-surface);
  border-radius: var(--ae-radius); padding: 1.75rem 2rem;
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.ae-results-hero-text h2 {
  font-family: 'Urbanist', sans-serif; font-size: 1.55rem; font-weight: 700; margin-bottom: .25rem;
}
.ae-results-hero-text p { color: var(--ae-on-dark); font-size: 14px; }
.ae-profile-badge {
  flex-shrink: 0; text-align: center;
  background: var(--ae-on-dark-ghost); border: 1px solid var(--ae-on-dark-subtle);
  border-radius: var(--ae-radius); padding: 1rem 1.5rem; min-width: 140px; margin-left: auto;
}
.ae-profile-badge-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ae-on-dark-dim); margin-bottom: 6px;
}
.ae-profile-badge-value { font-size: 20px; font-weight: 700; color: var(--ae-surface); }

/* ── RESULTS: KPI ── */
.ae-metrics-row {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.25rem;
}
.ae-metric-card {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); padding: 1.25rem 1.5rem; text-align: center;
}
.ae-m-label { font-size: 14px; color: var(--ae-muted); font-weight: 600; margin-bottom: 6px; }
.ae-m-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.ae-m-sub   { font-size: 12px; color: var(--ae-muted); margin-top: 4px; }
.ae-m-blue  { color: var(--ae-primary); }
.ae-m-green { color: var(--ae-green); }
.ae-m-amber { color: var(--ae-amber); }

/* ── INTERPRETATION ── */
.ae-interp-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--ae-primary-light); border: 1px solid var(--ae-primary-border);
  border-radius: var(--ae-radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.ae-interp-icon  { font-size: 22px; flex-shrink: 0; }
.ae-interp-title { font-size: 14px; font-weight: 700; color: var(--ae-primary); margin-bottom: 4px; }
.ae-interp-card p { font-size: 16px; color: var(--ae-primary-deep); line-height: 1.65; margin: 0;}

/* ── CHARTS ── */
.ae-charts-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem;
}
.ae-chart-card {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); padding: 1.5rem;
}
.ae-chart-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 1.25rem; color: var(--ae-ink); }

/* ── DIM LIST ── */
.ae-dim-list {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); margin-bottom: 1.25rem; overflow: hidden;
}
.ae-dim-list-header {
  padding: 1rem 1.5rem; background: var(--ae-surface-alt);
  border-bottom: 1px solid var(--ae-border); font-weight: 700; font-size: 14px;
}
.ae-dim-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.5rem; border-bottom: 1px solid var(--ae-border);
}
.ae-dim-row:last-child { border-bottom: none; }
.ae-dim-name      { font-size: 14px; min-width: 170px; font-weight: 500; }
.ae-dim-bar-wrap  { flex: 1; background: var(--ae-border); border-radius: 99px; height: 8px; overflow: hidden; }
.ae-dim-bar       { height: 8px; border-radius: 99px; transition: width .6s ease; }
.ae-dim-score     { font-size: 14px; font-weight: 700; min-width: 36px; text-align: right; }
.ae-dim-pill      { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; min-width: 100px; text-align: center; }
.ae-pill-green    { background: var(--ae-green-light); color: var(--ae-green); }
.ae-pill-amber    { background: var(--ae-amber-light); color: var(--ae-amber); }
.ae-pill-red      { background: var(--ae-red-light);   color: var(--ae-red); }

/* ── CLASSIFICATION ── */
.ae-clasif-global {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); margin-bottom: 1.25rem; overflow: hidden;
}
.ae-clasif-global-header {
  padding: 1rem 1.5rem; background: var(--ae-surface-alt);
  border-bottom: 1px solid var(--ae-border); font-weight: 700; font-size: 14px;
}
.ae-clasif-table { width: 100%; border-collapse: collapse; }
.ae-clasif-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ae-muted); background: var(--ae-surface-alt);
  padding: .65rem 1.25rem; border: none; border-bottom: 1px solid var(--ae-border); text-align: left;
}
.ae-clasif-table td {
  padding: .9rem 1.25rem; font-size: 13.5px;
  border: none; border-bottom: 1px solid var(--ae-border);
  vertical-align: top; line-height: 1.55; background: var(--ae-surface);
}
.ae-clasif-table tr:last-child td { border-bottom: none; }
.ae-clasif-table tr.ae-active-row td { background: var(--ae-primary-light); font-weight: 500; }
.ae-clasif-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 4px 12px;
  border-radius: 99px; white-space: nowrap;
}
.ae-clasif-solido { background: var(--ae-green-light); color: var(--ae-green); }
.ae-clasif-desa   { background: var(--ae-amber-light); color: var(--ae-amber); }
.ae-clasif-vulner { background: var(--ae-red-light);   color: var(--ae-red); }

/* ── RECOMMENDATIONS ── */
.ae-rec-section {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); margin-bottom: 1.25rem; overflow: hidden;
}
.ae-rec-section-header {
  padding: 1rem 1.5rem; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--ae-border);
  background: var(--ae-primary-light); color: var(--ae-primary);
}
.ae-rec-item              { border-bottom: 1px solid var(--ae-border); }
.ae-rec-item:last-child   { border-bottom: none; }
.ae-rec-item-head {
  display: flex; align-items: center; gap: 12px;
  padding: 1rem 1.5rem; background: var(--ae-primary-light);
  border-bottom: 1px solid var(--ae-primary-border);
}
.ae-rec-dim-tag {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; background: var(--ae-primary-soft); color: var(--ae-primary-bright);
  border: 1px solid var(--ae-primary-mid); white-space: nowrap;
}
.ae-rec-dim-name { font-weight: 700; font-size: 14px; color: var(--ae-primary-deep); }
.ae-rec-body     { padding: 1rem 1.5rem; font-size: 13.5px; line-height: 1.7; color: var(--ae-ink-soft); }
.ae-rec-interp   { font-style: italic; color: var(--ae-primary-bright); font-size: 13px; margin-bottom: .6rem; }

/* ── ESTADO RESULTS ── */
.ae-estado-results {
  background: var(--ae-surface); border: 1px solid var(--ae-border);
  border-radius: var(--ae-radius); overflow: hidden; margin-bottom: 1.25rem;
}
.ae-estado-results-header {
  padding: 1rem 1.5rem; background: var(--ae-surface-alt);
  border-bottom: 1px solid var(--ae-border); font-weight: 700; font-size: 14px;
}
.ae-estado-result-row {
  display: flex; align-items: center; padding: .8rem 1.5rem;
  border-bottom: 1px solid var(--ae-border); gap: 1rem;
}
.ae-estado-result-row:last-child { border-bottom: none; }
.ae-er-name   { font-size: 14px; flex: 1; }
.ae-er-status { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; }
.ae-er-no     { background: var(--ae-red-light);   color: var(--ae-red); }
.ae-er-en     { background: var(--ae-amber-light); color: var(--ae-amber); }
.ae-er-def    { background: var(--ae-green-light); color: var(--ae-green); }

/* ── REPORTS FORM CARD ── */
.ae-reports-card {
  background: var(--ae-surface); border: 2px solid var(--ae-cta);
  border-radius: var(--ae-radius); overflow: hidden; margin-bottom: 1.5rem;
}
.ae-reports-card-header {
  padding: 1.25rem 1.5rem; background: var(--ae-cta-light);
  border-bottom: 1px solid var(--ae-cta-border);
}
.ae-reports-card-header h3 { font-size: 16px; font-weight: 700; color: var(--ae-ink); margin-bottom: 2px; }
.ae-reports-card-header p  { font-size: 13px; color: var(--ae-muted); }
.ae-reports-form           { padding: 1.5rem; }

.ae-form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.ae-form-group  { display: flex; flex-direction: column; gap: 6px; }
.ae-form-group label { font-size: 13px; font-weight: 600; color: var(--ae-ink); }
.ae-form-group input {
  padding: .65rem .85rem; border: 1.5px solid var(--ae-border);
  border-radius: var(--ae-radius-sm); font-family: 'Urbanist', sans-serif;
  font-size: 14px; color: var(--ae-ink); background: var(--ae-paper);
  transition: border-color .15s;
}
.ae-form-group input:focus { outline: none; border-color: var(--ae-primary); background: var(--ae-surface); }
.ae-req { color: var(--ae-red); }

.ae-form-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 1rem 0; color: var(--ae-muted); font-size: 12px;
}
.ae-form-divider::before, .ae-form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--ae-border);
}

.ae-reports-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.ae-reports-note    { font-size: 12px; color: var(--ae-muted); margin-top: .75rem; }

/* ── NOTICES ── */
.ae-notice          { border-radius: var(--ae-radius-sm); padding: .85rem 1.1rem; font-size: 14px; margin-bottom: 1rem; }
.ae-notice--warning { background: var(--ae-amber-light);  border: 1px solid var(--ae-amber-border); color: var(--ae-amber-deep); }
.ae-notice--error   { background: var(--ae-red-light);    border: 1px solid var(--ae-red-border);   color: var(--ae-red-deep); }
.ae-notice--success { background: var(--ae-green-light);  border: 1px solid var(--ae-green-border); color: var(--ae-green-deep); }
.ae-notice--info    { background: var(--ae-primary-light);border: 1px solid var(--ae-primary-mid);  color: var(--ae-primary-deep); }

/* ── SPINNER ── */
.ae-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--ae-on-dark-track); border-top-color: var(--ae-surface);
  border-radius: 50%; animation: ae-spin .7s linear infinite; flex-shrink: 0;
}
.ae-spinner--dark { border-color: var(--ae-on-light-track); border-top-color: var(--ae-primary); }
@keyframes ae-spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .ae-progress-inner  { flex-direction: column; gap: .75rem; align-items: flex-start; width: fit-content; margin: auto;}
  .ae-step-line       { display: none; }
  .ae-metrics-row     { grid-template-columns: 1fr; }
  .ae-charts-row      { grid-template-columns: 1fr; }
  .ae-form-row        { grid-template-columns: 1fr; }
  .ae-question-row    { grid-template-columns: 1fr; gap: .75rem; }
  .ae-star-group      { justify-content: flex-start; }
  .ae-dim-name        { min-width: 120px; }
  .ae-reports-actions { flex-direction: column; }
  .ae-btn             { justify-content: center; }
  .ae-results-hero    { flex-direction: column; gap: 1rem; }
  .ae-profile-badge   { margin-left: 0; width: 100%; }
}
