/* ============================================================
   Q1 SOFTWARE SOLUTIONS — DESIGN SYSTEM
   Derived from brand guidelines and logo colour palette
   ============================================================ */

/* CUSTOM PROPERTIES */
:root {
  /* Colour — derived from Q1 logo */
  --navy:        #0D1F3C;   /* primary trust: nav, headings, footer */
  --navy-dark:   #091629;   /* darker navy for footer bg */
  --navy-mid:    #1A3358;   /* mid navy for section accents */
  --blue:        #1A6FD4;   /* primary action: buttons, links */
  --blue-light:  #2B84F0;   /* hover state */
  --cyan:        #00AEEF;   /* highlight, data flow, infographic connectors */
  --cyan-light:  #E5F7FD;   /* very light cyan tint for backgrounds */
  --green:       #4CAF50;   /* limited accent: positive indicators only */
  --white:       #FFFFFF;
  --grey-50:     #F7F8FA;   /* page section alternate bg */
  --grey-100:    #EAECF0;   /* borders, dividers */
  --grey-200:    #D1D5DB;   /* input borders */
  --grey-400:    #9CA3AF;   /* placeholder text */
  --grey-600:    #4B5563;   /* secondary body copy */
  --grey-800:    #1F2937;   /* primary body copy */
  --body-text:   #2C3E55;   /* dark blue-grey for long-form readability */

  /* Typography */
  --font:        'Inter', 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   'IBM Plex Mono', 'Courier New', monospace;

  /* Type scale */
  --text-xs:     0.75rem;   /* 12px — metadata, labels */
  --text-sm:     0.875rem;  /* 14px — captions, secondary */
  --text-base:   1rem;      /* 16px — body */
  --text-lg:     1.125rem;  /* 18px — lead body */
  --text-xl:     1.25rem;   /* 20px — card headings */
  --text-2xl:    1.5rem;    /* 24px — section subheads */
  --text-3xl:    1.875rem;  /* 30px — section headings */
  --text-4xl:    2.25rem;   /* 36px — page headings */
  --text-5xl:    3rem;      /* 48px — hero */
  --text-6xl:    3.75rem;   /* 60px — hero large */

  /* Font weights */
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Line heights */
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Spacing scale */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --container:    1200px;
  --container-sm: 800px;
  --content-max:  720px;   /* max readable line width */

  /* Border radius */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(9,22,41,0.08), 0 1px 2px rgba(9,22,41,0.06);
  --shadow:     0 4px 12px rgba(9,22,41,0.10), 0 2px 4px rgba(9,22,41,0.06);
  --shadow-lg:  0 10px 30px rgba(9,22,41,0.12), 0 4px 8px rgba(9,22,41,0.08);
  --shadow-xl:  0 20px 60px rgba(9,22,41,0.15);

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --duration:   180ms;
  --duration-lg: 280ms;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--body-text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-light); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--navy);
}
h1 { font-size: clamp(2rem, 5vw, var(--text-6xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
p { max-width: var(--content-max); line-height: var(--leading-relaxed); }
.lead {
  font-size: var(--text-lg);
  color: var(--grey-600);
  line-height: var(--leading-relaxed);
  max-width: 680px;
}

/* LAYOUT */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-sm {
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* SECTION */
.section {
  padding: var(--space-20) 0;
}
.section--lg {
  padding: var(--space-32) 0;
}
.section--sm {
  padding: var(--space-12) 0;
}
.section--alt {
  background: var(--grey-50);
}
.section--navy {
  background: var(--navy);
  color: var(--white);
}
.section--navy h1,
.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: var(--white);
}
.section--navy .lead,
.section--navy p {
  color: rgba(255,255,255,0.8);
}

/* SECTION HEADER */
.section-header {
  margin-bottom: var(--space-12);
}
.section-header--center {
  text-align: center;
}
.section-header--center p,
.section-header--center .lead {
  margin: var(--space-4) auto 0;
}
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--space-3);
}
.section--navy .eyebrow {
  color: var(--cyan);
}

/* GRID */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

/* FLEX */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.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); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue);
}
.btn--primary:hover {
  background: var(--blue-light);
  border-color: var(--blue-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn--secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn--secondary:hover {
  background: var(--navy);
  color: var(--white);
}
.btn--outline-white {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
}
.btn--outline-white:hover {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn--lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}
.btn--sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}
.btn-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}

