/* Madatech marketing/site styles. Mirrors the class vocabulary of the design canvas
   so approved mockup sections translate almost verbatim into components. */

* { box-sizing: border-box; }

html, body { padding: 0; margin: 0; }

body {
  font-family: var(--font-base);
  color: var(--fg-1);
  background: var(--bg-1);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- layout ---- */

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-3xl);
}

.section { padding: 80px 0; }
.section--tint { background: var(--bg-2); border-block: 1px solid var(--stroke-2); }

.page-shell { display: flex; flex-direction: column; min-height: 100vh; }
.page-shell > main { flex: 1; }

/* ---- type helpers ---- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.h1 { font-size: 44px; line-height: 56px; font-weight: 600; letter-spacing: -0.015em; }
.h2 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
.lead { font-size: 16px; line-height: 24px; color: var(--fg-2); }
.body-text { font-size: 14px; line-height: 20px; color: var(--fg-2); }
.caption { font-size: 12px; line-height: 16px; color: var(--fg-3); }

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-m);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--lg { height: 44px; padding: 0 24px; font-size: 15px; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-hover); color: #fff; }
.btn--secondary { background: #fff; color: var(--fg-1); border-color: var(--stroke-1); }
.btn--secondary:hover { background: var(--bg-3); color: var(--fg-1); }
.btn--invert { background: #fff; color: var(--brand-pressed); border-color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}
.link-arrow:hover { text-decoration: none; color: var(--brand-hover); }
.link-arrow svg { width: 15px; height: 15px; }

/* ---- surfaces ---- */

.card {
  background: #fff;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
}
.card--hover { transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.card--hover:hover { box-shadow: var(--shadow-8); border-color: var(--tint-border); }

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-l);
  background: var(--tint-bg);
  color: var(--brand);
  flex: none;
}
.tile svg { width: 24px; height: 24px; }
.tile--sm { width: 44px; height: 44px; }
.tile--sm svg { width: 22px; height: 22px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-circular);
  font-size: 13px;
  font-weight: 600;
  background: var(--tint-bg);
  color: var(--brand-pressed);
  border: 1px solid var(--tint-border);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-circular);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: var(--fg-2);
  border: 1px solid var(--stroke-2);
  cursor: pointer;
}
.pill:hover { border-color: var(--tint-border); color: var(--brand); }
.pill.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-m);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--tint-bg);
  color: var(--brand-pressed);
}

.vendor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-s);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-3);
  border: 1px solid var(--stroke-2);
  color: var(--fg-2);
}

/* placeholder image tile (until real product/article art exists) */
.ph {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #dcebfb 0%, #e9ecf3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}
.ph--logo {
  background: #fff;
  background-image: radial-gradient(circle at 30% 25%, #eef4fb 0%, #f5f6f9 60%, #eef1f6 100%);
}
.ph__logo {
  width: 44%;
  max-width: 128px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(15, 108, 189, 0.14));
}
.ph__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-s);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.94);
  color: var(--fg-1);
  box-shadow: var(--shadow-2);
}

/* ---- grids ---- */

.grid { display: grid; gap: var(--space-xl); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-bottom: 40px;
}
.section-head__titles { max-width: 640px; }
.section-head .h2 { margin-top: 12px; }

/* ---- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke-2);
}
.site-header__inner {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xl);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-1);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--fg-1); }
.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-l);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.site-nav { display: flex; align-items: center; gap: var(--space-2xl); }
.navlink { color: var(--fg-2); font-size: 14px; font-weight: 600; }
.navlink:hover { color: var(--brand); text-decoration: none; }
.navlink.is-active { color: var(--brand); }
.site-header__actions { display: flex; align-items: center; gap: var(--space-l); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-m);
  border: 1px solid var(--stroke-1);
  background: #fff;
  color: var(--fg-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-3); }

.lang-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.lang-switch a { color: var(--fg-3); padding: 2px 4px; border-radius: var(--radius-s); }
.lang-switch a.is-active { color: var(--brand); }

.nav-toggle { display: none; }
.nav-toggle-cb { position: absolute; opacity: 0; pointer-events: none; }

/* ---- footer ---- */

.site-footer { background: #fff; border-top: 1px solid var(--stroke-2); }
.site-footer__cols {
  padding: 56px var(--space-3xl) 36px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
}
.foot-h {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 14px;
}
.foot-a { display: block; font-size: 14px; color: var(--fg-2); padding: 5px 0; }
.foot-a:hover { color: var(--brand); text-decoration: none; }
button.foot-a { background: none; border: 0; font-family: inherit; cursor: pointer; }
.site-footer__bar {
  border-top: 1px solid var(--stroke-2);
}
.site-footer__bar-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fg-3);
}
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-m);
  border: 1px solid var(--stroke-2);
  background: #fff;
  color: var(--fg-2);
}
.social:hover { color: var(--brand); border-color: var(--tint-border); }

/* ---- CTA band ---- */

