/**
 * CSS Principal - Sistema de Neuropsicología Clínica
 * Paleta de colores calmantes y profesionales para entorno de salud mental
 */

/* ==========================================================================
   VARIABLES CSS
   ========================================================================== */

:root {
  /* Colores principales - Azules suaves y calmantes */
  --color-primary: #4A90A4;          /* Azul principal calmante */
  --color-primary-light: #6BA3B5;    /* Azul claro */
  --color-primary-dark: #2C5F73;     /* Azul oscuro */
  --color-primary-pale: #E8F4F8;     /* Azul muy pálido */
  
  /* Colores secundarios - Verdes y grises calmantes */
  --color-secondary: #7FB069;        /* Verde suave */
  --color-secondary-light: #A3C585;  /* Verde claro */
  --color-secondary-dark: #5A8049;   /* Verde oscuro */
  
  /* Colores neutros - Grises cálidos */
  --color-neutral-50: #FAFBFC;       /* Blanco cálido */
  --color-neutral-100: #F4F6F8;      /* Gris muy claro */
  --color-neutral-200: #E1E5E9;      /* Gris claro */
  --color-neutral-300: #C7CED6;      /* Gris medio-claro */
  --color-neutral-400: #A8B2BC;      /* Gris medio */
  --color-neutral-500: #8B96A1;      /* Gris */
  --color-neutral-600: #6C7682;      /* Gris medio-oscuro */
  --color-neutral-700: #4A5568;      /* Gris oscuro */
  --color-neutral-800: #2D3748;      /* Gris muy oscuro */
  --color-neutral-900: #1A202C;      /* Casi negro */
  
  /* Colores de estado - Suaves y no agresivos */
  --color-success: #68C976;          /* Verde éxito suave */
  --color-success-light: #D4EDDA;    /* Verde éxito claro */
  --color-warning: #F2B94F;          /* Amarillo advertencia suave */
  --color-warning-light: #FFF3CD;    /* Amarillo advertencia claro */
  --color-error: #E85D75;            /* Rojo error suave */
  --color-error-light: #F8D7DA;      /* Rojo error claro */
  --color-info: var(--color-primary-light);
  --color-info-light: var(--color-primary-pale);
  
  /* Tipografía */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
  
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  
  /* Espaciado */
  --spacing-xs: 0.25rem;       /* 4px */
  --spacing-sm: 0.5rem;        /* 8px */
  --spacing-md: 1rem;          /* 16px */
  --spacing-lg: 1.5rem;        /* 24px */
  --spacing-xl: 2rem;          /* 32px */
  --spacing-2xl: 3rem;         /* 48px */
  --spacing-3xl: 4rem;         /* 64px */
  
  /* Bordes y sombras */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 0.75rem;
  --border-radius-2xl: 1rem;
  --border-radius-full: 9999px;
  
  --border-width: 1px;
  --border-color: var(--color-neutral-200);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transiciones */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ==========================================================================
   RESET Y BASE
   ========================================================================== */

* {
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-neutral-700);
  text-align: left;
  background-color: var(--color-neutral-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enlaces */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-neutral-800);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

/* Listas */
ul, ol {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Imágenes */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

/* Visibilidad */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden {
  display: none !important;
}

/* Texto */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.text-light { font-weight: var(--font-weight-light); }
.text-normal { font-weight: var(--font-weight-normal); }
.text-medium { font-weight: var(--font-weight-medium); }
.text-semibold { font-weight: var(--font-weight-semibold); }
.text-bold { font-weight: var(--font-weight-bold); }

/* Colores de texto */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-muted { color: var(--color-neutral-500); }

/* Espaciado */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }
.mr-0 { margin-right: 0; }

.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }
.pr-0 { padding-right: 0; }

/* ==========================================================================
   COMPONENTES BASE
   ========================================================================== */

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-decoration: none;
}

.logo:hover,
.logo:focus {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.logo__text {
  font-size: var(--font-size-xl);
  letter-spacing: -0.025em;
}

.logo--large .logo__text {
  font-size: var(--font-size-3xl);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 0;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Variantes de botones */
.btn--primary {
  color: white;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
  text-decoration: none;
}

.btn--secondary {
  color: var(--color-primary);
  background-color: transparent;
  border-color: var(--color-primary);
}

.btn--secondary:hover:not(:disabled) {
  color: white;
  background-color: var(--color-primary);
  text-decoration: none;
}

.btn--danger {
  color: white;
  background-color: var(--color-error);
  border-color: var(--color-error);
}

.btn--danger:hover:not(:disabled) {
  background-color: #d84460;
  border-color: #d84460;
  color: white;
  text-decoration: none;
}

/* Tamaños de botones */
.btn--small {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
}

.btn--large {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
}

.btn--full {
  width: 100%;
}

/* Loading state */
.btn__loading {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page--loading {
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

/* Hero Section */
.hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.hero__content {
  padding: var(--spacing-2xl);
}

.hero__title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-neutral-800);
  margin-bottom: var(--spacing-md);
}

.hero__subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-neutral-600);
  margin-bottom: var(--spacing-2xl);
  line-height: var(--line-height-relaxed);
}

.hero__actions {
  margin-top: var(--spacing-2xl);
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-primary-pale) 0%, var(--color-neutral-50) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.loading-screen__content {
  text-align: center;
  padding: var(--spacing-2xl);
}

.loading-screen__logo {
  margin-bottom: var(--spacing-xl);
}

.loading-spinner {
  margin: var(--spacing-xl) 0;
}

.loading-spinner__circle {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-neutral-200);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-screen__text {
  color: var(--color-neutral-600);
  font-size: var(--font-size-sm);
  margin: var(--spacing-md) 0 0;
}

/* Error Page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--spacing-xl);
  text-align: center;
}

.error-page__content {
  max-width: 500px;
}

.error-page__title {
  color: var(--color-error);
  margin-bottom: var(--spacing-md);
}

.error-page__message {
  color: var(--color-neutral-600);
  margin-bottom: var(--spacing-xl);
  line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .hero__title {
    font-size: var(--font-size-3xl);
  }
  
  .hero__subtitle {
    font-size: var(--font-size-lg);
  }
  
  .hero__content {
    padding: var(--spacing-xl);
  }
  
  .main-content {
    padding: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: var(--font-size-2xl);
  }
  
  .hero__subtitle {
    font-size: var(--font-size-base);
  }
  
  .btn--large {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }
}