/* =========================================================
   AppMFSolutions Corporate — Design System
   Premium tech · Light / Dark · CSS variables
   ========================================================= */

:root {
  /* Brand */
  --brand-50: #eef4ff;
  --brand-100: #d9e6ff;
  --brand-200: #bcd3ff;
  --brand-300: #8eb5ff;
  --brand-400: #598cff;
  --brand-500: #3366f5;
  --brand-600: #1f48e8;
  --brand-700: #1a38d5;
  --brand-800: #1c30ad;
  --brand-900: #1c2e88;

  --accent-primary: #3366f5;
  --accent-aura: #7c5cff;
  --accent-education: #3b82f6;
  --accent-health: #14b8a6;
  --accent-government: #6366f1;
  --accent-business: #0ea5e9;

  /* Surfaces — Light */
  --bg-base: #f6f8fc;
  --bg-elevated: #ffffff;
  --bg-muted: #eef2f8;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-hero: radial-gradient(1200px 600px at 10% -10%, rgba(51, 102, 245, 0.12), transparent 55%),
             radial-gradient(900px 500px at 90% 10%, rgba(124, 92, 255, 0.10), transparent 50%),
             linear-gradient(180deg, #f8faff 0%, #f1f5fb 100%);
  --bg-section-alt: #eef3fb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 1px rgba(51, 102, 245, 0.12), 0 12px 40px rgba(51, 102, 245, 0.15);

  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-border: rgba(15, 23, 42, 0.08);
  --footer-bg: #0b1220;
  --footer-text: #cbd5e1;

  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  --font-sans: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", "Inter", system-ui, sans-serif;

  --container: 1160px;
  --nav-height: 4.25rem;
  --transition: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 420ms cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg-base: #070b14;
  --bg-elevated: #0e1524;
  --bg-muted: #121a2b;
  --bg-glass: rgba(14, 21, 36, 0.78);
  --bg-hero: radial-gradient(1100px 560px at 12% -8%, rgba(51, 102, 245, 0.22), transparent 55%),
             radial-gradient(900px 480px at 88% 0%, rgba(124, 92, 255, 0.18), transparent 50%),
             linear-gradient(180deg, #070b14 0%, #0a101c 100%);
  --bg-section-alt: #0b1220;

  --text-primary: #eef2ff;
  --text-secondary: #b6c2d6;
  --text-muted: #8b9bb3;
  --text-inverse: #0b1220;

  --border-subtle: rgba(226, 232, 240, 0.08);
  --border-strong: rgba(226, 232, 240, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(89, 140, 255, 0.18), 0 16px 48px rgba(51, 102, 245, 0.22);

  --nav-bg: rgba(8, 12, 22, 0.82);
  --nav-border: rgba(226, 232, 240, 0.08);
  --footer-bg: #05080f;
  --footer-text: #94a3b8;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg-base: #070b14;
    --bg-elevated: #0e1524;
    --bg-muted: #121a2b;
    --bg-glass: rgba(14, 21, 36, 0.78);
    --bg-hero: radial-gradient(1100px 560px at 12% -8%, rgba(51, 102, 245, 0.22), transparent 55%),
               radial-gradient(900px 480px at 88% 0%, rgba(124, 92, 255, 0.18), transparent 50%),
               linear-gradient(180deg, #070b14 0%, #0a101c 100%);
    --bg-section-alt: #0b1220;
    --text-primary: #eef2ff;
    --text-secondary: #b6c2d6;
    --text-muted: #8b9bb3;
    --text-inverse: #0b1220;
    --border-subtle: rgba(226, 232, 240, 0.08);
    --border-strong: rgba(226, 232, 240, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 1px rgba(89, 140, 255, 0.18), 0 16px 48px rgba(51, 102, 245, 0.22);
    --nav-bg: rgba(8, 12, 22, 0.82);
    --nav-border: rgba(226, 232, 240, 0.08);
    --footer-bg: #05080f;
    --footer-text: #94a3b8;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--brand-400);
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10000;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

/* Layout helpers */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding: clamp(3.5rem, 6vw, 6rem) 0;
}

.section-alt {
  background: var(--bg-section-alt);
}

.section-header {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin: 0 0 0.75rem;
}

.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-aura));
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); font-weight: 650; }
h4 { font-size: 1.05rem; font-weight: 650; }

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.muted {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: 0 8px 22px rgba(31, 72, 232, 0.28);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 72, 232, 0.38);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-body {
  padding: 1.5rem;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
}

/* Grid helpers */
.grid-2 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-auto {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Forms */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(51, 102, 245, 0.18);
}

.form-field .validation-message,
.validation-summary {
  color: #dc2626;
  font-size: 0.85rem;
}

html[data-theme="dark"] .form-field .validation-message,
html[data-theme="dark"] .validation-summary {
  color: #f87171;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-field input {
  margin-top: 0.25rem;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Alerts */
.alert {
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}

html[data-theme="dark"] .alert-success {
  color: #6ee7b7;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

html[data-theme="dark"] .alert-error {
  color: #fca5a5;
}

/* Page hero (inner pages) */
.page-hero {
  padding: calc(var(--nav-height) + 3rem) 0 3rem;
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero .lead {
  max-width: 40rem;
}

/* Tags / chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Sector accents */
.sector-education { --sector-accent: var(--accent-education); }
.sector-health { --sector-accent: var(--accent-health); }
.sector-government { --sector-accent: var(--accent-government); }
.sector-business { --sector-accent: var(--accent-business); }

/* Utility */
.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; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
