/* =========================================
   1. MAIN - Configuración Base y Tipografía
   ========================================= */

/* TRUCO PRO: Escalado fluido para 4K y 8K 
   Esto hace que todo el sitio crezca proporcionalmente en monitores gigantes.
*/
html {
  font-size: 16px; /* Base estándar (Laptops/Monitores FHD) */
  scroll-behavior: smooth;
}

/* Pantallas 2K (QHD) */
@media (min-width: 2560px) {
  html { font-size: 18px; } 
}

/* Pantallas 4K (UHD) */
@media (min-width: 3840px) {
  html { font-size: 22px; } 
}

/* Pantallas 8K y superiores */
@media (min-width: 7680px) {
  html { font-size: 32px; } 
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  background: #fef6eb;
  min-height: 100vh;
  overflow-x: hidden; /* Evita scroll horizontal en móviles */
  -webkit-font-smoothing: antialiased;
  color: #1f2d3d;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Poppins", sans-serif;
  color: #1f2d3d;
  font-weight: 700;
  line-height: 1.2;
}

/* Títulos responsivos: Más pequeños en móvil */
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }

@media (min-width: 1200px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
}

/* =========================================
   2. LAYOUT Y CONTENEDORES
   ========================================= */

/* Transiciones suaves globales */
#main-content {
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 100%; /* Asegura ancho completo */
}

.initial-hidden {
  opacity: 0;
  transform: translateY(20px);
}

/* Contenedor Principal (.content) */
.content {
  width: 100%;
  flex: 1;
  padding: 1rem; /* Móvil: poco padding */
}

@media (min-width: 768px) {
  .content { padding: 2rem; }
}

@media (min-width: 1400px) {
  .content { padding: 3rem; }
}

/* --- DASHBOARD CONTAINER INTELIGENTE --- */
/* Este contenedor reemplaza al .container de Bootstrap para control total */
.dashboard-container {
  width: 100%;
  padding-right: var(--bs-gutter-x, 0.75rem);
  padding-left: var(--bs-gutter-x, 0.75rem);
  margin-right: auto;
  margin-left: auto;
}

/* Breakpoints personalizados para aprovechar pantallas anchas */
@media (min-width: 576px)  { .dashboard-container { max-width: 540px; } }
@media (min-width: 768px)  { .dashboard-container { max-width: 720px; } }
@media (min-width: 992px)  { .dashboard-container { max-width: 960px; } }
@media (min-width: 1200px) { .dashboard-container { max-width: 1140px; } }
@media (min-width: 1400px) { .dashboard-container { max-width: 1320px; } }

/* El "Toque Mágico" para monitores grandes */
@media (min-width: 1600px) { 
  .dashboard-container { max-width: 1520px; } 
}
@media (min-width: 1920px) { 
  .dashboard-container { max-width: 1800px; } 
}

/* =========================================
   3. SISTEMA DE COLUMNAS (GRIDS)
   ========================================= */

.main-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  grid-template-columns: 1fr; /* Móvil: 1 columna */
}

/* Tablet y superior: 2 columnas */
@media (min-width: 992px) {
  .main-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* 4K/8K: Si el contenido lo permite, expandir el grid */
@media (min-width: 3840px) {
  .main-grid {
    gap: 3rem;
  }
}

/* =========================================
   4. COMPONENTES: TARJETAS Y CONTENIDO
   ========================================= */

/* Tarjetas Base */
.card-main {
  background: #fff;
  border-radius: 1rem; /* Responsivo gracias al font-size html */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0,0,0,.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
}

@media (min-width: 992px) {
  .card-body { padding: 2.5rem; }
}

/* Tipografía de contenido */
.content p {
  line-height: 1.7; 
  text-align: justify; 
  margin-bottom: 1.5rem;
  color: #4b5563;
}

.content p:first-of-type {
  font-size: 1.1rem;
  font-weight: 300;
  color: #1f2d3d;
}

@media (min-width: 992px) {
  .content p:first-of-type { font-size: 1.25rem; }
}

/* =========================================
   5. ELEMENTOS ESPECÍFICOS (Login, Logos, UI)
   ========================================= */

/* Logos */
.login-logo {
  height: auto;
  width: 50px; /* Base */
  transition: width 0.3s ease;
}

.cityair-title-icon {
  width: auto;
  height: 6rem; /* Móvil */
}

@media (min-width: 768px) {
  .cityair-title-icon { height: 8rem; }
}
@media (min-width: 1400px) {
  .cityair-title-icon { height: 10rem; }
}

/* Overrides de Bootstrap */
.form-control {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.btn {
  border-radius: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  padding: 0.6rem 1.2rem;
}

.alert {
  border-radius: 0.75rem;
  border: none;
}

/* =========================================
   6. OVERLAY DE CARGA (Loading)
   ========================================= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px); /* Efecto vidrio moderno */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-box {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  text-align: center;
  width: 90%;
  max-width: 320px;
  animation: fadeInPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================
   7. UTILIDADES VISUALES EXTRAS
   ========================================= */
.text-justify { text-align: justify; }
.shadow-soft { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); }
.rounded-4 { border-radius: 1rem !important; }