/* ============================================================
   ForgeGuard — shared foundation
   White surfaces, violet actions and warm gold highlights.
   Flat surfaces and hairline borders; no decorative gradients.
   ============================================================ */

@import url("fonts.css");

:root {
  /* White-led surfaces and neutral borders. */
  --bg:        #ffffff;
  --bg-alt:    #faf9fc;
  --surface:   #ffffff;
  --surface-2: #f4f1f9;
  --line:      #e4dfec;
  --line-soft: #eeeaf3;

  --ink:   #241b35;
  --ink-2: #5f596b;
  --ink-3: #706979;

  --accent:       #7436c9;
  --accent-hover: #6028ae;
  --accent-soft:  #f3ecfc;
  --accent-ink:   #ffffff;
  --gold:         #efc45c;
  --gold-soft:    #fff7df;
  --gold-ink:     #76520a;

  /* Existing dynamic component classes retain their compatible token names. */
  --lime:     var(--accent);
  --lime-dim: var(--accent-hover);
  --lime-ink: var(--accent-ink);
  --violet:   var(--accent);
  --violet-2: #6028ae;

  /* Status labels retain their meaning on a light background. */
  --amber:  #8a600c;
  --danger: #be3f39;
  --info:   #2a64a8;

  --radius:   14px;
  --radius-s: 9px;
  --wrap:     1180px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
figure { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -0.025em; }

code, .mono { font-family: var(--mono); }

code {
  font-size: 0.88em;
  background: rgba(116, 54, 201, 0.09);
  border: 1px solid rgba(116, 54, 201, 0.2);
  color: var(--lime);
  padding: 0.08em 0.38em;
  border-radius: 5px;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--ink-2);
}
pre code { background: none; border: 0; color: inherit; padding: 0; font-size: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.accent { color: var(--lime); }
.muted  { color: var(--ink-3); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--lime); color: var(--lime-ink);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

/* ============================ NAV ============================ */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.98); }

.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }

.nav__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; flex-shrink: 0; }
.nav__brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; }
.nav__brand span { display: flex; flex-direction: column; line-height: 1.15; font-size: 15.5px; }
.nav__brand em {
  font-style: normal; font-family: var(--mono); font-size: 10px;
  color: var(--lime); letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500;
}

.nav__menu { display: flex; align-items: center; gap: 2px; }
.nav__menu a {
  text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color 0.18s, background 0.18s;
}
.nav__menu a:hover { color: var(--ink); background: var(--surface); }
.nav__menu a.is-active { color: var(--lime); }

.nav__cta {
  margin-left: 8px;
  background: var(--lime) !important;
  color: var(--lime-ink) !important;
  font-weight: 650 !important;
}
.nav__cta:hover { background: var(--accent-hover) !important; }

.nav__toggle {
  display: none; width: 42px; height: 38px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 4.5px; padding: 0;
}
.nav__toggle span { width: 17px; height: 1.8px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.3px) rotate(-45deg); }

/* ============================ BUTTONS ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 11px; text-decoration: none;
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.3;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 8px rgba(116, 54, 201, 0.12); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { border-color: var(--violet); background: var(--surface-2); }
.btn--quiet { background: transparent; border-color: var(--line); color: var(--ink-2); padding: 9px 16px; font-size: 14px; }
.btn--quiet:hover:not(:disabled) { color: var(--ink); border-color: var(--violet); }
.btn--danger { background: transparent; border-color: rgba(190, 63, 57, 0.45); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: rgba(190, 63, 57, 0.1); border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--small { padding: 7px 13px; font-size: 13px; border-radius: 8px; gap: 6px; }

/* ============================ FORMS ============================ */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field__hint { font-size: 12.6px; color: var(--ink-3); line-height: 1.5; }
.field__error { font-size: 13px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 11px 13px; transition: border-color 0.18s, background 0.18s;
}
.input:hover, .select:hover { border-color: #b0a4bf; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(116, 54, 201, 0.10); }
.input::placeholder { color: var(--ink-3); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--mono { font-family: var(--mono); letter-spacing: 0.1em; }

.select {
  appearance: none;
  /* Inline SVG chevron keeps the control themeable without an extra request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23706979' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
  padding-right: 36px;
}

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { margin: 3px 0 0; width: 17px; height: 17px; accent-color: var(--lime); flex-shrink: 0; }
.switch span { font-size: 14.4px; color: var(--ink-2); }
.switch b { display: block; color: var(--ink); font-weight: 600; font-size: 14.6px; }

/* ============================ CALLOUTS & BADGES ============================ */

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-left-width: 3px;
  background: var(--surface); border-radius: var(--radius-s);
  padding: 14px 16px; font-size: 14.2px; color: var(--ink-2); margin: 0 0 18px;
}
.callout b { color: var(--ink); }
.callout--error   { border-left-color: var(--danger); background: rgba(190, 63, 57, 0.07); }
.callout--warn    { border-left-color: var(--gold); background: var(--gold-soft); }
.callout--ok      { border-left-color: var(--lime);   background: rgba(116, 54, 201, 0.07); }
.callout--info    { border-left-color: var(--violet); background: rgba(116, 54, 201, 0.07); }
.callout:empty { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.badge--lime   { background: rgba(116, 54, 201, 0.1);  border-color: rgba(116, 54, 201, 0.32);  color: var(--lime); }
.badge--violet { background: rgba(116, 54, 201, 0.12); border-color: rgba(116, 54, 201, 0.34); color: var(--violet); }
.badge--amber  { background: var(--gold-soft); border-color: #edd79b; color: var(--gold-ink); }
.badge--danger { background: rgba(190, 63, 57, 0.11);  border-color: rgba(190, 63, 57, 0.36);  color: var(--danger); }

.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 0 3px rgba(116, 54, 201, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================ FOOTER ============================ */

.foot { border-top: 1px solid var(--line-soft); padding: 40px 0 34px; background: var(--bg); }
.foot__grid {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 34px 24px;
  padding-bottom: 30px; border-bottom: 1px solid var(--line-soft);
}
.foot__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-bottom: 14px; font-weight: 700; }
.foot__brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.foot__blurb { margin: 0; font-size: 13.8px; color: var(--ink-3); max-width: 38ch; }
.foot__col h3 {
  margin: 0 0 13px; font-size: 11px; font-family: var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}
.foot__col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.foot__col a { text-decoration: none; font-size: 14px; color: var(--ink-2); }
.foot__col a:hover { color: var(--lime); }
.foot__base { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; padding-top: 22px; }
.foot__base p { margin: 0; font-size: 13px; color: var(--ink-3); }
.foot__note { font-family: var(--mono); font-size: 11.6px !important; }

/* ============================ MOTION ============================ */

.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* A polite, screen-reader-announced status line used across all three pages. */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  z-index: 300; max-width: min(520px, calc(100vw - 32px));
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  border-radius: var(--radius-s); padding: 13px 18px;
  font-size: 14px; color: var(--ink);
  box-shadow: 0 18px 40px rgba(38, 24, 57, 0.12);
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--error { border-left-color: var(--danger); }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 1100px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 70px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    padding: 14px 24px 20px; display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 12px 14px; font-size: 15px; }
  .nav__cta { margin: 8px 0 0; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .wrap { padding-inline: 16px; }
  .foot__grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { color-scheme: light; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .btn, .callout, .badge, .input, .select { border: 1px solid CanvasText; }
}
