.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}
.stepper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--borde);
  z-index: 1;
}
.stepper-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
}
.stepper-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--borde);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--gris);
  transition: all 0.3s;
}
.stepper-step.active .stepper-circle { background: var(--azul); border-color: var(--azul); color: #fff; }
.stepper-step.done .stepper-circle { background: var(--verde); border-color: var(--verde); color: #fff; }
.stepper-label { font-size: 0.72rem; font-weight: 600; color: var(--gris); }
.stepper-step.active .stepper-label { color: var(--azul); }
.stepper-step.done .stepper-label { color: var(--verde); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.form-group { margin-bottom: 20px; }
.field-hint { font-size: 0.78rem; color: #888; margin-top: 4px; }

.roblox-search {
  display: flex;
  gap: 10px;
}
.roblox-verify-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
  background: var(--gris-claro);
}
.roblox-verify-card img {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--sombra);
  background: #e0e0e0;
}
.roblox-verify-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--verde);
  font-weight: 700;
  font-size: 0.9rem;
}
.roblox-verify-ok .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--verde); }
.roblox-info p { margin-bottom: 2px; }
.roblox-info .name { font-weight: 800; color: var(--texto); }
.roblox-info .userid { color: var(--gris); font-size: 0.85rem; }

.patrimonio-row {
  display: grid;
  grid-template-columns: 230px 1fr 160px 42px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.patrimonio-row select, .ingreso-row select {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--texto);
}
.patrimonio-total {
  text-align: right;
  background: var(--azul-claro);
  color: var(--azul);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 10px;
}
.row-delete {
  background: #fdecea;
  color: var(--rojo-alt);
  border: 1px solid #f5c6c0;
  border-radius: 6px;
  width: 42px;
  height: 44px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.row-delete:hover { background: var(--rojo-alt); color: #fff; }

.ingreso-row {
  display: grid;
  grid-template-columns: 230px 1fr 160px 42px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.resumen-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.resumen-table th, .resumen-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--borde); font-size: 0.92rem; }
.resumen-table th { background: var(--azul-claro); color: var(--azul-oscuro); }
.resumen-table td.num, .resumen-table th.num { text-align: right; }
.resumen-total {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--azul);
  background: var(--azul-claro);
  padding: 16px 20px;
  border-radius: 8px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
}
.checkbox-veracidad {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fdf3e2;
  border: 1px solid #f2dfbc;
  border-radius: 8px;
  padding: 14px;
  margin-top: 8px;
}
.checkbox-veracidad input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.checkbox-veracidad label { font-size: 0.88rem; color: #5a4008; }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  border-top: 1px solid var(--borde);
  padding-top: 20px;
}
.wizard-nav .btn { min-width: 140px; }

#firma-pad {
  width: 100%;
  height: 200px;
  background: #fff;
  border: 2px dashed var(--borde);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
  display: block;
}
#firma-pad.firmado { border-style: solid; border-color: var(--azul); }
.firma-actions { margin-top: 8px; display: flex; gap: 8px; }

.confirm-box {
  text-align: center;
  padding: 40px 20px;
}
.confirm-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #e8f6ec;
  color: var(--verde);
  font-size: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.confirm-code {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--azul);
  letter-spacing: 1px;
  margin: 16px 0;
  background: var(--azul-claro);
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .stepper-label { display: none; }
  #fuente, .ingreso-row select, .patrimonio-row select {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 38px 12px 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b4f9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    max-width: 100%;
    text-overflow: ellipsis;
  }
  #fuente option { font-size: 0.95rem; }
  .roblox-search { flex-direction: column; }
  .roblox-verify-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .roblox-verify-card img { width: 64px; height: 64px; }
  .ingreso-row, .patrimonio-row { grid-template-columns: 1fr; }
  .row-delete { width: 100%; }
  .wizard-nav { flex-direction: column; }
  .wizard-nav .btn { min-width: 0; width: 100%; }
  .resumen-total { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 1.1rem; }
  .resumen-table { font-size: 0.82rem; }
  .resumen-table th, .resumen-table td { padding: 8px; overflow-wrap: anywhere; }
  .resumen-table th.num { white-space: nowrap; }
  .patrimonio-total { font-size: 1rem; text-align: left; }
  .checkbox-veracidad { padding: 12px; }
  .confirm-code { font-size: 1.05rem; }
}

@media (max-width: 400px) {
  .stepper-circle { width: 32px; height: 32px; font-size: 0.9rem; }
  .wizard-nav .btn { padding: 12px 16px; font-size: 0.88rem; }
  #firma-pad { height: 160px; }
  .ingreso-row, .patrimonio-row { padding: 6px; gap: 6px; }
}