/* Variables de AppHabitat */
:root {
  --primary-color: #0C2B4E;
  --primary-dark: #08213d;
  --primary-light: #1a3f6d;
  --secondary-color: #1A3D64;
  --accent-color: #1D546C;
  --color-bg: #f7f7f7;
  --color-dark: #222;
  --color-light: #fff;
  --text-white: #F4F4F4;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background: var(--primary-color);
    background-image: 
        linear-gradient(rgba(12, 43, 78, 0.7), rgba(12, 43, 78, 0.7)),
        url(https://res.cloudinary.com/dyvn4yyx0/image/upload/v1762639470/jason-dent-w3eFhqXjkZE-unsplash_bakafp.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.registro-container {
  width: 100%;
  max-width: 600px;
  background: var(--color-light);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

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

/* Header */
.registro-header {
  background: var(--secondary-color);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-white);
}

.registro-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.registro-logo img {
  width: 100%;
  object-fit: contain;
}

.registro-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.registro-header p {
  font-size: 1rem;
  opacity: 0.95;
  font-weight: 400;
}

/* Barra de progreso */
.progress-bar-container {
  padding: 2rem 2rem 1.5rem;
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 1rem;
}

.progress-line {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
  z-index: 1;
}

.progress-line-active {
  position: absolute;
  top: 20px;
  left: 0;
  height: 3px;
  background: var(--accent-color);
  z-index: 2;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-light);
  border: 3px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #999;
  transition: all 0.3s ease;
}

.progress-step.active .step-circle {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(29, 84, 108, 0.4);
  transform: scale(1.1);
}

.progress-step.completed .step-circle {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-white);
}

.step-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  text-align: center;
  max-width: 80px;
}

.progress-step.active .step-label {
  color: var(--accent-color);
  font-weight: 600;
}

/* Contenido del formulario */
.registro-content {
  padding: 2.5rem 2rem;
}

.form-step {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.8rem;
  text-align: center;
}

.step-description {
  font-size: 0.95rem;
  color: #666;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.6rem;
}

.form-input {
  width: 100%;
  max-width: 100%;
  padding: 0.95rem 1.2rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(29, 84, 108, 0.1);
}

.form-input.error {
  border-color: #dc3545;
}

/* Estilo específico para inputs de fecha */
.form-input[type="date"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.form-input[type="file"] {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-style: dashed;
  cursor: pointer;
}

.form-input[type="file"]::file-selector-button {
  margin-right: 1rem;
  border: none;
  background: var(--accent-color);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.form-input[type="file"]::file-selector-button:hover {
  background: var(--primary-color);
}

.form-input.file-selected {
  border-color: #28a745;
  background: #f1fbf5;
}

.form-input.file-selected::file-selector-button {
  background: #28a745;
}

.error-message {
  display: none;
  font-size: 0.85rem;
  color: #dc3545;
  margin-top: 0.5rem;
}

.error-message.show {
  display: block;
}

/* Helper text para formularios */
.form-help-text {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.4rem;
  font-style: italic;
}

/* Indicador de campos requeridos */
.required-indicator {
  color: #dc3545;
  margin-left: 0.2rem;
  font-weight: 700;
}

/* Checkbox container */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.checkbox-label {
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-dark);
  margin: 0;
  user-select: none;
}

/* Código input casillas individuales */
.codigo-input-container,
.codigo-email-input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.codigo-digit,
.codigo-email-digit {
  width: 50px;
  height: 60px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Inter', monospace;
  text-transform: uppercase;
  background: var(--color-light);
  -moz-appearance: textfield;
}

/* Ocultar flechas en inputs tipo number */
.codigo-digit::-webkit-outer-spin-button,
.codigo-digit::-webkit-inner-spin-button,
.codigo-email-digit::-webkit-outer-spin-button,
.codigo-email-digit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.codigo-digit:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(29, 84, 108, 0.15);
  transform: scale(1.05);
}

.codigo-digit.filled {
  border-color: var(--accent-color);
  background: rgba(29, 84, 108, 0.05);
}

.codigo-digit.error {
  border-color: #dc3545;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.codigo-separator {
  font-size: 1.5rem;
  font-weight: 700;
  color: #999;
  margin: 0 0.3rem;
}

/* Info box */
.info-box {
  background: rgba(29, 84, 108, 0.08);
  border-left: 4px solid var(--accent-color);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.info-box p {
  font-size: 0.9rem;
  color: var(--color-dark);
  line-height: 1.6;
  margin: 0;
}

.info-box i {
  margin-right: 0.5rem;
  color: var(--accent-color);
}

/* Tarjeta de información del condominio */
.condominio-info-card {
  background: var(--color-light);
  border: 2px solid var(--accent-color);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  box-shadow: 0 4px 15px rgba(29, 84, 108, 0.1);
  transition: all 0.3s ease;
}

.condominio-info-card:hover {
  box-shadow: 0 6px 20px rgba(29, 84, 108, 0.15);
  transform: translateY(-2px);
}

.condominio-icon {
  width: 70px;
  height: 70px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 2rem;
}

.condominio-details {
  flex: 1;
}

.condominio-nombre {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 0.5rem 0;
}

.condominio-direccion {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.condominio-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #28a745;
  font-size: 0.85rem;
  font-weight: 600;
}

.condominio-badge i {
  font-size: 1.8rem;
}

/* Botones */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2rem;
}

