/* Modulo autoaprendizaje */

/* --- auto_aprendizaje.css --- */
/* Autoaprendizaje — formulario público */

.autoaprendizaje-page {
  --su-red: #d41316;
  --su-red-dark: #b01013;
  --su-navy: #1f2a44;
  --su-border: #dddddd;
  --su-muted: #6b7280;
  background-image: url("../../img/fondo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.autoaprendizaje-page .hidden {
  display: none !important;
}

.autoaprendizaje-page .rb-public-main {
  padding: 24px 16px 32px;
}

.autoaprendizaje-page .rb-public-inner {
  max-width: 560px;
  margin: 0 auto;
}

.autoaprendizaje-page .rb-public-form-card.section-unified {
  background: #ffffff;
  border: 0;
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-size: 12px;
}

.autoaprendizaje-page .form-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.autoaprendizaje-page .form-group label {
  display: block;
  margin: 0 0 8px 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  color: #111827;
}

.autoaprendizaje-page #formularioAuto .form-group > label {
  font-size: 14px;
  font-weight: 400;
}

.autoaprendizaje-page .label-req {
  color: var(--su-red);
}

.autoaprendizaje-page .row.row-cedula {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.autoaprendizaje-page .form-group input:not([type="radio"]),
.autoaprendizaje-page .form-group select {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--su-border);
  border-radius: 8px;
  font-size: 13px;
  color: #111827;
  background: #fff;
  box-sizing: border-box;
}

.autoaprendizaje-page .form-group input:not([type="radio"]):focus,
.autoaprendizaje-page .form-group select:focus {
  outline: none;
  border-color: var(--su-red);
  box-shadow: 0 0 0 3px rgba(212, 19, 22, 0.12);
}

.autoaprendizaje-page .btn-buscar {
  height: 40px;
  min-width: 118px;
  border: 0;
  border-radius: 8px;
  background: var(--su-red) !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  padding: 0 18px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.autoaprendizaje-page .btn-buscar:hover {
  background: var(--su-red-dark) !important;
}

.autoaprendizaje-page .btn-buscar .fa-magnifying-glass {
  margin-right: 6px;
}

.autoaprendizaje-page .msg-cedula:empty,
.autoaprendizaje-page .empleado-info-card.hidden {
  display: none !important;
}

.autoaprendizaje-page .empleado-info-card {
  margin: 2px 0 2px;
  padding: 12px 14px;
  border: 1px solid #f3c4c5;
  border-left: 4px solid var(--su-red);
  border-radius: 10px;
  background: #fff8f8;
}

.autoaprendizaje-page .empleado-info-inner {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.autoaprendizaje-page .empleado-info-item {
  font-size: 13px;
}

.autoaprendizaje-page .formaciones-public-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.autoaprendizaje-page .btn-header-auto {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--su-navy);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}

.autoaprendizaje-page .btn-header-auto:hover {
  background: #162033;
  color: #fff;
}

.autoaprendizaje-page .rb-public-form-card .ent-page-title {
  margin: 0 0 4px;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--su-red);
  text-align: center;
}

.autoaprendizaje-page .rb-public-form-card .ent-page-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin: 10px auto 0;
  background: #2f6fe4;
  border-radius: 2px;
}

.wrap-formulario-auto {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.formulario-auto-title {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--su-red);
}

.formulario-auto-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.formulario-auto-inner .form-control {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--su-border);
  border-radius: 8px;
}

.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.autoaprendizaje-page .form-group .form-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  min-height: 22px;
  line-height: 1.4;
  margin: 0;
  width: fit-content;
}

.autoaprendizaje-page .form-group .form-radio input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: block;
  accent-color: var(--su-red);
}

.form-control[readonly] {
  background-color: #f5f5f5;
  cursor: default;
}

.form-group-hidden {
  display: none !important;
}

.auto-month-label {
  font-weight: 400 !important;
}

.auto-duracion-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auto-duracion-combo {
  width: 100%;
  max-width: 280px;
}

.formulario-auto-inner .form-control.auto-duracion-input {
  width: 100%;
  min-height: 40px;
  max-width: 100%;
}

.autoaprendizaje-page .btn-final-wrap {
  margin-top: 12px;
  text-align: center;
}

.autoaprendizaje-page .btn-final-wrap .btn-final {
  width: 100%;
  max-width: 280px;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  background: var(--su-red) !important;
  padding: 0 24px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.autoaprendizaje-page .btn-final-wrap .btn-final:hover,
.autoaprendizaje-page .btn-final-wrap .btn-final.is-ready,
.autoaprendizaje-page .btn-final-wrap .btn-final.is-ready:hover {
  background: var(--su-red-dark) !important;
}

.autoaprendizaje-page .btn-final-wrap .btn-final [class^="fa-"] {
  margin-right: 6px;
}

.autoaprendizaje-page .toast-registro-exitoso {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 20px 32px;
  background: #16a34a;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.autoaprendizaje-page .toast-registro-exitoso.toast-registro-exitoso-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Wizard paso a paso ── */
.autoaprendizaje-page .wizard-step {
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.35s ease;
  position: relative;
}

.autoaprendizaje-page .wizard-step-active {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
}

.autoaprendizaje-page .wizard-step-locked {
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.autoaprendizaje-page .wizard-step-done {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
}

.autoaprendizaje-page .step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--su-navy);
  margin-bottom: 10px;
  transition: color 0.3s;
}

.autoaprendizaje-page .step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--su-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.35s;
}

