/* ===================================
   PROPULSE - Unified Design System
   Variables + Reset + Base Typography
   Navy / White / Gold — 60-30-10 Theme
   =================================== */

/* -------------------- Fonts -------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* -------------------- CSS Custom Properties -------------------- */
:root {
  /* === Brand Palette — Navy / White / Gold (60-30-10) === */
  /* 60% White */
  --white-pure: #FFFFFF;
  --white-warm: #F8F7F4;
  --white-alt: #F0EDE8;
  /* 30% Navy */
  --navy-900: #0C2340;
  --navy-800: #122C4D;
  --navy-700: #1A3A5C;
  --navy-600: #2D4A6F;
  /* 10% Gold */
  --gold-500: #C9A961;
  --gold-400: #D4AF37;
  --gold-300: #E0C871;
  --gold-100: rgba(201, 169, 97, 0.12);
  --gold-50: rgba(201, 169, 97, 0.08);

  /* Colors - Backgrounds */
  --cream-elegance: #F8F7F4;
  --warm-stone: #E2E8F0;
  --soft-clay: #CBD5E1;

  /* Colors - Brand (Navy) */
  --terracotta-warmth: var(--navy-900);
  --terracotta-dark: var(--navy-800);
  --rich-mahogany: var(--navy-900);
  --mahogany-dark: var(--navy-900);
  --burnt-sienna: var(--navy-900);

  /* Colors - Accents (Gold) */
  --deep-teal: var(--gold-500);
  --deep-teal-light: var(--gold-300);
  --warm-eucalyptus: #10B981;
  --bronze-glow: var(--gold-500);
  --gold-primary: var(--gold-500);
  --bg-secondary: var(--white-alt);
  --text-tertiary: var(--text-muted);

  /* Semantic Colors */
  --color-success: #10B981;
  --color-success-light: rgba(16, 185, 129, 0.1);
  --color-error: #EF4444;
  --color-error-light: rgba(239, 68, 68, 0.1);
  --color-warning: #F59E0B;
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-info: var(--navy-700);
  --color-info-light: rgba(12, 35, 64, 0.1);

  /* Navy Opacity Variants (Navy 900 = 12,35,64) */
  --mahogany-80: rgba(12, 35, 64, 0.8);
  --mahogany-70: rgba(12, 35, 64, 0.7);
  --mahogany-60: rgba(12, 35, 64, 0.6);
  --mahogany-50: rgba(12, 35, 64, 0.5);
  --mahogany-40: rgba(12, 35, 64, 0.4);
  --mahogany-30: rgba(12, 35, 64, 0.3);
  --mahogany-20: rgba(12, 35, 64, 0.2);
  --mahogany-15: rgba(12, 35, 64, 0.15);
  --mahogany-10: rgba(12, 35, 64, 0.1);

  /* Neutral aliases for wizard/form contexts */
  --charcoal: #334155;
  --warm-gray: #94A3B8;
  --surface-subtle: #F1F5F9;

  /* Legacy aliases (referenced by settings-team, acm-wizard) */
  --warm-stone-light: #F8FAFC;
  --cream-15: rgba(255, 255, 255, 0.15);
  --neutral-50: #F8FAFC;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1E293B;
  --neutral-900: #0F172A;

  /* Gold opacity variants */
  --deep-teal-dark: var(--gold-400);
  --deep-teal-10: rgba(201, 169, 97, 0.1);
  --deep-teal-20: rgba(201, 169, 97, 0.2);
  --deep-teal-30: rgba(201, 169, 97, 0.3);

  /* Navy additional variants (Navy 900 = 12,35,64) */
  --terracotta: var(--navy-900);
  --terracotta-40: rgba(12, 35, 64, 0.4);

  /* Accessible Text Colors */
  --text-primary: var(--navy-900);
  --text-secondary: var(--navy-600);
  --text-muted: #94A3B8;

  /* Navy Opacity Variants (Navy 900 = 12,35,64) */
  --terracotta-30: rgba(12, 35, 64, 0.3);
  --terracotta-20: rgba(12, 35, 64, 0.2);
  --terracotta-10: rgba(12, 35, 64, 0.1);

  /* Cream Opacity Variants (rebased to Cream = 248,247,244) */
  --cream-90: rgba(248, 247, 244, 0.9);
  --cream-70: rgba(248, 247, 244, 0.7);
  --cream-60: rgba(248, 247, 244, 0.6);
  --cream-50: rgba(248, 247, 244, 0.5);
  --cream-40: rgba(248, 247, 244, 0.4);
  --cream-10: rgba(248, 247, 244, 0.1);
  --cream-medium: #E2E8F0;

  /* Brand Aliases — Navy/Gold */
  --bg-app: var(--white-warm);
  --bg-surface: var(--white-pure);
  --bg-hover: var(--white-alt);
  --bg-muted: var(--gold-100);
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --brand-primary: var(--navy-900);
  --brand-primary-hover: var(--navy-800);
  --brand-light: var(--gold-100);
  --border-soft: #E2E8F0;
  --shadow-soft: 0 4px 20px rgba(12, 35, 64, 0.05);
  --shadow-hover: 0 8px 30px rgba(12, 35, 64, 0.1), 0 2px 8px rgba(12, 35, 64, 0.04);
  --shadow-card: 0 1px 3px rgba(12, 35, 64, 0.04), 0 4px 16px rgba(12, 35, 64, 0.04);
  --radius-card: 16px;
  --radius-button: 9999px;
  --radius-input: 12px;

  /* Typography — Inter (compact, modern) */
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-accent: 'Inter', system-ui, sans-serif;

  /* Spacing (standard scale) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius (Friendly rounded) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows (Soft UI) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-2xl: 0 10px 25px rgba(15, 23, 42, 0.1);
  --shadow-focus: 0 0 0 4px var(--gold-50);
  --shadow-glow: 0 0 20px rgba(201, 169, 97, 0.15);
  --shadow-teal-glow: 0 0 20px rgba(201, 169, 97, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 400ms ease;

  /* Layout - Landing */
  --container-max: 1440px;
  --container-padding: clamp(20px, 4vw, 40px);
  --section-padding: clamp(60px, 10vw, 120px);
  --navbar-height: 80px;
  --navbar-height-scrolled: 64px;

  /* Layout - Dashboard */
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;
  --topbar-height: 56px;

  /* === COMPACT DENSITY LAYER === */
  --content-padding: 24px 32px;
  --page-header-mb: 20px;
  --card-padding: 20px;
  --card-gap: 16px;
  --row-height: 38px;
  --nav-item-height: 34px;
  --nav-item-padding: 6px 12px;
  --badge-height: 20px;

  /* Compact font scale */
  --font-size-xs: 0.6875rem;    /* 11px */
  --font-size-sm: 0.75rem;      /* 12px */
  --font-size-base: 0.8125rem;  /* 13px */
  --font-size-md: 0.875rem;     /* 14px */
  --font-size-lg: 1rem;         /* 16px */
  --font-size-xl: 1.125rem;     /* 18px */
  --line-height-dense: 1.3;
  --line-height-body: 1.4;

  /* Compact radii */
  --radius-compact: 6px;

  /* Animation tokens */
  --anim-duration-counter: 1200ms;
  --anim-duration-entrance: 300ms;
  --anim-stagger-base: 60ms;
  --anim-easing-decel: ease-out;
  --anim-easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Calendar event colors */
  --event-importante: #EF4444;
  --event-importante-light: rgba(239, 68, 68, 0.1);
  --event-reunion: #0C2340;
  --event-reunion-light: rgba(12, 35, 64, 0.1);
  --event-capacitacion: #10B981;
  --event-capacitacion-light: rgba(16, 185, 129, 0.1);
  --event-otro: #6B7280;
  --event-otro-light: rgba(107, 114, 128, 0.1);
  --event-personal: #8B5CF6;
  --event-personal-light: rgba(139, 92, 246, 0.1);
}

