@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* TYPOGRAPHY & COLOR PALETTE */
:root {
  /* Typography scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.75rem;
  --font-size-hero: 3.5rem;
  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Brand palette (soft SaaS) */
  --color-bg: #EFF6FF;
  --color-bg-alt: #eaf0ff;
  --color-bg-card: #ffffff;

  --color-primary: #1D4ED8;
  --color-primary-dark: #1A3A9A;
  --color-secondary: #3B82F6;
  --color-accent: #93C5FD;

  --color-text: #0b254a;
  --color-text-muted: #5b6b87;
  --color-text-on-primary: #ffffff;
  --color-border: #dbe7fb;
  --color-shadow: rgba(15, 23, 42, 0.25);

  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Elevation shadow preset for elevated components */
  --shadow-elevated: 0 4px 6px rgba(0,0,0,0.08), 0 10px 15px rgba(0,0,0,0.12);
  --shadow-elevated-hover: 0 6px 12px rgba(0,0,0,0.10), 0 16px 24px rgba(0,0,0,0.14);
}

/* CSS RESET / BASE */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

/* COMPONENTS & LAYOUT STRUCTURE */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  overflow: visible;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  width: 100%;
  margin: 0 auto; /* required by spec to center content at all breakpoints */
}
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  max-height: 52px;
  text-decoration: none;
}
.site-logo img {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
  padding: 0.4rem 0.6rem;
  z-index: 200;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);
  border: 1.5px solid rgba(255,255,255,0.7);
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff; /* mandatory white bars */
  border-radius: 2px;
  transition: 0.2s ease;
}
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 500;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  gap: 0;
}
.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-xs);
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.75rem 1rem;
  display: block;
  position: relative;
}
.nav-link:hover {
  color: var(--color-primary);
}
.nav-item { list-style: none; }

/* Dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; white-space: nowrap; padding-right: 0.5rem; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  z-index: 9999;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  white-space: nowrap;
}
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu .nav-link {
  display: block;
  padding: 0.5rem 1.25rem;
  width: 100%;
  border-bottom: none;
}
.nav-dropdown-menu .nav-link:hover {
  background: var(--color-bg-alt);
}
.nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }

/* Mobile-specific adjustments for dropdown under mobile */
@media (max-width: 767px) {
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    display: none;
  }
  .nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }
}

/* Hero section */
.hero {
  width: 100%;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(29,78,216,0.18) 0%, rgba(29,78,216,0.08) 60%, rgba(29,78,216,0.18) 100%), var(--color-bg);
}
.hero h1 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
  margin: 0;
  color: var(--color-text);
}
.section { padding: 2rem 0; }

/* Section titles */
.section-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

/* Cards */
.card {
  display: flex;
  flex-direction: column; /* mandatory */
  background: var(--color-bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated-hover);
}
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.card-content { padding: 1rem; }

/* Card grid (responsive) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
@media (min-width: 1280px) {
  /* extra spacing on large screens if desired (kept simple here) */
}

/* Buttons */
.btn { display: inline-block; padding: 0.6rem 0.95rem; border-radius: var(--radius); border: none; background: transparent; cursor: pointer; font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); transition: transform 0.2s ease, filter 0.2s ease; text-decoration: none; color: inherit; }
.btn-primary { background: var(--color-primary); color: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.btn-primary:hover { filter: brightness(0.9); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-bg-alt); transform: translateY(-1px); }

/* Site footer */
.site-footer { background: #f8fbff; padding: 2rem 0; color: var(--color-text); border-top: 1px solid var(--color-border); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-copy { font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* FAQ accordion (CSS-only) */
.faq-section { padding: 2rem 0; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--color-bg-card);
  overflow: hidden;
  transition: 0.2s ease;
}
.faq-item[open] { border-color: var(--color-primary); box-shadow: 0 2px 12px var(--color-shadow); }
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  list-style: none;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] > .faq-question::after { content: "−"; }
.faq-answer {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
}
.faq-answer p { margin: 0.75rem 0 0; color: var(--color-text-muted); line-height: var(--line-height-base); }

/* FORM ELEMENTS */
label { display: block; margin-bottom: 0.25rem; font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: var(--color-text); }
input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-base);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
button, [type="submit"] { font-family: inherit; }

/* TABLES */
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--color-border); padding: 0.75rem; text-align: left; }
th { background: var(--color-bg-alt); }

/* UTILITIES */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* RESPONSIVE REQUIREMENTS */

/* Mobile first baseline (≤767px): already defined by base rules above */

/* Tablet (≥768px): layout adjustments for iPad / small laptops */
@media (min-width: 768px) {
  /* Centered content container across breakpoints */
  .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
  }

  /* Hamburger nav hidden on tablet/desktop */
  .nav-toggle-label { display: none !important; }

  /* Desktop-ish navigation visible inline, horizontal layout */
  .site-nav {
    display: flex !important;
    align-items: center;
    position: static;
    width: auto;
    background: transparent;
    border-top: none;
    box-shadow: none;
  }
  .nav-list {
    display: flex !important;
    flex-direction: row !important; /* required: horizontal on tablet/desktop */
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
  }
  .nav-link {
    font-size: var(--font-size-sm); /* tablet/desktop smaller than body text */
  }
  /* Dropdown behavior on tablet/desktop: show on hover/focus-within */
  .nav-dropdown-menu {
    position: absolute;
  }

  /* Hero & grid sizing on tablet */
  .hero { min-height: 60vh; }
  .hero h1 { font-size: var(--font-size-3xl); }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .footer-inner { flex-direction: row; text-align: left; }
  .container { margin: 0 auto; }
}

/* Desktop (≥1280px): full-width enhancements */
@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
    padding: 0 2rem;
  }
  .hero { min-height: 70vh; }
  .hero h1 { font-size: var(--font-size-hero); }
  .section { padding: 4rem 0; }
}