/* ==============================================
   FACTURA.CSS - Estilos específicos para factura.html
   Preisa - Servicios Funerarios
   ============================================== */

/* Fuentes personalizadas */
body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #333;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
}

/* ==============================================
   TOPBAR STYLES
   ============================================== */
.topbar {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-bottom: 2px solid #198754;
}

.topbar small {
  font-weight: 500;
}

.topbar i {
  color: #198754;
}

/* ==============================================
   NAVBAR STYLES
   ============================================== */
.navbar-brand:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.navbar-brand img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: #333 !important;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin: 0 2px;
}

.navbar-nav .nav-link:hover {
  background-color: #f8f9fa;
  color: #198754 !important;
  transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
  background-color: #198754;
  color: white !important;
  font-weight: 600;
}

/* ==============================================
   HERO SECTION
   ============================================== */
.hero-section {
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-section .lead {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-section .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
  border: 2px solid white;
  font-weight: 600;
  padding: 12px 30px;
  transition: all 0.3s ease;
}

.hero-section .btn:hover {
  background-color: white;
  color: #198754;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ==============================================
   FORMULARIO PRINCIPAL
   ============================================== */
.main-card {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: none;
  border-radius: 15px;
  overflow: hidden;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.main-card .card-header {
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  border: none;
  padding: 20px;
}

.main-card .card-header h2 {
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* ==============================================
   ESTILOS DE FORMULARIO
   ============================================== */
.form-label {
  color: #333;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-label i {
  font-size: 1.1rem;
}

.form-control, .form-select {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #198754;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
  transform: translateY(-1px);
}

.form-control:hover, .form-select:hover {
  border-color: #20c997;
}

/* Input Groups */
.input-group-text {
  background-color: #198754;
  color: white;
  border: 2px solid #198754;
  font-weight: 600;
}

/* Textarea específico */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

textarea.form-control::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* ==============================================
   CARDS DE DOCUMENTOS
   ============================================== */
.document-cards .card {
  transition: all 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.document-cards .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(25, 135, 84, 0.2);
}

.document-cards .card-body {
  padding: 20px;
}

.document-cards .form-label {
  color: #198754;
  font-weight: 600;
  margin-bottom: 10px;
}

.document-cards .form-control[type="file"] {
  border: 2px dashed #198754;
  background-color: #f8f9fa;
  padding: 15px;
}

.document-cards .form-control[type="file"]:hover {
  background-color: #e9f7ef;
  border-color: #20c997;
}

.document-cards .form-text {
  font-weight: 500;
  margin-top: 8px;
}

/* ==============================================
   BOTONES PERSONALIZADOS
   ============================================== */
.btn-success {
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  border: none;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(25, 135, 84, 0.4);
  background: linear-gradient(135deg, #157347 0%, #1ea085 100%);
}

.btn-outline-secondary {
  border: 2px solid #6c757d;
  color: #6c757d;
  font-weight: 600;
  padding: 12px 25px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* ==============================================
   ALERTAS PERSONALIZADAS
   ============================================== */
.alert-info {
  background: linear-gradient(135deg, #cff4fc 0%, #b6effb 100%);
  border: 1px solid #0dcaf0;
  border-radius: 10px;
  padding: 15px 20px;
}

.alert-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #198754;
  border-radius: 12px;
  padding: 20px;
}

.alert-light .alert-heading {
  color: #198754;
  font-weight: 600;
}

/* ==============================================
   SEPARADORES
   ============================================== */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  border-radius: 2px;
  opacity: 0.8;
}

/* ==============================================
   FOOTER
   ============================================== */
footer {
  background: linear-gradient(135deg, #212529 0%, #343a40 100%);
  margin-top: 50px;
}

footer a {
  transition: all 0.3s ease;
}

footer a:hover {
  color: #20c997 !important;
  text-decoration: none !important;
}

/* ==============================================
   ANIMACIONES
   ============================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ==============================================
   EFECTOS DE VALIDACIÓN
   ============================================== */
.was-validated .form-control:valid {
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.26 1.26L6.77 4.8l.94.94-3.25 3.25z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid {
  border-color: #dc3545;
  animation: shake 0.5s ease-in-out;
}

.was-validated .form-select:valid {
  border-color: #198754;
}

.was-validated .form-select:invalid {
  border-color: #dc3545;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .main-card .card-body {
    padding: 20px;
  }
  
  .btn-lg {
    padding: 10px 20px;
    font-size: 1rem;
  }
  
  .document-cards .card {
    margin-bottom: 15px;
  }
}

@media (max-width: 576px) {
  .navbar-brand img {
    height: 40px;
  }
  
  .navbar-brand h4 {
    font-size: 1.1rem;
  }
  
  .hero-section .btn {
    padding: 10px 25px;
    font-size: 0.9rem;
  }
  
  .form-control, .form-select {
    padding: 10px 12px;
  }
  
  .d-md-flex .btn {
    margin-bottom: 10px;
    width: 100%;
  }
}

/* ==============================================
   ESTADOS LOADING Y ENVÍO
   ============================================== */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==============================================
   UTILIDADES ADICIONALES
   ============================================== */
.text-success {
  color: #198754 !important;
}

.bg-success {
  background-color: #198754 !important;
}

.border-success {
  border-color: #198754 !important;
}

.shadow-custom {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.rounded-custom {
  border-radius: 15px !important;
}

/* ==============================================
   DARK MODE COMPATIBILITY (FUTURO)
   ============================================== */
@media (prefers-color-scheme: dark) {
  /* Estilos para modo oscuro - implementar si es necesario */
}