/* -------------------- Reset -------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--rich-mahogany);
  background-color: var(--cream-elegance);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Dashboard form inputs — consistent gold focus ring */
.content-area input[type="text"],
.content-area input[type="email"],
.content-area input[type="tel"],
.content-area input[type="number"],
.content-area input[type="search"],
.content-area input[type="url"],
.content-area select,
.content-area textarea {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.content-area input[type="text"]:focus,
.content-area input[type="email"]:focus,
.content-area input[type="tel"]:focus,
.content-area input[type="number"]:focus,
.content-area input[type="search"]:focus,
.content-area input[type="url"]:focus,
.content-area select:focus,
.content-area textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: var(--shadow-focus);
}

ul, ol {
  list-style: none;
}

/* -------------------- Utilities -------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-cream { color: var(--cream-elegance); }

/* -------------------- Premium Scrollbar -------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* -------------------- Toast Container -------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: 16px 24px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  animation: toastSlideUp 300ms ease-out;
  max-width: 360px;
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error   { border-left: 4px solid var(--color-error); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info    { border-left: 4px solid var(--color-info); }

.toast.removing {
  animation: toastSlideDown 300ms ease-in forwards;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastSlideDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

/* -------------------- Shared Keyframes (Soft UI) -------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 97, 0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(201, 169, 97, 0); }
}

@keyframes successPop {
  0%   { transform: scale(0.8); opacity: 0; }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ripple {
  to { transform: scale(2.5); opacity: 0; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* -------------------- Focus Ring -------------------- */
:focus-visible {
  outline: 2px solid var(--terracotta-warmth);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* -------------------- Accessibility -------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------------------- Mobile Toast -------------------- */
@media (max-width: 767px) {
  #toast-container {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }

  .toast {
    max-width: 100%;
  }
}
