/*
 * Signis base for Cardwell 4C2E.
 * Load after signis-tokens.css and before a page's own <style>.
 * Every value here comes from a token in signis-tokens.css; no raw colours.
 *
 * What lives here: self-hosted fonts, the page base, and the Signis component
 * recipes rewritten as plain CSS classes (prefix sg-) for pages with no build
 * step. Layout stays in each page.
 *
 * Client theming: --brand and --brand-deep default to Cardwell blue. A page
 * that themes per client sets them at runtime; nothing else should.
 */

/* Typefaces are served from this domain, not from Google. A client IT team
   that whitelists cardwellgroup.com gets the whole workspace, fonts included. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations'),
       url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/lora-latin-wght-normal.woff2') format('woff2-variations'),
       url('/fonts/lora-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/lora-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('/fonts/lora-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/lora-latin-wght-italic.woff2') format('woff2-variations'),
       url('/fonts/lora-latin-wght-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/lora-latin-ext-wght-italic.woff2') format('woff2-variations'),
       url('/fonts/lora-latin-ext-wght-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --brand:      var(--color-brand-default);
  --brand-deep: var(--color-background-navy-deep);
  --sg-ring:    color-mix(in srgb, var(--color-border-focus) 20%, transparent);
  --sg-ease:    150ms ease;
}

/* ── Base ───────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-ui-body);
  line-height: var(--leading-ui-body);
  color: var(--color-text-primary);
  background: var(--color-background-subtle);
  -webkit-font-smoothing: antialiased;
}

.sg-display {
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
}

.sg-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-ui-caption);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-body-eyebrow);
  text-transform: uppercase;
}

.sg-mono { font-family: var(--font-mono); }

/* ── Card ───────────────────────────────────────────────────────────── */
.sg-card {
  background: var(--color-background-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}

/* ── Buttons ────────────────────────────────────────────────────────────
   One gold primary per section. Outline for everything secondary. */
.sg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--spacing-xs);
  min-height: var(--spacing-control-lg);
  padding: 0 var(--spacing-md);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: var(--text-ui-button);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background-size: 200% 100%;
  background-position: 0% 0%;
  transition: background-color var(--sg-ease), border-color var(--sg-ease),
              box-shadow var(--sg-ease), color var(--sg-ease), background-position 500ms ease;
}
.sg-btn:focus-visible { outline: 1px solid var(--color-border-focus); outline-offset: -1px; box-shadow: 0 0 0 3px var(--sg-ring); }
.sg-btn:active:not(:disabled) { transform: translateY(1px); }
.sg-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sg-btn--primary {
  background-color: var(--color-action-primary);
  color: var(--color-text-on-primary);
}
.sg-btn--primary:hover:not(:disabled) {
  background-image: linear-gradient(90deg, var(--color-action-primary), var(--color-action-hover), var(--color-action-primary));
  background-position: 100% 0%;
}
.sg-btn--primary:active:not(:disabled) { box-shadow: var(--shadow-deboss-gold); }

.sg-btn--outline {
  background-color: var(--color-background-default);
  border-color: var(--color-border-accent);
  color: var(--color-text-primary);
}
.sg-btn--outline:hover:not(:disabled) { background-color: var(--color-background-accent-subtle); }
.sg-btn--outline:active:not(:disabled) { box-shadow: var(--shadow-deboss-gold-subtle); }

.sg-btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.sg-btn--ghost:hover:not(:disabled) { background-color: var(--color-background-accent-subtle); color: var(--color-text-primary); }

.sg-btn--block { width: 100%; }

/* ── Inputs ─────────────────────────────────────────────────────────── */
.sg-input {
  width: 100%;
  min-height: var(--spacing-control-lg);
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-xs);
  background: var(--color-background-default);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-sans);
  font-size: var(--text-ui-input);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--sg-ease), box-shadow var(--sg-ease);
}
.sg-input::placeholder { color: var(--color-text-placeholder); }
.sg-input:focus { border-color: var(--color-border-focus); box-shadow: 0 0 0 3px var(--sg-ring); }

.sg-label {
  display: block;
  margin-bottom: var(--spacing-2xs);
  font-size: var(--text-ui-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

/* ── Badge ──────────────────────────────────────────────────────────── */
.sg-badge {
  display: inline-flex; align-items: center;
  padding: var(--spacing-3xs) var(--spacing-xs);
  border-radius: var(--radius-xs);
  font-size: var(--text-ui-badge);
  font-weight: var(--font-weight-medium);
  background: var(--color-brand-subtle);
  color: var(--color-feedback-info-text);
}
