/* =========================================================
   facturar.css - Estilos específicos para el formulario de facturación
   Diseñado con coherencia visual con el landing
   ========================================================= */

/* =========================
   VARIABLES ESPECÍFICAS
========================== */
:root {
  /* Asegurar que tenemos las variables del index.css */
  --form-bg: rgba(255, 255, 255, 0.92);
  --form-border: rgba(67, 97, 238, 0.12);
}

/* =========================
   ESTRUCTURA PRINCIPAL
========================== */
body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;

  /* quitar centrado vertical */
  display: block;

  /* mejor scroll natural */
  padding: 24px 0;
}


.container-main-form {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   TARJETA DEL FORMULARIO
========================== */
.form-card {
  background: var(--pure-white);
  border-radius: var(--radius-modern);
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--form-border);
  overflow: hidden;
  position: relative;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
}

/* =========================
   ENCABEZADO
========================== */
.form-header {
  padding: 40px 40px 20px;
  border-bottom: 1px solid rgba(67, 97, 238, 0.08);
}

.form-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}

.form-subtitle {
  color: var(--stone);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 800px;
}

/* Botón volver */
.btn-back {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-smooth);
  border: 2px solid transparent;
  transition: var(--transition-smooth);
  background: var(--pure-white);
}

.btn-back:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(67, 97, 238, 0.2);
  transform: translateX(-4px);
  text-decoration: none;
}

/* =========================
   CAJA DE AYUDA
========================== */
.hint-box {
  background: linear-gradient(135deg, #fff8e6 0%, #fff0cc 100%);
  border: 2px solid var(--warning);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-top: 25px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hint-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--warning);
}

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

.hint-icon {
  color: var(--warning);
  font-size: 1.2rem;
}

.hint-list {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.hint-list li {
  margin-bottom: 8px;
  color: var(--slate);
  line-height: 1.6;
  position: relative;
  padding-left: 8px;
}

.hint-list li::before {
  content: '→';
  position: absolute;
  left: -15px;
  color: var(--warning);
  font-weight: bold;
}

.hint-list li:last-child {
  margin-bottom: 0;
}

/* =========================
   ALERTAS DE ERROR
========================== */
.alert-error {
  background: rgba(239, 71, 111, 0.1);
  border: 1px solid rgba(239, 71, 111, 0.2);
  color: var(--danger);
  border-radius: var(--radius-smooth);
  padding: 18px 24px;
  margin: 20px 40px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

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

/* =========================
   CONTENIDO DEL FORMULARIO
========================== */
.form-content {
  padding: 30px 40px;
}

/* =========================
   SECCIONES DEL FORMULARIO
========================== */
.form-section {
  margin-bottom: 40px;
  position: relative;
}

.form-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(67, 97, 238, 0.1);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--gradient-primary);
}

.form-section-icon {
  color: var(--primary);
}

.form-section-icon-success {
  color: var(--success);
}

.form-section-icon-accent {
  color: var(--accent);
}

/* =========================
   CAMPOS DEL FORMULARIO
========================== */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.req-star {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9em;
}

/* Inputs y selects */
.form-control, .form-select {
  border: 2px solid rgba(67, 97, 238, 0.15);
  border-radius: var(--radius-smooth);
  padding: 14px 16px;
  font-size: 15px;
  transition: var(--transition-smooth);
  background: var(--pure-white);
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
  transform: translateY(-2px);
  outline: none;
}

.form-control:focus.text-upper {
  letter-spacing: 0.1em;
}

.text-upper {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Select personalizado */
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234361ee' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 12px;
  padding-right: 48px;
}

.form-select:hover {
  border-color: rgba(67, 97, 238, 0.3);
  transform: translateY(-1px);
}

/* =========================
   TEXTO DE AYUDA
========================== */
.form-text {
  color: var(--stone);
  font-size: 0.875rem;
  margin-top: 10px;
  line-height: 1.5;
}

.form-text strong {
  color: var(--ink);
  font-weight: 600;
}

.form-text-item {
  display: block;
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid rgba(67, 97, 238, 0.2);
}

.form-text code {
  background: rgba(67, 97, 238, 0.1);
  border: 1px solid rgba(67, 97, 238, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85em;
  color: var(--primary);
}

/* =========================
   SEPARADORES
========================== */
.form-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.2), transparent);
  margin: 40px 0;
}

