/* =============================================
   Variables
   ============================================= */
:root {
  /* Brand Colors */
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-text: #0B1220; /* deep slate for high contrast */
  --color-primary: #0D2A5A; /* navy blue */
  --color-primary-400: #164784;
  --color-primary-500: #0D2A5A;
  --color-primary-600: #0A234A;
  --color-accent: #FF6A00; /* bright dutch orange */
  --color-accent-400: #FF7A1A;

  /* Semantic */
  --color-success: #1B9D4A;
  --color-warning: #F5A623;
  --color-danger:  #D64545;

  /* Neutral Grays */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1F2937;
  --gray-900: #0B1220;

  /* Gradients (subtle, modern) */
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, #163A72 50%, #1C4D92 100%);
  --gradient-accent: linear-gradient(135deg, #FF6A00 0%, #FF8A33 100%);
  --gradient-soft: linear-gradient(180deg, #ffffff 0%, #F8FAFC 100%);

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-xl: clamp(1.125rem, 1.05rem + 0.6vw, 1.5rem);
  --font-size-2xl: clamp(1.375rem, 1.15rem + 1.2vw, 2rem);
  --font-size-3xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --font-size-4xl: clamp(2rem, 1.5rem + 3vw, 3rem);

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-loose: 1.9;

  /* Spacing scale (0–96px) */
  --space-0: 0px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 64px;
  --space-12: 80px;
  --space-13: 96px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06), 0 1px 1px rgba(2, 6, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(2, 6, 23, 0.10), 0 2px 4px rgba(2, 6, 23, 0.06);
  --shadow-lg: 0 12px 24px rgba(2, 6, 23, 0.14), 0 6px 12px rgba(2, 6, 23, 0.10);

  /* Transitions */
  --transition-fast: 150ms;
  --transition-base: 250ms;
  --transition-slow: 400ms;
  --easing-standard: cubic-bezier(0.2, 0.0, 0.2, 1);
  --easing-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-exit: cubic-bezier(0.7, 0, 0.84, 0);

  /* Layout */
  --container-max: 1200px;
  --focus-ring: 0 0 0 3px rgba(255, 106, 0, 0.45); /* orange focus ring */
}

/* =============================================
   Reset / Normalize
   ============================================= */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }

* { margin: 0; }

html { height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

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

/* Make forms inherit typography */
input, button, textarea, select { font: inherit; color: inherit; }

/* Remove built-in button styles for consistency */
button { background: none; border: 0; padding: 0; cursor: pointer; }

/* Prevent long words from overflowing */
:where(p, h1, h2, h3, h4, h5, h6) { overflow-wrap: break-word; }

/* =============================================
   Base Styles
   ============================================= */
html { color-scheme: light; }

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--gradient-soft);
}

/* Headings: scalable sizes & margin control */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: var(--lh-tight); letter-spacing: -0.01em; color: var(--color-text); }

h1 { font-size: var(--font-size-4xl); margin-block: var(--space-9) var(--space-5); }
h2 { font-size: var(--font-size-3xl); margin-block: var(--space-8) var(--space-4); }
h3 { font-size: var(--font-size-2xl); margin-block: var(--space-7) var(--space-4); }
h4 { font-size: var(--font-size-xl);  margin-block: var(--space-6) var(--space-3); }
h5 { font-size: var(--font-size-lg);  margin-block: var(--space-5) var(--space-3); }
h6 { font-size: var(--font-size-sm);  margin-block: var(--space-4) var(--space-2); }

/* Paragraphs: comfortable line length */
p { max-width: 65ch; margin-block: 0 var(--space-5); }

/* Links: clean, high-contrast */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent); text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }

/* Lists */
ul, ol { padding-inline-start: 1.25rem; margin-block: 0 var(--space-5); }

/* Horizontal rule */
hr { border: 0; height: 1px; background: var(--gray-200); margin-block: var(--space-8); }

/* =============================================
   Utilities
   ============================================= */
/* Container */
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-8); width: 100%; }

/* Flex helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.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; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-7); }
.gap-lg { gap: var(--space-9); }

/* Grid helpers */
.grid { display: grid; gap: var(--space-8); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Cap auto-fit grids to a maximum of 3 columns on wide screens */
@media (min-width: 1000px) {
  .grid-auto { grid-template-columns: repeat(3, 1fr); }
}

/* Screen reader only */
.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; }

/* Soft gradient background utility (for hero/stripes) */
.bg-gradient-primary { background: var(--gradient-primary); color: #fff; }
.bg-gradient-accent { background: var(--gradient-accent); color: #fff; }

/* =============================================
   Components
   ============================================= */
/* Buttons */
.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-400);
  --btn-color: #ffffff;
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0.75rem 1.125rem; /* ~12px 18px */
  min-height: 44px; /* touch target */
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-weight: 600;
  line-height: 1;
  transition: background-color var(--transition-base) var(--easing-standard),
              color var(--transition-base) var(--easing-standard),
              box-shadow var(--transition-fast) var(--easing-standard),
              transform var(--transition-fast) var(--easing-standard);
}

.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-sm); }
.btn[disabled], .btn:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(10%); }

.btn--primary { --btn-bg: var(--color-primary); --btn-bg-hover: var(--color-primary-600); --btn-border: var(--color-primary); }
.btn--accent  { --btn-bg: var(--color-accent);  --btn-bg-hover: var(--color-accent-400); --btn-border: var(--color-accent); }
.btn--ghost   { --btn-bg: transparent; --btn-bg-hover: rgba(13, 42, 90, 0.06); --btn-color: var(--color-primary); --btn-border: var(--gray-300); border-style: solid; }

/* Inputs */
.input, input[type='text'], input[type='email'], input[type='tel'], input[type='number'], input[type='search'], input[type='date'], input[type='time'], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition-fast) var(--easing-standard),
              box-shadow var(--transition-fast) var(--easing-standard),
              background-color var(--transition-fast) var(--easing-standard);
}

input::placeholder, textarea::placeholder { color: var(--gray-500); }

.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

input[disabled], select[disabled], textarea[disabled] { background: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }

/* Cards */
.card {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}
.card:hover { box-shadow: var(--shadow-md); transition: box-shadow var(--transition-base) var(--easing-standard); }

.card-header { margin-bottom: var(--space-5); }
.card-footer { margin-top: var(--space-5); }

/* Tables (basic normalization) */
table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--gray-200); text-align: left; }
th { background: var(--gray-50); font-weight: 600; }

/* Badges (utility component) */
.badge { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.25rem 0.5rem; border-radius: var(--radius-pill); font-size: var(--font-size-sm); line-height: 1; border: 1px solid transparent; }
.badge--success { background: rgba(27, 157, 74, 0.08); color: #136b33; border-color: rgba(27,157,74,0.2); }
.badge--warning { background: rgba(245,166,35,0.08); color: #7a5412; border-color: rgba(245,166,35,0.25); }
.badge--danger  { background: rgba(214,69,69,0.08); color: #8f2e2e; border-color: rgba(214,69,69,0.25); }

/* =============================================
   Accessibility
   ============================================= */
/* Focus visible outlines for keyboard users */
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
