/* SafeVig shared styles: tokens, base, header, footer, buttons, forms.
   Every page loads this file. Page-specific styles live in home.css and pages.css. */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --soft: #eef0f6;
  --fg: #2b2d42;
  --heading: #231a66;
  --muted: #5f6478;
  --line: #e2e5ee;
  --brand: #231a66;
  --brand-2: #6a4be0;
  --blue: #1f5fe0;
  --gold: #f2a900;
  --danger: #b3261e;
  --ok: #1b7a3d;
  --band-a: #13286b;
  --band-b: #0d1f55;
  --band-grey: #7d818f;
  --footer: #241a68;
  --footer-fg: #eceaf8;
  --footer-muted: #c7c2e6;
  --shadow: 0 1px 4px rgba(35, 26, 102, .08);
  --shadow-lg: 0 12px 28px rgba(35, 26, 102, .14);
  --font: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d24; --surface: #181538; --soft: #1e1b45; --fg: #e8e7f5; --heading: #cfc6ff; --muted: #a9a6c9;
    --line: #2c2859; --brand: #b9acff; --brand-2: #8d76f5; --blue: #8fb0ff; --danger: #ff8a80; --ok: #6fd498;
    --footer: #0a0818; --footer-fg: #eceaf8; --footer-muted: #a9a6c9;
    --shadow: 0 1px 4px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d24; --surface: #181538; --soft: #1e1b45; --fg: #e8e7f5; --heading: #cfc6ff; --muted: #a9a6c9;
  --line: #2c2859; --brand: #b9acff; --brand-2: #8d76f5; --blue: #8fb0ff; --danger: #ff8a80; --ok: #6fd498;
  --footer: #0a0818; --footer-fg: #eceaf8; --footer-muted: #a9a6c9;
  --shadow: 0 1px 4px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16.5px; line-height: 1.65; letter-spacing: .01em; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