.autoaprendizaje-page .wizard-step-done .step-header,
.autoaprendizaje-page .wizard-step-done .step-tip {
  display: none;
}

.autoaprendizaje-page .step-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #7f1d1d;
  background: #fff5f5;
  border: 1px solid #f9c0c0;
  animation: autoStepTipPulse 0.5s ease;
}

.autoaprendizaje-page .step-tip .fa-circle-info {
  margin-top: 1px;
  flex-shrink: 0;
  color: var(--su-red);
}

@keyframes autoStepTipPulse {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
  .autoaprendizaje-page .rb-public-form-card.section-unified {
    padding: 24px 18px 22px;
  }

  .autoaprendizaje-page .row.row-cedula {
    grid-template-columns: 1fr;
  }

  .autoaprendizaje-page .btn-buscar,
  .autoaprendizaje-page .btn-final-wrap .btn-final {
    width: 100%;
    max-width: none;
  }

  .autoaprendizaje-page .rb-public-form-card .ent-page-title {
    font-size: 28px;
  }
}

/* --- autoaprendizaje admin --- */
body.aa-admin-app.module-app-ui {
  background: var(--dot-surface, #f5f5f5);
  background-image: none;
}

body.aa-admin-app.module-app-ui .admin-layout#adminLayout {
  background: transparent;
  padding: 24px 20px;
}

body.aa-admin-app.module-app-ui #sec_home.section {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 0;
}

body.aa-admin-app .aa-admin-section {
  width: 100%;
}

body.aa-admin-app .aa-msg {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
}

body.aa-admin-app .aa-list-card {
  margin-top: 0;
}

body.aa-admin-app .aa-th-sortable {
  padding: 0;
}

body.aa-admin-app .aa-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

body.aa-admin-app .aa-sort-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.aa-admin-app .aa-sort-link:hover {
  color: var(--dot-brand, #d41316);
  background: rgba(212, 19, 22, 0.06);
}

body.aa-admin-app .aa-sort-link i {
  flex-shrink: 0;
  font-size: 11px;
  color: #94a3b8;
}

body.aa-admin-app .aa-th-sortable.is-sorted .aa-sort-link i {
  color: var(--dot-brand, #d41316);
}

body.aa-admin-app .aa-table-wrap {
  overflow-x: auto;
}

body.aa-admin-app .aa-table {
  min-width: 1100px;
}

body.aa-admin-app .aa-table th,
body.aa-admin-app .aa-table td {
  white-space: nowrap;
}

body.aa-admin-app .aa-table td:nth-child(n+5) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.aa-admin-app .rf-pagination {
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
  background: #fafafa;
}

body.aa-admin-app .rf-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 12px;
  color: #374151;
}

body.aa-admin-app .rf-page-size__select {
  min-height: 34px;
  min-width: 72px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

body.aa-admin-app .rf-page-info {
  font-size: 12px;
  color: #374151;
}

body.aa-admin-app .rf-page-btn {
  min-height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  box-sizing: border-box;
}

body.aa-admin-app .rf-page-btn--icon {
  padding: 0;
  width: 34px;
}

body.aa-admin-app .rf-page-btn:hover:not(.is-disabled) {
  border-color: #e8c1c4;
  background: var(--dot-brand-light, #f4d3d5);
  color: var(--dot-brand, #d41316);
}

body.aa-admin-app .rf-page-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 720px) {
  /* Mantener tabla real con scroll horizontal, no cards apiladas */
  body.aa-admin-app .aa-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.aa-admin-app .aa-table {
    display: table;
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
  }

  body.aa-admin-app .aa-table thead {
    display: table-header-group;
  }

  body.aa-admin-app .aa-table tbody {
    display: table-row-group;
  }

  body.aa-admin-app .aa-table tr {
    display: table-row;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  body.aa-admin-app .aa-table th,
  body.aa-admin-app .aa-table td {
    display: table-cell;
    justify-content: initial;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    padding: 10px 12px;
  }

  body.aa-admin-app .aa-table td::before {
    content: none;
    display: none;
  }

  body.aa-admin-app.module-app-ui {
    padding-bottom: calc(40px + 72px);
  }

  body.aa-admin-app .aa-list-card {
    overflow: visible;
  }

  body.aa-admin-app .rf-pagination {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 40px;
    z-index: 90;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  body.aa-admin-app.module-app-ui {
    padding-bottom: calc(44px + 80px);
  }

  body.aa-admin-app .rf-pagination {
    bottom: 44px;
  }
}