/* CARDS */
.card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card--flat {
  box-shadow: none;
}
.card--flat:hover {
  box-shadow: var(--shadow);
  transform: none;
}
.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-5);
  color: var(--blue);
}
.card__tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--blue);
  background: rgba(26,111,212,0.08);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card h4 { margin-bottom: var(--space-3); }
.card p { font-size: var(--text-sm); color: var(--grey-600); max-width: none; }

/* ICON CIRCLE */
.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,174,239,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-3);
  border-radius: 100px;
}
.badge--cyan {
  background: rgba(0,174,239,0.12);
  color: #0077B6;
}
.badge--green {
  background: rgba(76,175,80,0.12);
  color: #2E7D32;
}
.badge--blue {
  background: rgba(26,111,212,0.12);
  color: var(--blue);
}

/* DIVIDER */
.divider {
  height: 1px;
  background: var(--grey-100);
  border: none;
  margin: var(--space-8) 0;
}

/* STAT */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat__number {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--navy);
  line-height: 1;
}
.stat__label {
  font-size: var(--text-sm);
  color: var(--grey-600);
  font-weight: var(--weight-medium);
}

/* LINK WITH ARROW */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--blue);
  transition: gap var(--duration) var(--ease);
}
.link-arrow:hover { gap: var(--space-3); color: var(--blue-light); }
.link-arrow svg { width: 16px; height: 16px; flex-shrink: 0; }

/* TAG LIST */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}
.tag-list li {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--grey-600);
  background: var(--grey-50);
  border: 1px solid var(--grey-100);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

/* BREADCRUMB */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--grey-400);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--grey-600); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb__sep { color: var(--grey-200); }
.breadcrumb__current { color: var(--grey-800); font-weight: var(--weight-medium); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--grey-800);
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--grey-800);
  background: var(--white);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,111,212,0.12);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.form-grid .full { grid-column: 1 / -1; }

/* FAQ ACCORDION */
.faq { border-top: 1px solid var(--grey-100); }
.faq-item { border-bottom: 1px solid var(--grey-100); }
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--navy);
  background: none;
  border: none;
  text-align: left;
  gap: var(--space-6);
  cursor: pointer;
  transition: color var(--duration) var(--ease);
}
.faq-question:hover { color: var(--blue); }
.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease);
  color: var(--grey-400);
}
.faq-item.open .faq-question svg { transform: rotate(180deg); color: var(--blue); }
.faq-answer {
  display: none;
  padding: 0 0 var(--space-5);
  color: var(--grey-600);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: none;
}
.faq-item.open .faq-answer { display: block; }

/* PROCESS STEP */
.process-steps {
  display: flex;
  gap: 0;
  position: relative;
}
.process-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding: var(--space-6) var(--space-4);
}
.process-step__num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  margin: 0 auto var(--space-4);
  position: relative;
  z-index: 1;
}
.process-step::before {
  content: '';
  position: absolute;
  top: calc(var(--space-6) + 24px);
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--grey-100);
}
.process-step:last-child::before { display: none; }
.process-step__title {
  font-weight: var(--weight-semibold);
  color: var(--navy);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.process-step__desc {
  font-size: var(--text-sm);
  color: var(--grey-600);
  max-width: none;
}

/* UTILITY */
.text-center { text-align: center; }
.text-navy { color: var(--navy); }
.text-blue { color: var(--blue); }
.text-cyan { color: var(--cyan); }
.text-grey { color: var(--grey-600); }
.text-white { color: var(--white); }
.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-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 var(--space-5); }
  .section { padding: var(--space-12) 0; }
  .section--lg { padding: var(--space-20) 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .process-steps { flex-direction: column; }
  .process-step::before { display: none; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}
@media (max-width: 480px) {
  .btn-group { flex-direction: column; align-items: flex-start; }
  .btn--lg { width: 100%; justify-content: center; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
