/* ============================================================
   CRS-PDVS — Base Design System
   Cross River State Pensioners Digital Verification System
   
   Resets, design tokens, typography, layout primitives, and 
   shared utility classes. All values are controlled from here.
   ============================================================ */

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

/* ============================================================
   1. DESIGN TOKENS (Custom Properties)
   ============================================================ */
:root {
  /* --- Primary Palette: Cross River State Navy (drawn from official logo) --- */
  --crs-blue-900: #0d0f4a;   /* Deepest navy */
  --crs-blue-800: #141762;   /* Very dark navy */
  --crs-blue-700: #1a1f7a;   /* Dark navy */
  --crs-blue-600: #000080;   /* Official CRS navy — logo primary */
  --crs-blue-500: #2b35b5;   /* Primary action blue — wing stripe */
  --crs-blue-400: #4a5cc8;
  --crs-blue-300: #7585db;
  --crs-blue-200: #adb8ec;
  --crs-blue-100: #dde2f6;
  --crs-blue-50:  #f0f2fc;

  /* --- Neutral Palette --- */
  --neutral-950: #0d0f12;
  --neutral-900: #1a1d23;
  --neutral-800: #2d3039;
  --neutral-700: #3f434e;
  --neutral-600: #555963;
  --neutral-500: #6e7280;
  --neutral-400: #9095a0;
  --neutral-300: #b4b8c3;
  --neutral-200: #d5d8de;
  --neutral-100: #ecedf0;
  --neutral-50:  #f6f7f8;
  --white:       #ffffff;

  /* --- Accent: Green (Success) --- */
  --green-600: #16794a;
  --green-500: #1a9058;
  --green-100: #d7f2e4;
  --green-50:  #eef9f3;

  /* --- Accent: Amber (Warning / Pending) --- */
  --amber-600: #b45309;
  --amber-500: #d97706;
  --amber-100: #fef3c7;
  --amber-50:  #fffbeb;

  /* --- Accent: Red (Error / Alert) --- */
  --red-600: #b91c1c;
  --red-500: #dc2626;
  --red-100: #fee2e2;
  --red-50:  #fef2f2;

  /* --- Accent: Teal (Info) --- */
  --teal-600: #0d7377;
  --teal-500: #0f9499;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  /* --- Semantic Tokens --- */
  --color-primary:       var(--crs-blue-600);   /* #000080 deep navy */
  --color-primary-hover: var(--crs-blue-700);   /* #1a1f7a */
  --color-primary-action: var(--crs-blue-500);  /* #2b35b5 for CTAs */
  --color-primary-light: var(--crs-blue-50);
  --color-text-primary:  var(--neutral-900);
  --color-text-secondary:var(--neutral-600);
  --color-text-muted:    var(--neutral-400);
  --color-text-inverse:  var(--white);
  --color-surface:       var(--white);
  --color-surface-alt:   var(--neutral-50);
  --color-surface-raised:var(--white);
  --color-border:        var(--neutral-200);
  --color-border-light:  var(--neutral-100);
  --color-success:       var(--green-500);
  --color-warning:       var(--amber-500);
  --color-error:         var(--red-500);
  --color-info:          var(--teal-500);

  /* --- Typography --- */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs:    0.75rem;    /* 12px */
  --font-size-sm:    0.875rem;   /* 14px */
  --font-size-base:  1rem;       /* 16px */
  --font-size-md:    1.125rem;   /* 18px */
  --font-size-lg:    1.25rem;    /* 20px */
  --font-size-xl:    1.5rem;     /* 24px */
  --font-size-2xl:   1.875rem;   /* 30px */
  --font-size-3xl:   2.25rem;    /* 36px */
  --font-size-4xl:   3rem;       /* 48px */
  --font-weight-regular: 400;
  --font-weight-medium:  500;
  --font-weight-semi:    600;
  --font-weight-bold:    700;
  --font-weight-extra:   800;
  --line-height-tight:   1.25;
  --line-height-normal:  1.5;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide:   0.02em;

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

  /* --- Border Radius --- */
  --radius-sm:   0.375rem;   /* 6px */
  --radius-md:   0.5rem;     /* 8px */
  --radius-lg:   0.75rem;    /* 12px */
  --radius-xl:   1rem;       /* 16px */
  --radius-2xl:  1.5rem;     /* 24px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.05);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-Index Scale --- */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-modal:     500;
  --z-overlay:   600;
  --z-toast:     700;
  --z-intro:     1000;

  /* --- Layout Constraints --- */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1200px;
  --container-2xl: 1400px;
  --header-height: 72px;
}


/* ============================================================
   2. CSS RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-surface-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

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

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background-color: var(--crs-blue-100);
  color: var(--crs-blue-900);
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extra);
}

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);
  font-weight: var(--font-weight-semi);
}

h6 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semi);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

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

.font-regular { font-weight: var(--font-weight-regular); }
.font-medium  { font-weight: var(--font-weight-medium); }
.font-semi    { font-weight: var(--font-weight-semi); }
.font-bold    { font-weight: var(--font-weight-bold); }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-blue      { color: var(--color-primary); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }


/* ============================================================
   4. LAYOUT PRIMITIVES
   ============================================================ */

/* Page Container */
.page-container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-container--narrow {
  max-width: var(--container-md);
}

.page-container--wide {
  max-width: var(--container-2xl);
}

/* Flex Utilities */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center   { justify-content: center; }
.justify-between  { justify-content: space-between; }
.justify-end      { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing Utilities */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }
.p-8   { padding: var(--space-8); }
.py-4  { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6  { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8  { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.px-4  { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6  { padding-left: var(--space-6); padding-right: var(--space-6); }

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

/* Display */
.hidden    { display: none; }
.block     { display: block; }
.inline    { display: inline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Main Content Area — pushes footer down */
.main-content {
  min-height: calc(100vh - var(--header-height) - 200px);
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
}


/* ============================================================
   5. RESPONSIVE BREAKPOINTS (Mobile-first)
   ============================================================ */
@media (max-width: 768px) {
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }

  .page-container {
    padding: 0 var(--space-4);
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================
   6. ANIMATIONS (Restrained, functional)
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

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

.animate-fade-in     { animation: fadeIn var(--transition-normal) both; }
.animate-fade-in-up  { animation: fadeInUp var(--transition-slow) both; }
.animate-fade-in-down{ animation: fadeInDown var(--transition-slow) both; }
.animate-scale-in    { animation: scaleIn var(--transition-normal) both; }
.animate-pulse       { animation: pulse 2s infinite; }
.animate-spin        { animation: spin 1s linear infinite; }
