/* ── Variables corporativas ── */
:root {
  --azul:   #2f4f93;
  --dorado: #b08a2c;
  --verde:  #1f7a3d;
  --gris:   #777;
  --fondo:  #f2f2f2;
}

body {
  margin: 0;
  padding: 0;
  background: var(--fondo);
  font-family: Arial, Helvetica, sans-serif;
}

/* ── Header ── */

.page-title {
  color: var(--azul);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
}

.btn-guide {
  background: transparent;
  border: 1.5px solid var(--azul);
  color: var(--azul);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn-guide:hover {
  background: var(--azul);
  color: #fff;
}

.btn-guide.guide-attention {
  animation: guidePulse 1.15s ease-in-out 0s 3;
}

@keyframes guidePulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(47, 79, 147, 0.20);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 0 0 7px rgba(47, 79, 147, 0.07);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(47, 79, 147, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-guide.guide-attention {
    animation: none;
  }
}

/* ── Stepper ── */

.stepper-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

.stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 90px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid #d0d0d0;
  background: #fff;
  color: #bdbdbd;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s, border-color 0.35s, color 0.35s, box-shadow 0.35s;
  user-select: none;
}

.step.active .step-circle {
  border-color: var(--azul);
  background: var(--azul);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(47, 79, 147, 0.13);
}

.step.done .step-circle {
  border-color: var(--verde);
  background: var(--verde);
  color: #fff;
}

.step-label {
  font-size: 11.5px;
  color: #b0b0b0;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.step.active .step-label {
  color: var(--azul);
  font-weight: 700;
}

.step.done .step-label {
  color: var(--verde);
  font-weight: 600;
}

.step-line {
  flex: 1;
  height: 2.5px;
  background: #e0e0e0;
  margin-top: 19px;
  min-width: 40px;
  max-width: 120px;
  transition: background 0.35s;
}

.step-line.done {
  background: var(--verde);
}

/* ── Panel del formulario ── */

.panel {
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel h2 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--azul);
  font-weight: 700;
}

.field {
  margin-bottom: 10px;
}

.mode-switch {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ececec;
}

.mode-switch .form-check-input {
  cursor: pointer;
}

.mode-switch .form-check-label {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2d2d2d;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 2px rgba(47, 79, 147, 0.14);
}

.field textarea {
  resize: vertical;
  min-height: 52px;
}

#iNombre {
  min-height: 44px;
  max-height: 44px;
  resize: none;
  overflow-y: auto;
}

#iNombre.nombre-expandido {
  min-height: 96px;
  max-height: 140px;
}

.field-error {
  display: block;
  min-height: 16px;
  margin-top: 3px;
  font-size: 11px;
  color: #c0392b;
}

.field input.invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.12);
}

/* ── Contadores de caracteres ── */

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #b0b0b0;
  margin-top: 3px;
  transition: color 0.2s;
}

.char-count.warn  { color: var(--dorado); }
.char-count.limit { color: #c0392b; font-weight: 700; }

/* ── Barra de estado ── */

.status {
  font-size: 12.5px;
  line-height: 1.45;
  color: #444;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 10px 10px;
  padding: 10px 16px;
}

/* ── Tarjeta de preview (preview + action-bar como una unidad) ── */

.preview-card {
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  background: #fff;
}

.preview-label {
  font-size: 12.5px;
  color: #777;
  font-weight: 600;
  margin-bottom: 8px;
  padding-top: 10px;
  letter-spacing: 0.02em;
}

.preview-box {
  position: relative;
  width: 100%;
  border-bottom: 1px solid #ebebeb;
  background: #fff;
  overflow: hidden;
}

/* Render interno siempre 1100×310 — escala dinámica vía JS */
#firma {
  position: relative;
  width: 1100px;
  height: 310px;
  overflow: hidden;
  background: transparent;
  transform: scale(0.55);
  transform-origin: top left;
}

#firma img.base {
  width: 1100px;
  height: 310px;
  display: block;
}

/* ── Overlay de datos sobre la imagen de firma ── */

.overlay {
  position: absolute;
  top: 36px;
  left: 590px;
  width: 465px;
  height: 268px;
  box-sizing: border-box;
  font-family: Georgia, "Times New Roman", serif;
  overflow: hidden;
}

.nombre {
  font-size: 25px;
  line-height: 1.08;
  font-weight: 700;
  color: var(--azul);
  margin: 0 0 6px 0;
  max-height: 56px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#firma.direccion-general .nombre {
  max-height: none;
  overflow: visible;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  white-space: normal;
}

.cargo {
  font-size: 24px;
  line-height: 1.08;
  font-weight: 700;
  color: var(--azul);
  margin: 0 0 6px 0;
  max-height: 54px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.unidad {
  font-size: 22px;
  line-height: 1.1;
  color: var(--dorado);
  font-weight: 400;
  margin: 0 0 18px 0;
  white-space: pre-line;
  max-height: 50px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.institucion {
  font-size: 24px;
  line-height: 1.08;
  color: var(--dorado);
  font-weight: 700;
  margin: 0 0 4px 0;
  max-height: 54px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.correo {
  font-size: 22px;
  line-height: 1.1;
  color: var(--dorado);
  font-weight: 400;
  margin: 6px 0 0 0;
  white-space: nowrap;
}

.correo-icon {
  color: #1f1f1f;
  font-style: normal;
  margin-right: 4px;
}

/* ── Ocultar campo institución del formulario ── */

.field-hidden {
  display: none;
}

/* ── Hint informativo de simplificación ── */

.field-hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--dorado);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.field-hint.hint-visible {
  opacity: 1;
}

.field-hint.hint-fade-out {
  opacity: 0;
}

/* ── Action bar (botonera bajo el preview) ── */

.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 16px;
  margin-top: 2px;
  background: #fafafa;
}

.btn-action {
  flex: 1;
  min-width: 140px;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-action:hover  { opacity: 0.87; }
.btn-action:active { opacity: 0.72; transform: scale(0.98); }

.btn-action.accent    { background: var(--verde); }
.btn-action.success   { background: var(--verde); }

.btn-action.outline {
  background: transparent;
  border: 2px solid var(--azul);
  color: var(--azul);
  flex: 0 1 auto;
}

.btn-action.outline:hover {
  background: var(--azul);
  color: #fff;
  opacity: 1;
}

.btn-action:disabled {
  background: #b5b5b5 !important;
  border-color: #b5b5b5 !important;
  color: #f5f5f5 !important;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.btn-action.outline:disabled {
  background: #b5b5b5 !important;
  color: #f5f5f5 !important;
}

.btn-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Override mínimo de Driver.js para armonizar con la paleta ── */
.driver-popover-title {
  color: var(--azul) !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

.driver-popover-description {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.driver-popover-next-btn {
  background: var(--azul) !important;
  border-color: var(--azul) !important;
  color: #fff !important;
  text-shadow: none !important;
}

.driver-popover-next-btn:hover {
  background: #243e75 !important;
  border-color: #243e75 !important;
}
