/* Estética ASENF - v3.0 */
.asf-wrap { max-width: 860px; margin: 24px auto; background: #ffffff; border-radius: 18px;
  padding: 26px 24px; box-shadow: 0 20px 50px rgba(11,99,181,.12); border:1px solid #edf2fb; }
.asf-brand { display:flex; align-items:center; gap:16px; margin-bottom:14px; justify-content:center; }
.asf-brand-header { max-height: 90px; width: auto; object-fit: contain; }
.asf-success { background:#e9f9ef; border:1px solid #b7f0c3; color:#146c2e; padding:12px 14px; border-radius:12px; margin-bottom:14px; font-weight:700; }
.asf-title { margin: 8px 0 14px; color: #0b63b5; font-size: 1.55rem; letter-spacing:.2px; text-align: center; }
.asf-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap:16px; }
.asf-field { display:flex; flex-direction:column; }
.asf-field-full { grid-column: 1 / -1; }
.asf-label { font-weight:650; margin-bottom:6px; color:#1e2a3a; display: flex; align-items: center; gap: 4px; }
.asf-label small { font-weight: 400; color: #6b7280; font-size: 0.85em; }
.asf-required { color: #dc2626; font-weight: 700; }
.asf-input, .asf-input[type="file"], .asf-textarea { width:100%; box-sizing: border-box; padding:12px 14px; border:1px solid #dbe3f4;
  border-radius:12px; background:#fbfdff; outline:none; transition: box-shadow .2s, border-color .2s; font-family: inherit; font-size: 1rem; }
.asf-textarea { resize: vertical; min-height: 100px; }
.asf-input:focus, .asf-textarea:focus { border-color:#90c2ff; box-shadow: 0 0 0 4px rgba(11,99,181,.08); }
.asf-hint { color:#5b6b82; font-size:.85rem; margin-top:6px; }
.asf-actions { margin-top:18px; display:flex; gap:12px; flex-wrap:wrap; justify-content: center; }
.asf-btn { padding:11px 16px; border-radius:999px; border:1px solid #c7ddff; background:#fff; cursor:pointer; font-weight:600; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 6px; }
.asf-btn:hover { background: #f0f7ff; border-color: #90c2ff; }
.asf-btn-primary { background:#0b63b5; color:#fff; border-color:#0b63b5; box-shadow:0 8px 18px rgba(11,99,181,.18); }
.asf-btn-primary:hover { background: #094d8c; }
.asf-btn-large { padding: 14px 28px; font-size: 1.05rem; }
.asf-step { display:none; }
.asf-step.active { display:block; }
.asf-legal { background:#f7fbff; border:1px solid #e6f0fb; padding:14px 16px; border-radius:12px; line-height:1.6; }
.asf-firma-block canvas { width:100%; max-width:820px; height:300px; border:1px dashed #9bbcf0; border-radius:12px; background:#fcfeff; }

/* Selfie Tools - Estilo como en las imágenes */
.asf-selfie-tools { display:flex; gap:12px; align-items:center; flex-wrap: wrap; }
.asf-btn-camera { background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); color: white; border: none; padding: 12px 20px; }
.asf-btn-camera:hover { background: linear-gradient(135deg, #db2777 0%, #ec4899 100%); }
.asf-btn-file { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); color: white; border: none; padding: 12px 20px; cursor: pointer; }
.asf-btn-file:hover { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }

.asf-selfie-preview { margin-top: 12px; position: relative; display: inline-block; }
.asf-selfie-preview img { display:block; max-width:200px; border-radius:12px; border:2px solid #0b63b5; }
.asf-btn-remove { position: absolute; top: -8px; right: -8px; background: #dc2626; color: white; border: none; border-radius: 50%; width: 28px; height: 28px; padding: 0; font-size: 14px; cursor: pointer; }
.asf-btn-remove:hover { background: #b91c1c; }

.asf-camera { margin-top:10px; }
#asf-video { width:100%; max-width:480px; border-radius:12px; border:1px solid #e6eefc; }
.asf-msg { margin-top:14px; color:#0b63b5; font-weight:700; text-align: center; }

/* Paso 2 resumen */
.asf-review-data { display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; gap: 15px 20px; background: #f7fbff; border: 1px solid #e6f0fb; padding: 12px 18px; border-radius: 12px; margin-bottom: 16px; }
.asf-review-item { display: flex; align-items: baseline; }
.asf-review-label { font-weight: 600; color: #5b6b82; margin-right: 8px; font-size: 0.9rem; }
#asf-review-nombre, #asf-review-run, #asf-review-fecha { font-weight: 500; color: #1e2a3a; }

/* Firma: bloquear gestos del navegador */
.asf-firma-block canvas {
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Radio buttons group - Estilo como en las imágenes */
.asf-radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.asf-radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #374151;
  background: #fff;
}
.asf-radio-option:hover {
  border-color: #0b63b5;
  background: #f0f7ff;
}
.asf-radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #0b63b5;
  cursor: pointer;
}
.asf-radio-option:has(input:checked) {
  border-color: #0b63b5;
  border-style: solid;
  background: #e0f0ff;
  color: #0b63b5;
}

/* Checkbox group - Estilo como en las imágenes */
.asf-checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.asf-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.asf-checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #374151;
  background: #fff;
}
.asf-checkbox-option:hover {
  border-color: #0b63b5;
  background: #f0f7ff;
}
.asf-checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0b63b5;
  cursor: pointer;
}
.asf-checkbox-option:has(input:checked) {
  border-color: #0b63b5;
  border-style: solid;
  background: #e0f0ff;
  color: #0b63b5;
}

/* Campos de detalle de estudios */
.asf-estudio-detalle {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
  border-left: 4px solid #0b63b5;
  border-radius: 0 12px 12px 0;
  animation: asf-slide-down 0.3s ease-out;
}
.asf-estudio-detalle .asf-input {
  margin-top: 6px;
  background: #fff;
}
.asf-label-small {
  font-weight: 600;
  color: #0b63b5;
  font-size: 0.9rem;
  display: block;
}

@keyframes asf-slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px){
  .asf-grid { grid-template-columns: 1fr; }
  .asf-brand { flex-direction:column; gap:8px; }
  .asf-review-data { flex-direction: column; align-items: flex-start; }
  .asf-radio-group { flex-direction: column; }
  .asf-checkbox-grid { grid-template-columns: 1fr 1fr; }
  .asf-selfie-tools { flex-direction: column; align-items: stretch; }
  .asf-btn-camera, .asf-btn-file { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .asf-btn, .asf-input { transition: none !important; }
}

/* Modal de Procesamiento */
.asf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: asf-modal-fade-in 0.3s ease-out;
}

@keyframes asf-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.asf-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(11, 99, 181, 0.3);
  animation: asf-modal-slide-up 0.4s ease-out;
}

@keyframes asf-modal-slide-up {
  from { 
    opacity: 0;
    transform: translateY(30px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.asf-modal-content h3 {
  color: #0b63b5;
  font-size: 1.5rem;
  margin: 20px 0 10px;
  font-weight: 700;
}

.asf-modal-content p {
  color: #5b6b82;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.asf-spinner {
  border: 4px solid #e6f0fb;
  border-top: 4px solid #0b63b5;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  animation: asf-spin 1s linear infinite;
}

@keyframes asf-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.asf-progress-text {
  background: #f7fbff;
  border: 1px solid #e6f0fb;
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 15px;
}

.asf-progress-text span {
  color: #0b63b5;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
  animation: asf-pulse 1.5s ease-in-out infinite;
}

@keyframes asf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Animación de éxito */
.asf-modal-success {
  animation: asf-success-bounce 0.6s ease-out;
}

@keyframes asf-success-bounce {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.asf-modal-success .asf-spinner {
  display: none;
}

.asf-modal-success h3 {
  color: #146c2e;
  font-size: 1.8rem;
}

.asf-modal-success .asf-success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}
