/**
 * Convertidor SACAU — estilos (herramienta interna UCCuyo)
 */
:root {
  --banner: #064a38;
  --inst: #7a1532;
  --inst-dark: #4a0c1f;
  --green: #0d6e4f;
  --surface: #fff;
  --muted: #f4f0f1;
  --text: #1f1418;
  --soft: #5c4f54;
  --ok: #0d6e4f;
  --warn: #9a6700;
  --err: #9b1c2e;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --radius: 10px;
  --shadow: 0 12px 36px rgba(122, 21, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(6, 74, 56, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(122, 21, 50, 0.1), transparent 55%),
    linear-gradient(180deg, #faf7f8 0%, #f0ecee 100%);
  min-height: 100%;
}

a {
  color: var(--green);
}

.topbar {
  background: var(--banner);
  color: #fff;
  font-size: 0.875rem;
  padding: 0.55rem 1.25rem;
  text-align: center;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

header.hero {
  margin-bottom: 1.5rem;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.hero-logo-link {
  flex: 0 0 auto;
  line-height: 0;
}

.hero-logo {
  width: 5.5rem;
  height: 5.5rem;
  display: block;
  border-radius: 50%;
  background: #fff;
}

@media (max-width: 520px) {
  .hero-logo {
    width: 4.25rem;
    height: 4.25rem;
  }
}

.hero-brand-text {
  min-width: 0;
}

.hero-brand-text .hero-kicker {
  margin-bottom: 0.2rem;
}

.hero-kicker {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--inst);
  margin: 0 0 0.35rem;
}

header.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  color: var(--inst-dark);
  margin: 0 0 0.35rem;
  line-height: 1.15;
}

header.hero p {
  margin: 0;
  color: var(--soft);
  max-width: 52rem;
}

.hero-actions {
  margin-top: 0.85rem !important;
}

.hero-actions .btn-instructivo {
  display: inline-flex;
  text-decoration: none;
}

.usage-counter {
  margin-top: 1rem !important;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(122, 21, 50, 0.06);
  border: 1px solid rgba(122, 21, 50, 0.12);
  color: var(--inst-dark);
  max-width: none;
}

.usage-counter__label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--soft);
}

.usage-counter strong {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--inst);
}

.usage-counter__hint {
  font-size: 0.85rem;
  color: var(--soft);
}

#app-resultado .cre-cell {
  font-weight: 700;
  color: var(--inst-dark);
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.cell-cre {
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.cell-cre.cre-delta-up,
.cell-cre.cre-delta-down,
.cre-cell.cre-delta-up,
.cre-cell.cre-delta-down,
.metric .value.cre-delta-up,
.metric .value.cre-delta-down,
#resumenRapido .cre-flash.cre-delta-up,
#resumenRapido .cre-flash.cre-delta-down {
  border-radius: 4px;
  padding: 0.05em 0.2em;
}

.cell-cre.cre-delta-up,
.cell-cre.cre-delta-up strong,
.cre-cell.cre-delta-up,
.metric .value.cre-delta-up,
#resumenRapido .cre-flash.cre-delta-up {
  color: var(--green) !important;
  background: rgba(13, 110, 79, 0.14);
  box-shadow: 0 0 0 1px rgba(13, 110, 79, 0.28);
}

.cell-cre.cre-delta-down,
.cell-cre.cre-delta-down strong,
.cre-cell.cre-delta-down,
.metric .value.cre-delta-down,
#resumenRapido .cre-flash.cre-delta-down {
  color: var(--inst) !important;
  background: rgba(122, 21, 50, 0.16);
  box-shadow: 0 0 0 1px rgba(122, 21, 50, 0.35);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.panel-head h2 {
  margin: 0;
}

a.btn-secondary,
a.btn-primary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 999px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  background: var(--surface);
  border: 1px solid rgba(122, 21, 50, 0.12);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft);
}

.field select,
.field input {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d6ccd0;
  border-radius: 8px;
  background: #fff;
}