/* =========================
   CHECKBOX
========================== */
.form-check-container {
  background: var(--snow);
  padding: 20px;
  border-radius: var(--radius-card);
  margin: 30px 0;
  border: 1px solid rgba(67, 97, 238, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition-smooth);
}

.form-check-container:hover {
  border-color: rgba(67, 97, 238, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(67, 97, 238, 0.3);
  margin-top: 0.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-check-label {
  color: var(--slate);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  flex: 1;
}

.form-check-label strong {
  color: var(--ink);
}

/* =========================
   BOTONES DE ACCIÓN
========================== */
.form-actions {
  padding: 30px 40px;
  border-top: 1px solid rgba(67, 97, 238, 0.08);
  background: var(--snow);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-form-primary {
  background: var(--gradient-primary);
  color: var(--pure-white);
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-smooth);
  font-weight: 700;
  font-size: 16px;
  transition: var(--transition-flowing);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.25);
  min-width: 180px;
  cursor: pointer;
  text-decoration: none;
}

.btn-form-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(67, 97, 238, 0.35);
  color: var(--pure-white);
  text-decoration: none;
}

.btn-form-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.7s ease;
}

.btn-form-primary:hover::before {
  left: 100%;
}

.btn-form-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 16px 32px;
  border-radius: var(--radius-smooth);
  font-weight: 600;
  font-size: 16px;
  transition: var(--transition-flowing);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
  cursor: pointer;
  text-decoration: none;
}

.btn-form-secondary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.15);
  color: var(--primary);
  text-decoration: none;
}

/* =========================
   NOTA FINAL
========================== */
.form-note {
  color: var(--stone);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 25px;
  line-height: 1.6;
  padding: 18px;
  background: var(--pure-white);
  border-radius: var(--radius-card);
  border: 1px solid rgba(67, 97, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.form-note-icon {
  color: var(--warning);
  font-size: 1rem;
}

/* =========================
   ESTADOS DE VALIDACIÓN
========================== */
.is-valid {
  border-color: var(--success) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2306d6a0' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 48px;
}

.is-invalid {
  border-color: var(--danger) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef476f'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef476f' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 48px;
}

/* =========================
   ANIMACIONES
========================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.btn-loading {
  animation: pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* Efecto de spin para ícono de loading */
.fa-spinner {
  animation: spin 1s linear infinite;
}

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

/* =========================
   RESPONSIVE DESIGN
========================== */
@media (max-width: 992px) {
  .container-main-form {
    padding: 0 15px;
  }

  .form-header {
    padding: 30px 25px 20px;
  }

  .form-content {
    padding: 25px;
  }

  .form-actions {
    padding: 25px;
    flex-direction: column;
  }

  .btn-form-primary,
  .btn-form-secondary {
    width: 100%;
    justify-content: center;
  }

  .form-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .form-header {
    padding: 25px 20px 15px;
  }

  .form-content {
    padding: 20px;
  }

  .form-section-title {
    font-size: 1.1rem;
  }

  .hint-box {
    padding: 20px;
  }

  .alert-error {
    margin: 15px 20px;
    padding: 15px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .form-title {
    font-size: 1.4rem;
  }

  .form-subtitle {
    font-size: 1rem;
  }

  .form-header,
  .form-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .btn-form-primary,
  .btn-form-secondary {
    padding: 14px 20px;
    font-size: 15px;
  }

  .hint-box {
    padding: 16px;
  }

  .form-check-container {
    padding: 16px;
  }
}

/* =========================
   EFECTOS DE FOCUS PARA MEJOR UX
========================== */
.form-group.focused .form-label {
  color: var(--primary);
}

.form-group.focused .form-control,
.form-group.focused .form-select {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* =========================
   UTILITARIOS ADICIONALES
========================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   MEJORAS DE ACCESIBILIDAD
========================== */
.form-control:focus-visible,
.form-select:focus-visible,
.btn-form-primary:focus-visible,
.btn-form-secondary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* =========================
   ESTADOS DE DESHABILITADO
========================== */
.form-control:disabled,
.form-select:disabled,
.btn-form-primary:disabled,
.btn-form-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-form-primary:disabled:hover,
.btn-form-secondary:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}
body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;

  /* quitar centrado vertical */
  display: block;

  /* mejor scroll natural */
  padding: 24px 0;
}
