/* ==========================================================================
   COOPMONEY - REGISTRO DE COOPERATIVAS (Estilo Premium Fintech)
   ========================================================================== */

:root {
  --reg-primary: #1F7C54;
  --reg-primary-hover: #166040;
  --reg-primary-light: #E8F5EE;
  --reg-primary-glow: rgba(31, 124, 84, 0.18);
  --reg-secondary: #0A3A2A;
  --reg-dark: #0f172a;
  --reg-muted: #64748b;
  --reg-light-muted: #94a3b8;
  --reg-bg: #f8fafc;
  --reg-surface: #ffffff;
  --reg-border: #e2e8f0;
  --reg-border-focus: #1F7C54;
  --reg-card-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  --reg-radius: 16px;
  --reg-radius-sm: 10px;
}

/* Layout General */
body.registro-layout {
  background-color: var(--reg-bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(31, 124, 84, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(10, 58, 42, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--reg-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Barra Superior / Header */
.reg-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.reg-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.reg-nav-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.reg-brand-meta {
  display: flex;
  flex-direction: column;
}

.reg-brand-sub {
  font-size: 0.75rem;
  color: var(--reg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.reg-brand-title {
  font-size: 1.25rem;
  color: var(--reg-primary);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.reg-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reg-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  color: var(--reg-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.reg-btn-ghost:hover {
  color: var(--reg-dark);
  background-color: rgba(226, 232, 240, 0.5);
  border-color: var(--reg-border);
}

.reg-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  color: var(--reg-primary);
  background-color: var(--reg-primary-light);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(31, 124, 84, 0.2);
}

.reg-btn-login:hover {
  background-color: #d1ecde;
  color: var(--reg-primary-hover);
  transform: translateY(-1px);
}

/* Contenedor Principal */
.registro-main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 3rem 1.25rem;
}

.registro-container {
  background: var(--reg-surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--reg-radius);
  box-shadow: var(--reg-card-shadow);
  width: 100%;
  max-width: 820px;
  padding: 2.5rem;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Encabezado del Formulario */
.reg-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.reg-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--reg-primary-light);
  color: var(--reg-primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.reg-main-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--reg-secondary);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.reg-main-desc {
  font-size: 0.95rem;
  color: var(--reg-muted);
  margin: 0 auto;
  max-width: 520px;
  line-height: 1.5;
}

/* Barra de Pasos / Stepper */
.reg-stepper-container {
  margin-bottom: 2.25rem;
  position: relative;
}

.reg-stepper-track {
  position: absolute;
  top: 18px;
  left: 35px;
  right: 35px;
  height: 3px;
  background-color: var(--reg-border);
  z-index: 1;
}

.reg-stepper-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--reg-primary) 0%, #2bae76 100%);
  transition: width 0.35s ease;
}

.reg-stepper-steps {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
}

.reg-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: transform 0.2s ease;
  user-select: none;
}

.reg-step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--reg-surface);
  border: 2px solid var(--reg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--reg-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.reg-step-item.active .reg-step-circle {
  border-color: var(--reg-primary);
  background-color: var(--reg-primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--reg-primary-glow);
}

.reg-step-item.completed .reg-step-circle {
  border-color: var(--reg-primary);
  background-color: var(--reg-primary-light);
  color: var(--reg-primary);
}

.reg-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--reg-muted);
  margin-top: 8px;
  transition: color 0.2s ease;
  text-align: center;
}

.reg-step-item.active .reg-step-label {
  color: var(--reg-primary);
  font-weight: 700;
}

.reg-step-item.completed .reg-step-label {
  color: var(--reg-dark);
}

/* Mensaje informativo / Callout */
.reg-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 1rem 1.25rem;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--reg-radius-sm);
  margin-bottom: 2rem;
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.45;
}

.reg-callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--reg-primary);
}

/* Secciones de Formulario */
.reg-form-step {
  display: none;
  animation: regFadeIn 0.3s ease forwards;
}

.reg-form-step.active {
  display: block;
}

@keyframes regFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reg-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--reg-border);
}

.reg-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--reg-primary-light);
  color: var(--reg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reg-section-icon svg {
  width: 16px;
  height: 16px;
}

.reg-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--reg-secondary);
  margin: 0;
}

.reg-section-subtitle {
  font-size: 0.82rem;
  color: var(--reg-muted);
  margin: 0;
}

/* Cuadrícula de Inputs */
.reg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.reg-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  position: relative;
}

.reg-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reg-label-optional {
  font-size: 0.75rem;
  color: var(--reg-light-muted);
  font-weight: 400;
}

