/* =============================================================
   Abisodata Design System — v1
   Single source of truth for all design tokens.
   No raw hex values, font names, or spacing numbers
   anywhere else in the codebase. Everything references here.
   ============================================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ============================================================
   LIGHT MODE TOKENS (default)
   ============================================================ */
:root {
  /* ---- Brand ---- */
  --c-primary:        #1B3FA0;
  --c-primary-hover:  #142E7A;
  --c-primary-light:  #4F7BFF;
  --c-primary-bg:     #EEF2FF;
  --c-primary-border: #C7D4FB;

  /* ---- Semantic ---- */
  --c-success:        #16A34A;
  --c-success-bg:     #DCFCE7;
  --c-warning:        #D97706;
  --c-warning-bg:     #FEF3C7;
  --c-danger:         #DC2626;
  --c-danger-bg:      #FEE2E2;
  --c-info:           #0284C7;
  --c-info-bg:        #E0F2FE;

  /* ---- Neutrals ---- */
  --c-gray-50:  #F8FAFC;
  --c-gray-100: #F1F5F9;
  --c-gray-200: #E2E8F0;
  --c-gray-300: #CBD5E1;
  --c-gray-400: #94A3B8;
  --c-gray-500: #64748B;
  --c-gray-600: #475569;
  --c-gray-700: #334155;
  --c-gray-800: #1E293B;
  --c-gray-900: #0F172A;

  /* ---- Semantic Surface (flip in dark mode) ---- */
  --c-bg:            #F8FAFC;
  --c-surface:       #FFFFFF;
  --c-surface-alt:   #F1F5F9;
  --c-border:        #E2E8F0;
  --c-border-strong: #CBD5E1;
  --c-text:          #0F172A;
  --c-text-muted:    #64748B;
  --c-text-subtle:   #94A3B8;
  --c-text-inverse:  #FFFFFF;

  /* ---- Gradients ---- */
  --gradient-brand: linear-gradient(135deg, #1B3FA0 0%, #4F7BFF 100%);
  --gradient-hero:  linear-gradient(160deg, #1B3FA0 0%, #2851C9 60%, #4F7BFF 100%);

  /* ---- Typography ---- */
  --font: 'Poppins', sans-serif;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-loose:  1.75;

  /* ---- Spacing ---- */
  --sp-1:  0.25rem;   /*  4px */
  --sp-2:  0.5rem;    /*  8px */
  --sp-3:  0.75rem;   /* 12px */
  --sp-4:  1rem;      /* 16px */
  --sp-5:  1.25rem;   /* 20px */
  --sp-6:  1.5rem;    /* 24px */
  --sp-8:  2rem;      /* 32px */
  --sp-10: 2.5rem;    /* 40px */
  --sp-12: 3rem;      /* 48px */
  --sp-16: 4rem;      /* 64px */
  --sp-20: 5rem;      /* 80px */

  /* ---- Border Radius ---- */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* ---- Shadows (light mode) ---- */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.10);
  --shadow-xl:    0 20px 60px rgba(0,0,0,0.12);
  --shadow-brand: 0 4px 20px rgba(27,63,160,0.30);

  /* ---- Transitions ---- */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.35s ease;

  /* ---- Z-index scale ---- */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-fixed:     300;
  --z-modal-bg:  400;
  --z-modal:     500;
  --z-toast:     600;
}

/* ============================================================
   DARK MODE TOKENS
   Activated by: document.documentElement.dataset.theme = 'dark'
   ============================================================ */
[data-theme="dark"] {
  --c-bg:            #0A0F1E;
  --c-surface:       #111827;
  --c-surface-alt:   #1A2235;
  --c-border:        #1E293B;
  --c-border-strong: #334155;
  --c-text:          #F1F5F9;
  --c-text-muted:    #94A3B8;
  --c-text-subtle:   #64748B;
  --c-text-inverse:  #0F172A;

  --c-primary-bg:     rgba(79, 123, 255, 0.12);
  --c-primary-border: rgba(79, 123, 255, 0.25);

  --c-success-bg: rgba(22,163,74,0.15);
  --c-warning-bg: rgba(217,119,6,0.15);
  --c-danger-bg:  rgba(220,38,38,0.15);
  --c-info-bg:    rgba(2,132,199,0.15);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.30);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.40);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.50);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.60);
}

/* ============================================================
   BASE RESET & GLOBAL DEFAULTS
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--leading-normal);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

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

a:hover {
  color: var(--c-primary-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */

/* Visually hide but keep accessible */
.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;
}

/* Shimmer keyframe (used by .skeleton in components.css) */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spin keyframe (used by .btn-loading) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade + slide up (modals) */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

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

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

/* Countdown ring */
@keyframes countdownRing {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 100; }
}