.btn {
  padding: 0.95rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  flex: 1;
}

.btn-primary {
  background: var(--secondary-color);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(26, 61, 100, 0.3);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 61, 100, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #666;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.btn-icon {
  margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .registro-container {
    border-radius: 15px;
  }

  .registro-header {
    padding: 2rem 1.5rem;
  }

  .registro-header h1 {
    font-size: 1.5rem;
  }

  .registro-header p {
    font-size: 0.9rem;
  }

  .progress-bar-container {
    padding: 1.5rem 1rem 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    display: flex;
    flex-direction: column;
  }

  .form-row .form-group {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Ajuste para campos de fecha */
  .form-input[type="date"] {
    font-size: 16px;
  }

  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .step-label {
    font-size: 0.7rem;
    max-width: 70px;
  }

  .registro-content {
    padding: 2rem 1.5rem;
  }

  .step-title {

  .codigo-email-input-container {
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .codigo-email-digit {
    width: 36px;
    height: 44px;
    font-size: 1.1rem;
  }
    font-size: 1.3rem;
  }

  .step-description {
    font-size: 0.9rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .codigo-input-container {
    gap: 0.3rem;
  }

  .codigo-digit {
    width: 40px;
    height: 50px;
    font-size: 1.2rem;
  }

  .codigo-separator {
    font-size: 1.2rem;
    margin: 0 0.1rem;
  }

  .condominio-info-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }

  .condominio-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin: 0 auto;
  }

  .condominio-nombre {
    font-size: 1.2rem;
  }

  .condominio-badge {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .registro-header h1 {
    font-size: 1.3rem;
  }

  .step-label {
    font-size: 0.65rem;
    max-width: 60px;
  }

  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .codigo-digit {
    width: 35px;
    height: 45px;
    font-size: 1.1rem;
  }

  .codigo-separator {
    font-size: 1rem;
  }

  /* Ajuste para campos de fecha y otros inputs en móvil */
  .form-input[type="date"] {
    font-size: 16px; /* Previene zoom en iOS */
    padding: 0.75rem 0.8rem;
  }

  .form-group {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  .form-row .form-group {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* Estilos para residentes dinámicos */
.residente-item {
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.residente-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(29, 84, 108, 0.1);
}

.residente-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.residente-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.residente-title i {
  color: var(--accent-color);
}

.btn-eliminar-residente {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.3s ease;
}

.btn-eliminar-residente:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.email-validation-status {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 20px;
  transition: all 0.3s ease;
}

.email-validation-status.validating {
  color: #0dcaf0;
}

.email-validation-status.valid {
  color: #198754;
}

.email-validation-status.invalid {
  color: #dc3545;
}

.email-validation-status i {
  font-size: 0.9rem;
}

/* Animación de aparición de residentes */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.residente-item {
  animation: slideInDown 0.4s ease-out;
}

/* Responsive para residentes */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .residente-item {
    padding: 1rem;
  }

  .residente-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  .btn-eliminar-residente {
    width: 100%;
    justify-content: center;
  }
}

/* Estilos para el resumen (Paso 7) */
.resumen-section {
  margin-bottom: 2rem;
}

.resumen-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.resumen-section-title i {
  color: var(--accent-color);
  font-size: 1.2rem;
}

.resumen-count {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
  margin-left: 0.3rem;
}

.resumen-card {
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.8rem 0;
  border-bottom: 1px solid #e8e8e8;
  gap: 1rem;
}

.resumen-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.resumen-item:first-child {
  padding-top: 0;
}

.resumen-label {
  font-weight: 600;
  color: #555;
  min-width: 140px;
  flex-shrink: 0;
}

.resumen-value {
  color: var(--primary-color);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.resumen-residente-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.resumen-residente-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(29, 84, 108, 0.1);
}

.resumen-residente-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #e8e8e8;
}

.resumen-residente-numero {
  background: var(--accent-color);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

.resumen-residente-nombre {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1rem;
}

.resumen-residente-detalles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.resumen-residente-detalle {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.resumen-residente-detalle-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.resumen-residente-detalle-value {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 500;
}

.resumen-no-residentes {
  text-align: center;
  padding: 2rem;
  color: #999;
  font-style: italic;
}

.resumen-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.resumen-badge.success {
  background: #d4edda;
  color: #155724;
}

.resumen-badge.info {
  background: #cfe2ff;
  color: #084298;
}

/* Responsive para resumen */
@media (max-width: 768px) {
  .resumen-item {
    flex-direction: column;
    gap: 0.3rem;
  }

  .resumen-label {
    min-width: auto;
  }

  .resumen-value {
    text-align: left;
  }

  .resumen-residente-detalles {
    grid-template-columns: 1fr;
  }
}