.field.grow {
  flex: 1;
  min-width: 14rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

button,
.btn,
.btn-primary,
.btn-secondary {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.panel-asignaturas .panel-head {
  margin-bottom: 0.65rem;
}

.panel-asignaturas .panel-head .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-primary {
  background: var(--inst);
  color: #fff;
}

.btn-primary:hover {
  background: var(--inst-dark);
}

.btn-aula {
  background: var(--green);
  color: #fff;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  margin-right: 0.2rem;
}

.btn-aula:hover {
  background: #095c42;
  color: #fff;
}

.btn-secondary {
  background: #ebe4e7;
  color: var(--inst-dark);
}

.btn-secondary:hover {
  background: #ddd3d7;
}

.btn-instructivo,
a.btn-instructivo {
  background: var(--inst);
  color: #fff;
  border: 1px solid var(--inst);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-instructivo:hover,
a.btn-instructivo:hover {
  background: var(--inst-dark);
  color: #fff;
  border-color: var(--inst-dark);
}

.btn-instructivo.btn-sm,
a.btn-instructivo.btn-sm {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.topbar .btn-instructivo {
  margin-left: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 999px;
  vertical-align: middle;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  border: 1px solid rgba(122, 21, 50, 0.1);
}

.metric .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--soft);
}

.metric .value {
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--inst-dark);
  margin-top: 0.15rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(122, 21, 50, 0.1);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  color: var(--inst-dark);
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checks li {
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--muted);
}

.checks li.ok {
  border-left: 4px solid var(--ok);
}

.checks li.warning {
  border-left: 4px solid var(--warn);
}

.checks li.error {
  border-left: 4px solid var(--err);
}

.table-wrap {
  overflow: auto;
  max-height: 28rem;
  border: 1px solid #e4dce0;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid #eee5e8;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f8f4f5;
  z-index: 1;
  font-size: 0.75rem;
}

td input,
td select {
  font: inherit;
  width: 100%;
  min-width: 4.5rem;
  padding: 0.25rem 0.3rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

td input.narrow {
  min-width: 3.2rem;
  max-width: 4.5rem;
}

.note {
  font-size: 0.9rem;
  color: var(--soft);
  margin: 0.75rem 0 0;
}

footer.site {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e4dce0;
  font-size: 0.85rem;
  color: var(--soft);
}

.loading {
  padding: 2rem;
  text-align: center;
  color: var(--soft);
}

.err-banner {
  background: #fde8ec;
  color: var(--err);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.info-banner {
  background: #e8f5ef;
  color: var(--green);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.progress-banner {
  background: #fff8e8;
  border: 1px solid #e6d3a0;
  color: #6a4b00;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.progress-label {
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.progress-track {
  height: 0.55rem;
  background: #f1e6c8;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9a6700, #c48a12);
  transition: width 0.2s ease;
}

.steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 7rem;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: #ebe4e7;
  color: var(--soft);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.step:hover {
  background: #ddd3d7;
  color: var(--inst-dark);
}

.step.active {
  background: var(--inst);
  color: #fff;
}

.step.active:hover {
  background: var(--inst-dark);
  color: #fff;
}

.step.done:not(.active) {
  background: #e8f2ea;
  color: #1f6b3a;
}

.panel-step[hidden] {
  display: none !important;
}

.panel-step {
  margin-bottom: 1.25rem;
}

.export-bar {
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.export-label {
  font-weight: 600;
  color: var(--inst-dark);
}

.export-hint {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
}

.export-bar.is-ready .export-hint {
  color: var(--ok);
}

.export-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel-step.is-current > .panel:first-child,
.panel-step.is-current > .toolbar:first-child {
  outline: 2px solid rgba(122, 21, 50, 0.25);
  outline-offset: 2px;
}

.empty-row td {
  text-align: center;
  color: var(--soft);
  font-style: italic;
  padding: 1.25rem 0.75rem !important;
}

.legend-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f7f4f5;
  border: 1px solid rgba(122, 21, 50, 0.1);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.legend-areas abbr {
  font-weight: 700;
  color: var(--inst-dark);
  text-decoration: none;
  margin-right: 0.2rem;
}

.biblioteca-panel {
  margin-bottom: 1.25rem;
}

.normativa-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.normativa-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(122, 21, 50, 0.12);
  border-radius: 8px;
  background: #faf7f8;
}

.normativa-list a {
  font-weight: 700;
  color: var(--inst-dark);
  text-decoration: none;
}

.normativa-list a:hover {
  text-decoration: underline;
}

.normativa-list span {
  color: var(--soft);
  font-size: 0.9rem;
}

.muted-sm {
  color: var(--soft);
  font-size: 0.85rem;
}

.anexo-911 .anexo-fields {
  display: grid;
  gap: 0.9rem;
}

.anexo-field label {
  display: block;
  font-weight: 700;
  color: var(--inst-dark);
  margin-bottom: 0.25rem;
}

.anexo-field .ayuda {
  display: block;
  font-size: 0.85rem;
  color: var(--soft);
  margin-bottom: 0.35rem;
}

.anexo-field textarea {
  width: 100%;
  min-height: 11rem;
  resize: vertical;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(122, 21, 50, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.45;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--soft);
  margin-left: 0.35rem;
}

input[type="file"] {
  font: inherit;
  max-width: 100%;
}
