/* formulario-publico.css - Estilos del formulario público de afiliación */

* { box-sizing: border-box; }

body {
  background: #f0f4f8;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
}

.fp-wrapper {
  max-width: 860px;
  margin: 30px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  overflow: hidden;
}

/* Encabezado */
.fp-header {
  background: #0056b3;
  color: #fff;
  padding: 22px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.fp-header-text h1 {
  font-family: 'Boldonse', cursive;
  font-size: 2rem;
  margin: 0 0 2px;
  letter-spacing: 1px;
}
.fp-header-text p {
  margin: 0;
  font-size: .9rem;
  opacity: .88;
}
.fp-header img {
  max-height: 70px;
  filter: brightness(0) invert(1);
}

.fp-body { padding: 28px 30px; }

/* Barra de progreso */
.fp-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
}
.fp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fp-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ddd;
  color: #999;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
}
.fp-step.active .fp-step-circle  { background: #0056b3; color: #fff; }
.fp-step.done .fp-step-circle    { background: #28a745; color: #fff; }
.fp-step-label {
  font-size: .72rem;
  color: #888;
  white-space: nowrap;
  transition: color .3s;
}
.fp-step.active .fp-step-label { color: #0056b3; font-weight: 600; }
.fp-step.done  .fp-step-label  { color: #28a745; }
.fp-connector {
  flex: 1;
  height: 4px;
  background: #ddd;
  max-width: 120px;
  margin-bottom: 18px;
  transition: background .3s;
}
.fp-connector.done { background: #28a745; }

/* Sección del formulario */
.fp-section { display: none; }
.fp-section.active { display: block; }

.fp-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0056b3;
  border-bottom: 2px solid #e8f0fe;
  padding-bottom: 8px;
  margin: 22px 0 16px;
}
.fp-section-title i { font-size: 1.2rem; }

/* Grupos de campos flotantes */
.form-group {
  position: relative;
  margin-bottom: 18px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 22px 12px 8px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: .95rem;
  background: #fafafa;
  transition: border-color .2s, background .2s;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #0056b3;
  background: #fff;
  outline: none;
}
.form-group label {
  position: absolute;
  left: 12px;
  top: 14px;
  font-size: .95rem;
  color: #777;
  pointer-events: none;
  transition: all .2s;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:valid + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: 5px;
  font-size: .72rem;
  color: #0056b3;
}
.form-group .error-msg,
.error-msg {
  color: #dc3545;
  font-size: .78rem;
  margin-top: 3px;
  min-height: 16px;
}

/* Asteriscos manejados 100% por JS en formulario-publico.js */
.radio-group-wrapper .radio-title::after {
  content: '';
}
.radio-group-wrapper .radio-title.required::after {
  content: ' *';
  color: #dc3545;
}
.form-group input.is-invalid,
.form-group select.is-invalid { border-color: #dc3545; }

/* Radio buttons sexo */
.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  min-height: 54px;
}
.radio-group label.radio-label {
  position: static;
  font-size: .9rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.radio-group label.radio-label input[type=radio] {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.radio-group-wrapper {
  position: relative;
  margin-bottom: 18px;
}
.radio-group-wrapper > .radio-title {
  position: absolute;
  left: 12px;
  top: 5px;
  font-size: .72rem;
  color: #0056b3;
  pointer-events: none;
  z-index: 1;
}

/* Texto de autorización */
.autorizacion-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: .85rem;
  line-height: 1.6;
  color: #444;
  margin: 20px 0;
  text-align: justify;
}
.autorizacion-box strong { color: #0056b3; }

/* Carta de reglas — bloque de contenido para leer */
.carta-reglas-box {
  border: 1px solid #0056b3;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.carta-reglas-titulo {
  background: #0056b3;
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.carta-reglas-contenido {
  max-height: 340px;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: .85rem;
  line-height: 1.7;
  color: #333;
  background: #f8fbff;
  text-align: justify;
}
.carta-reglas-contenido p { margin: 0 0 10px; }
.carta-reglas-contenido p:last-child { margin-bottom: 0; }

/* Carta de reglas — declaración de aceptación */
.carta-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  font-size: .9rem;
  line-height: 1.7;
  color: #333;
  margin-bottom: 20px;
  text-align: justify;
}
.carta-box .nombre-afiliado {
  font-weight: 700;
  color: #0056b3;
  text-decoration: underline;
}

/* Firma */
/* Checkbox autorización */
.autorizacion-check {
  margin-top: 12px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .9rem;
  color: #333;
  line-height: 1.5;
}
.check-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: #0056b3;
  cursor: pointer;
}

.firma-section {
  margin: 20px 0;
}
.firma-section h6 {
  font-weight: 700;
  color: #444;
  margin-bottom: 10px;
}
.firma-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.firma-tab-btn {
  padding: 6px 16px;
  border: 1.5px solid #0056b3;
  border-radius: 20px;
  background: #fff;
  color: #0056b3;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.firma-tab-btn.active {
  background: #0056b3;
  color: #fff;
}
.firma-canvas-wrap {
  border: 2px dashed #0056b3;
  border-radius: 8px;
  background: #fafeff;
  position: relative;
}
.firma-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 150px;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}
.firma-canvas-controls {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid #e0eaff;
}
.btn-limpiar {
  font-size: .8rem;
  color: #dc3545;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.firma-upload-wrap { display: none; }
.firma-upload-wrap input[type=file] {
  width: 100%;
  padding: 10px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
}
.firma-preview {
  margin-top: 10px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: none;
}

/* Cédula upload */
.cedula-upload-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
  background: #fafafa;
}
.cedula-upload-zone:hover { border-color: #0056b3; }
.cedula-upload-zone i { font-size: 2rem; color: #aaa; display: block; margin-bottom: 8px; }
.cedula-upload-zone p { margin: 0; color: #777; font-size: .88rem; }
.cedula-preview {
  margin-top: 12px;
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: none;
}

/* Botones de navegación */
.fp-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}
.btn-fp-prev {
  padding: 10px 24px;
  border: 1.5px solid #6c757d;
  border-radius: 20px;
  background: #fff;
  color: #6c757d;
  font-size: .95rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-fp-prev:hover { background: #6c757d; color: #fff; }
.btn-fp-next, .btn-fp-submit {
  padding: 10px 28px;
  border: none;
  border-radius: 20px;
  background: #0056b3;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-fp-next:hover, .btn-fp-submit:hover { background: #003e87; }
.btn-fp-submit { background: #28a745; }
.btn-fp-submit:hover { background: #1e7e34; }
.btn-fp-submit:disabled { background: #aaa; cursor: not-allowed; }

/* Loading */
.fp-loading {
  display: none;
  text-align: center;
  padding: 40px;
}
.fp-loading i { font-size: 2.5rem; color: #0056b3; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Éxito */
.fp-success {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.fp-success i { font-size: 4rem; color: #28a745; display: block; margin-bottom: 16px; }
.fp-success h3 { color: #28a745; margin-bottom: 8px; }
.fp-success p { color: #555; }
.btn-nueva-afiliacion {
  margin-top: 20px;
  background: #0056b3;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s;
}
.btn-nueva-afiliacion:hover { background: #004494; }

/* Footer */
.fp-footer {
  background: #f8f9fa;
  border-top: 1px solid #eee;
  padding: 14px 30px;
  text-align: center;
  font-size: .78rem;
  color: #888;
}
.fp-footer a { color: #0056b3; text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
  .fp-wrapper { margin: 0; border-radius: 0; }
  .fp-body { padding: 18px 16px; }
  .fp-header { padding: 16px; flex-direction: column; text-align: center; }
  .fp-header img { max-height: 50px; }
  .fp-connector { max-width: 50px; }
}