h1, h2, h3, h4, p, ul { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 4px; }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; color: #231a66; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: 1300px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 1020px; }
.mid { max-width: 1180px; }
.title { text-align: center; color: var(--heading); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.2; letter-spacing: .02em; text-wrap: balance; }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; text-decoration: none; font: 700 16px/1.2 var(--font); border: 2px solid var(--brand); background: var(--brand); color: var(--surface); cursor: pointer; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--heading); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); filter: none; }
.btn.pill { background: #fff; color: #13286b; border-color: #fff; border-radius: 999px; padding: 11px 30px; }

/* Header (kept white in both themes so the logo keeps its colours) */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: #fff; }
/* The header sits inside this wrapper; display:contents lets it stick for the whole page instead of only its own wrapper. */
[data-site="header"] { display: contents; }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: #fff; box-shadow: 0 2px 10px rgba(35, 26, 102, .12); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; }
.logo-link { display: inline-flex; }
.logo { height: 40px; width: auto; display: block; }
.site-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a, .dd-btn { display: inline-block; padding: 8px 12px; border-radius: 6px; text-decoration: none; font: 700 15px var(--font); letter-spacing: .01em; background: none; border: 0; color: #231a66; cursor: pointer; }
.site-nav a:hover, .dd-btn:hover { background: #efecfb; }
.site-nav a[aria-current="page"], .has-dd.is-active > .dd-btn { background: #e6e2fa; }
.has-dd { position: relative; }
.dd-btn::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 3px 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; }
.dd-menu { display: none; position: absolute; left: 0; top: calc(100% + 6px); min-width: 280px; background: #fff; border: 1px solid #e2e5ee; border-radius: 8px; padding: 6px; box-shadow: 0 14px 30px rgba(35, 26, 102, .16); }
/* invisible bridge so the pointer can travel from the button to the menu without the menu closing */
.dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.has-dd.open .dd-menu { display: block; }
@media (hover: hover) { .has-dd:hover .dd-menu { display: block; } }
.dd-menu a { display: block; width: 100%; font-weight: 600; }
.menu-toggle { display: none; background: #fff; border: 1px solid #d9d6ee; border-radius: 8px; padding: 8px 14px; color: #231a66; font: 700 15px var(--font); cursor: pointer; }

/* Footer */
.site-footer { background: var(--footer); color: var(--footer-fg); padding-block: 26px 18px; margin-top: 56px; }
.foot-grid { display: grid; grid-template-columns: 1fr 190px 190px; gap: 40px; padding-top: 6px; }
.foot-grid > * { min-width: 0; }
.foot-logo { display: inline-flex; background: #fff; border-radius: 8px; padding: 6px 12px; margin-bottom: 14px; }
.foot-logo .logo { height: 34px; }
.site-footer p { color: var(--footer-fg); font-size: .98rem; line-height: 1.5rem; }
.site-footer p b { font-weight: 700; }
.site-footer h3 { font-size: 1.1rem; font-weight: 600; margin: 8px 0 16px; letter-spacing: .02em; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--footer-fg); text-decoration: none; font-size: .98rem; display: inline-flex; align-items: center; gap: 8px; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .links a { padding-left: 4px; }
.site-footer svg { width: 17px; height: 17px; fill: currentColor; }
.legal { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .2); text-align: center; font-size: .92rem; color: var(--footer-muted); }
.legal b { color: #fff; }
.social { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 35; display: grid; gap: 10px; }
.social a { width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); display: grid; place-items: center; }
.social svg { width: 26px; height: 26px; }

/* Forms (contact, careers) */
.sv-form { display: grid; gap: 14px; }
.sv-form label.field { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--heading); }
.sv-form .opt { font-weight: 500; color: var(--muted); }
.sv-form input[type="text"], .sv-form input[type="email"], .sv-form input[type="tel"], .sv-form select, .sv-form textarea, .sv-form input[type="file"] {
  font: 500 1rem var(--font); width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
.sv-form input[type="file"] { padding: 8px 10px; }
.sv-form textarea { min-height: 120px; resize: vertical; }
.sv-form [aria-invalid="true"] { border-color: var(--danger); }
.sv-form .err { color: var(--danger); font-size: .86rem; font-weight: 600; min-height: 0; }
.sv-form .hint { color: var(--muted); font-size: .84rem; font-weight: 500; }
.sv-form .hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sv-form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); font-weight: 500; }
.sv-form .consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.sv-form .consent a { color: var(--blue); }
.captcha { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); }
.captcha-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.captcha-row img { height: 56px; width: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.captcha-row input { flex: 1 1 140px; min-width: 0; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; }
.captcha .link-btn { background: none; border: 0; color: var(--blue); font: 700 .88rem var(--font); cursor: pointer; padding: 4px; text-decoration: underline; }
.captcha-title { font-size: .84rem; font-weight: 700; color: var(--muted); }
.form-status { min-height: 1.4em; font-weight: 700; font-size: .95rem; }
.form-status.ok { color: var(--ok); }
.form-status.bad { color: var(--danger); }
.form-status.info { color: var(--muted); }
.preview-note { padding: 10px 12px; border-radius: 8px; background: #fff7e0; color: #5a4300; font-size: .88rem; font-weight: 600; border: 1px solid #f0d890; }
:root[data-theme="dark"] .preview-note { background: #3a2f10; color: #ffe49a; border-color: #6b5518; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preview-note { background: #3a2f10; color: #ffe49a; border-color: #6b5518; } }

@media (max-width: 1000px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .menu-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid #e2e5ee; box-shadow: 0 12px 20px rgba(35, 26, 102, .12); padding: 8px max(16px, env(safe-area-inset-left, 0px)) 16px; max-height: 75vh; overflow-y: auto; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .dd-menu::before { display: none; }
  .dd-menu { position: static; box-shadow: none; border: 0; border-left: 2px solid #e2e5ee; border-radius: 0; margin-left: 12px; min-width: 0; }
  .has-dd:hover .dd-menu { display: none; }
  .has-dd.open .dd-menu { display: block; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