.cta-band { background: var(--brand); color: #fff; }
.cta-band__inner {
  padding: var(--space-4xl) var(--space-3xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-band h2 { font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -0.01em; }
.cta-band p { font-size: 16px; line-height: 24px; color: var(--tint-strong); margin-top: 12px; }
.cta-band__actions { display: flex; gap: var(--space-l); flex-wrap: wrap; }

/* ---- breadcrumb ---- */

/* ---- portal ---- */

.portal-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-2);
  border-bottom: 2px solid transparent;
}
.portal-nav__link:hover { color: var(--brand); text-decoration: none; }
.portal-nav__link.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---- forms ---- */

.contact-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.field > span em { color: var(--fg-3); font-weight: 400; font-style: normal; }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 14px;
  color: var(--fg-1);
  border: 1px solid var(--stroke-1);
  border-radius: var(--radius-m);
  padding: 0 12px;
  height: 40px;
  background: #fff;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 20px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--tint-bg);
}
.field-choices { display: flex; flex-direction: column; gap: 8px; }
.field-choices--inline { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
.field-choice { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.field-choice input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }

.quote-picker {
  border: 1px solid var(--stroke-1);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.quote-picker__group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke-2);
}
.quote-picker__group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.field .validation-message { font-size: 12px; color: #b32121; }
.field input.invalid,
.field select.invalid,
.field textarea.invalid { border-color: #b32121; outline: none; }
.form-error {
  font-size: 14px;
  color: #b32121;
  background: #fdecec;
  border: 1px solid #f5c2c2;
  border-radius: var(--radius-m);
  padding: 10px 14px;
}
@media (max-width: 720px) { .field-grid { grid-template-columns: 1fr; } }

/* ---- filter rail ---- */

.filter-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 22px 0 8px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-2);
  padding: 7px 0;
  cursor: pointer;
}
.filter-row input { accent-color: var(--brand); width: 16px; height: 16px; }

.breadcrumb { font-size: 12px; color: var(--fg-3); margin-bottom: var(--space-xl); }
.breadcrumb a { color: var(--fg-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--fg-2); }

/* ---- article body (rendered Markdown) ---- */

.md { font-size: 17px; line-height: 28px; color: #2b2b2b; }
.md > p { margin: 0 0 22px; }
.md h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
  scroll-margin-top: 90px;
}
.md h3 { font-size: 19px; line-height: 26px; font-weight: 600; margin: 28px 0 10px; }
.md ul, .md ol { margin: 0 0 22px; padding-left: 22px; }
.md li { margin: 0 0 8px; }
.md blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  color: var(--fg-2);
  font-style: italic;
}
.md pre {
  margin: 24px 0;
  background: #1f1f1f;
  color: #e6e6e6;
  border-radius: var(--radius-l);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  overflow: auto;
}
.md code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-3);
  border: 1px solid var(--stroke-2);
  border-radius: 3px;
  padding: 1px 5px;
}
.md pre code { background: none; border: none; padding: 0; font-size: 13.5px; color: inherit; }
.md img { border-radius: var(--radius-l); margin: 24px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: 15px; }
.md th, .md td { border: 1px solid var(--stroke-2); padding: 8px 12px; text-align: left; }

.toc { position: sticky; top: 96px; align-self: start; }
.toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 12px;
}
.toc a {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--fg-3);
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--stroke-2);
}
.toc a:hover { color: var(--fg-1); text-decoration: none; }
.toc a.lvl-3 { padding-left: 22px; }

/* ---- responsive ---- */

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__cols { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}

@media (max-width: 720px) {
  .wrap { padding: 0 var(--space-l); }
  .h1 { font-size: 32px; line-height: 40px; }
  .h2 { font-size: 24px; line-height: 32px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .nav-toggle-cb:checked ~ .site-nav {
    display: flex;
    position: absolute;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-s) var(--space-l);
    background: #fff;
    border-bottom: 1px solid var(--stroke-2);
    box-shadow: var(--shadow-8);
  }
  .nav-toggle-cb:checked ~ .site-nav .navlink { padding: 12px 0; width: 100%; }
  .nav-toggle { display: flex; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .cta-band__inner { padding: var(--space-2xl) var(--space-l); }
  .site-footer__cols { grid-template-columns: 1fr; }
  .site-footer__bar-inner { flex-direction: column; gap: 6px; height: auto; padding: 16px 0; }
}

/* ---- cookie consent banner ---- */
.consent {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(680px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--stroke-1);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-16);
}
.consent__text { font-size: 13px; line-height: 19px; color: var(--fg-2); margin: 0; flex: 1; }
.consent__text a { color: var(--brand); }
.consent__actions { display: flex; gap: 10px; flex: none; }
.consent__actions .btn { height: 36px; padding: 0 16px; font-size: 13px; }
@media (max-width: 560px) {
  .consent { flex-direction: column; align-items: stretch; gap: 12px; bottom: 12px; }
  .consent__actions { justify-content: flex-end; }
}