.reg-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.reg-input-icon {
  position: absolute;
  left: 12px;
  color: var(--reg-light-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reg-input-icon svg {
  width: 18px;
  height: 18px;
}

.reg-input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 40px;
  background-color: #ffffff;
  border: 1.5px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  font-size: 0.92rem;
  color: #0f172a;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.reg-input:focus {
  outline: none;
  border-color: var(--reg-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--reg-primary-glow);
}

.reg-input::placeholder {
  color: #94a3b8;
  font-size: 0.88rem;
}

.reg-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

/* Toggle Contraseña */
.reg-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--reg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.reg-toggle-pwd:hover {
  color: var(--reg-dark);
}

.reg-toggle-pwd svg {
  width: 18px;
  height: 18px;
}

/* Errores */
.reg-form-group.has-error .reg-input {
  border-color: #ef4444;
  background-color: #fffbfa;
}

.reg-form-group.has-error .reg-input-icon {
  color: #ef4444;
}

.reg-error-msg {
  display: none;
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 4px;
  font-weight: 500;
}

.reg-form-group.has-error .reg-error-msg {
  display: block;
}

/* Tarjeta Destacada de Credenciales de Acceso */
.reg-credential-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--reg-primary);
  border-radius: var(--reg-radius-sm);
  padding: 1.25rem;
  margin-top: 1rem;
}

.reg-credential-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--reg-secondary);
  margin-bottom: 0.35rem;
}

.reg-credential-hint {
  font-size: 0.8rem;
  color: var(--reg-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Opciones de Líneas de Crédito (Chips/Cards) */
.reg-chip-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 0.35rem;
}

.reg-chip-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1rem;
  background-color: #ffffff;
  border: 1.5px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.reg-chip-label:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.reg-chip-label input[type="checkbox"] {
  accent-color: var(--reg-primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.reg-chip-label.checked {
  border-color: var(--reg-primary);
  background-color: var(--reg-primary-light);
  color: var(--reg-primary-hover);
  font-weight: 600;
}

/* Opciones de Migración (Radio Cards) */
.reg-radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 0.35rem;
}

.reg-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.9rem 1rem;
  background-color: #ffffff;
  border: 1.5px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reg-radio-card:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.reg-radio-card input[type="radio"] {
  accent-color: var(--reg-primary);
  margin-top: 3px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.reg-radio-card.checked {
  border-color: var(--reg-primary);
  background-color: var(--reg-primary-light);
}

.reg-radio-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--reg-dark);
}

.reg-radio-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--reg-muted);
  margin-top: 2px;
}

/* Resumen Ejecutivo (Paso 4) */
.reg-summary-card {
  background: #f8fafc;
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.reg-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.reg-summary-item {
  display: flex;
  flex-direction: column;
}

.reg-summary-item span:first-child {
  font-size: 0.75rem;
  color: var(--reg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.reg-summary-item span:last-child {
  font-size: 0.95rem;
  color: var(--reg-dark);
  font-weight: 700;
  margin-top: 2px;
  word-break: break-all;
}

/* Términos & Condiciones Checkbox */
.reg-terms-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.reg-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.45;
}

.reg-checkbox-label input[type="checkbox"] {
  accent-color: var(--reg-primary);
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.reg-checkbox-label a {
  color: var(--reg-primary);
  text-decoration: underline;
  font-weight: 500;
}

/* Barra de Botones Inferiores */
.reg-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--reg-border);
}

.reg-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.4rem;
  background-color: transparent;
  color: var(--reg-muted);
  border: 1.5px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reg-btn-prev:hover {
  color: var(--reg-dark);
  border-color: #94a3b8;
  background-color: #f1f5f9;
}

.reg-btn-next,
.reg-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.8rem 1.8rem;
  background: linear-gradient(135deg, var(--reg-primary) 0%, #176846 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--reg-radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31, 124, 84, 0.25);
  transition: all 0.2s ease;
}

.reg-btn-next:hover,
.reg-btn-submit:hover {
  background: linear-gradient(135deg, #248f61 0%, #14593b 100%);
  box-shadow: 0 6px 20px rgba(31, 124, 84, 0.35);
  transform: translateY(-1px);
}

/* Alertas */
.alert {
  display: none;
  padding: 0.9rem 1.25rem;
  border-radius: var(--reg-radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.alert.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  border-radius: var(--reg-radius);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.reg-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid #e2e8f0;
  border-top-color: var(--reg-primary);
  border-radius: 50%;
  animation: regSpin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

/* Pantalla de Éxito */
.reg-success-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  animation: regFadeIn 0.4s ease;
}

.reg-success-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background-color: var(--reg-primary-light);
  color: var(--reg-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0 8px rgba(31, 124, 84, 0.08);
}

.reg-success-badge svg {
  width: 36px;
  height: 36px;
}

.reg-success-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--reg-dark);
  margin-bottom: 0.65rem;
}

.reg-success-text {
  font-size: 0.95rem;
  color: var(--reg-muted);
  max-width: 520px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.55;
}

/* Footer Sutil */
.reg-footer-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.84rem;
  color: var(--reg-muted);
}

.reg-footer-note a {
  color: var(--reg-primary);
  font-weight: 600;
  text-decoration: none;
}

.reg-footer-note a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 680px) {
  .registro-container {
    padding: 1.5rem 1.25rem;
  }

  .reg-grid-2 {
    grid-template-columns: 1fr;
  }

  .reg-radio-cards {
    grid-template-columns: 1fr;
  }

  .reg-summary-grid {
    grid-template-columns: 1fr;
  }

  .reg-stepper-steps .reg-step-label {
    display: none;
  }

  .reg-stepper-track {
    left: 20px;
    right: 20px;
  }

  .reg-top-nav {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 10px;
  }
}