/* ─── VARIABLES ADICIONALES ─── */
:root {
  --yellow: #FFD166;
  --red: #D63031;
  --card-bg: rgba(255,255,255,0.7);
  --border-input: rgba(0,0,0,0.12);
}

/* ─── PAGE HEADER ─── */
.page-header {
  padding: 140px 5% 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  pointer-events: none;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-glow);
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 720px;
  margin: 0 auto 20px;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── STEPPER ─── */
.stepper-wrap {
  position: sticky;
  top: 64px;
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 5%;
  margin-bottom: 40px;
}

.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(16.66% + 20px);
  right: calc(16.66% + 20px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--white);
  border: 2px solid var(--border-input);
  color: var(--ink-muted);
  transition: all 0.3s;
}

.step-item.active .step-circle {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.step-item.done .step-circle {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.3;
}

.step-item.active .step-label,
.step-item.done .step-label {
  color: var(--ink);
}

/* ─── MAIN LAYOUT ─── */
.form-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 5% 100px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  position: relative;
  z-index: 1;
}

/* ─── FORM PANELS ─── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 36px;
  margin-bottom: 24px;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title .panel-icon {
  width: 36px; height: 36px;
  background: var(--teal-glow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ─── FORM FIELDS ─── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.full { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.field label .req {
  color: var(--red);
  margin-left: 2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-input);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-glow);
  background: var(--white);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238B94B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  font-size: 0.77rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ─── UPLOAD ZONES ─── */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.upload-zone {
  border: 2px dashed var(--border-input);
  border-radius: 16px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  text-align: center;
  background: var(--surface);
  min-height: 140px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--teal);
  background: rgba(0,196,163,0.05);
}

.upload-zone.has-file {
  border-color: var(--teal);
  background: rgba(0,196,163,0.07);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 44px; height: 44px;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(10,15,30,0.06);
  flex-shrink: 0;
}

.upload-zone.has-file .upload-icon {
  background: var(--teal-glow);
  border-color: var(--teal);
}

.upload-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.upload-sub {
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.upload-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-dark);
  display: none;
}

.upload-zone.has-file .upload-status { display: block; }
.upload-zone.has-file .upload-sub { display: none; }

.upload-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(214,48,49,0.1);
  color: var(--red);
}

.upload-tag.opt {
  background: rgba(139,148,179,0.12);
  color: var(--ink-muted);
}

/* Upload full width */
.upload-zone.full-width {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 100px;
  padding: 20px 24px;
  gap: 16px;
  text-align: left;
}

.upload-zone.full-width .upload-text { flex: 1; }

/* ─── PHOTO GUIDE ─── */
.photo-guide {
  background: rgba(0,196,163,0.06);
  border: 1px solid rgba(0,196,163,0.2);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.photo-guide .guide-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

.photo-guide p {
  font-size: 0.83rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.photo-guide strong { color: var(--ink); }

/* ─── DIVIDER ─── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ─── SIDEBAR ─── */
.sidebar { position: sticky; top: 90px; height: fit-content; }

.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.checklist li .check-icon {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.check-icon.done { background: var(--teal-glow); color: var(--teal-dark); }
.check-icon.pending { background: rgba(139,148,179,0.12); color: var(--ink-muted); }

.progress-bar-wrap {
  margin-bottom: 12px;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: 50px;
  width: 0%;
  transition: width 0.4s ease;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(10,15,30,0.04);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.security-badge svg { flex-shrink: 0; }

.providers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.provider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.provider-item span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.provider-item small {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-left: auto;
}

/* ─── SUBMIT AREA ─── */
.submit-area {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 32px 36px;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  cursor: pointer;
}

.terms-check input[type="checkbox"] {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-input);
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  background: var(--surface);
  transition: all 0.2s;
}

.terms-check input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.terms-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.terms-check span {
  font-size: 0.87rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.terms-check a {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
}

.terms-check a:hover { text-decoration: underline; }

.btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-submit:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
}

.btn-submit:disabled {
  background: var(--ink-muted);
  cursor: not-allowed;
  transform: none;
}

.submit-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ─── ALERT ─── */
.alert {
  background: rgba(255,209,102,0.15);
  border: 1px solid rgba(255,209,102,0.5);
  border-left: 4px solid var(--yellow);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.alert p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.6; }
.alert strong { color: var(--ink); }

/* ─── SUCCESS MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,0.55);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--white);
  border-radius: 28px;
  padding: 52px 48px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: modalIn 0.35s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-success-icon {
  width: 80px; height: 80px;
  background: var(--teal-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 24px;
}

.modal h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
}

.modal p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 28px;
}

.modal-ref {
  display: inline-block;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.btn-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-modal-close:hover {
  background: var(--teal-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* ─── TYPE SELECTOR ─── */
.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
}

.type-option {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 28px 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.type-option:hover {
  border-color: var(--teal);
  background: rgba(0,196,163,0.04);
}

.type-option.selected {
  border-color: var(--teal);
  background: rgba(0,196,163,0.08);
  box-shadow: 0 0 0 4px rgba(0,196,163,0.12);
}

.type-option input[type="radio"] { display: none; }

.type-option-icon { font-size: 2rem; }

.type-option-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.type-option-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ─── CAMERA MODAL ─── */
.cam-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,26,0.82);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.cam-modal-overlay.open { display: flex; }

.cam-modal {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  width: min(520px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cam-modal h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

#camVideo {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 4/3;
  object-fit: cover;
}

#camPreview {
  width: 100%;
  border-radius: 12px;
  display: none;
}

.cam-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-cam {
  flex: 1;
  padding: 12px 16px;
  border-radius: 50px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-cam:active { transform: scale(0.97); }
.btn-cam.primary { background: var(--teal); color: var(--ink); }
.btn-cam.primary:hover { background: var(--teal-dark); color: #fff; }
.btn-cam.secondary { background: var(--surface); color: var(--ink); }
.btn-cam.secondary:hover { background: var(--border); }
.btn-cam.danger { background: #fee2e2; color: #b91c1c; }
.btn-cam.danger:hover { background: #fca5a5; }

/* Selfie zone con dos opciones */
.selfie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.selfie-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.selfie-btn:hover {
  border-color: var(--teal);
  background: rgba(0,196,163,0.05);
  color: var(--ink);
}

.selfie-btn .btn-icon { font-size: 1.6rem; }

#selfie-preview-wrap {
  display: none;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
}

#selfie-preview-wrap img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.selfie-retake {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}

/* ─── CEDULA SCAN FEEDBACK ─── */
.upload-zone.scanning {
  pointer-events: none;
  opacity: 0.75;
}

.scan-badge {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-dark);
}

.scan-badge.visible { display: flex; }

@keyframes spin { to { transform: rotate(360deg); } }

.scan-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--teal);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.scan-result {
  display: none;
  background: rgba(0,196,163,0.08);
  border: 1px solid rgba(0,196,163,0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.scan-result.visible { display: block; }
.scan-result strong { color: var(--ink); }

/* panels that only appear after type is chosen */
.form-panels { display: none; }
.form-panels.visible { display: block; }

/* empresa-only upload zones */
.empresa-only { display: none; }
.empresa-only.visible { display: flex; }
/* panels y form-rows que usan empresa-only necesitan su propio display */
.panel.empresa-only.visible { display: block; }
.form-row.empresa-only.visible { display: grid; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stepper-wrap { overflow-x: auto; padding: 12px 5%; }
}

@media (max-width: 640px) {
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-zone.full-width { flex-direction: column; text-align: center; }
  .panel { padding: 24px 20px; }
  .submit-area { padding: 24px 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  nav ul { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal { padding: 36px 24px; }
}
