@import url("https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css");

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --z-porcelain: #f8f8f5;
  --z-porcelain-light: #fffcf7;
  --z-carbon: #20201f;
  --z-carbon-mid: #3a3a3a;
  --z-sapphire: #004cd0;
  --z-sapphire-light: #7aa6ff;
  --z-sapphire-fill: #004cd0;
  --z-sapphire-hover: #0039a0;
  --z-gold: #ffb300;
  --z-gold-light: #e4d2a0;
  --z-focus: var(--z-sapphire);

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --space-96: 96px;
  --space-128: 128px;
  --space-160: 160px;

  --button-height-sm: 36px;
  --button-height-md: 44px;
  --button-height-lg: 52px;
  --button-padding-x-sm: .85rem;
  --button-padding-x-md: 1.25rem;
  --button-padding-x-lg: 1.5rem;
  --button-radius: 999px;
  --button-border-width: 1px;
  --button-font-size-sm: .875rem;
  --button-font-size-md: 1rem;
  --button-font-size-lg: 1.0625rem;
  --button-motion-duration: 180ms;
  --button-motion-ease: ease-out;
  --button-motion-nudge: 3px;
  --button-motion-nudge-y: 2px;
  --button-group-gap: .85rem 1.1rem;
}

html[data-theme="dark"] {
  --z-porcelain: #111110;
  --z-porcelain-light: #fffcf7;
  --z-carbon: #f8f8f5;
  --z-carbon-mid: #c4c4be;
  --z-sapphire: #7aa6ff;
  --z-sapphire-light: #7aa6ff;
  --z-sapphire-fill: #004cd0;
  --z-sapphire-hover: #0039a0;
  --z-gold: #ffb300;
  --z-gold-light: #e4d2a0;
  --z-focus: #7aa6ff;
}

/* ── Shared button chrome ───────────────────────────────── */
.button,
.z-button {
  --_h: var(--button-height-md);
  --_px: var(--button-padding-x-md);
  --_fs: var(--button-font-size-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: var(--_h);
  padding: 0 var(--_px);
  border: var(--button-border-width) solid var(--z-sapphire);
  border-radius: var(--button-radius);
  background: transparent;
  color: var(--z-sapphire);
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  font-family: inherit;
  font-size: var(--_fs);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
  transition:
    background var(--button-motion-duration) var(--button-motion-ease),
    color var(--button-motion-duration) var(--button-motion-ease),
    border-color var(--button-motion-duration) var(--button-motion-ease),
    transform var(--button-motion-duration) var(--button-motion-ease);
}
.button i,
.z-button i {
  font-size: 1.05em;
  line-height: 1;
  transition: transform var(--button-motion-duration) var(--button-motion-ease);
}

/* ── Primary ────────────────────────────────────────────── */
.button--primary {
  background: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
  border-color: var(--z-sapphire-fill);
}
.button--primary:hover,
.button--primary.is-hover {
  background: var(--z-sapphire-hover);
  border-color: var(--z-sapphire-hover);
  color: var(--z-porcelain-light);
  transform: translateY(-1px);
}

/* ── Secondary + legacy outline `.z-button` ─────────────── */
.button--secondary,
.z-button:not(.button--primary):not(.button--tertiary):not(.button--icon):not(.z-button--secondary) {
  background: transparent;
  color: var(--z-sapphire);
  border-color: var(--z-sapphire);
}
.button--secondary:hover,
.button--secondary.is-hover,
.z-button:not(.button--primary):not(.button--tertiary):not(.button--icon):not(.z-button--secondary):hover {
  background: var(--z-sapphire-fill);
  border-color: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
  transform: translateY(-1px);
}

/* ── Tertiary + legacy underline `.z-button--secondary` ─── */
.button--tertiary,
.z-button--secondary {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  color: var(--z-sapphire);
  min-height: 44px;
  padding-inline: .15rem;
  justify-content: flex-start;
}
.button--tertiary:hover,
.button--tertiary.is-hover,
.z-button--secondary:hover {
  background: transparent;
  color: var(--z-sapphire-hover);
  box-shadow: none;
  transform: none;
}
.button--tertiary:not(:has(i)):hover,
.button--tertiary:not(:has(i)).is-hover {
  transform: translateX(var(--button-motion-nudge-y));
}

/* ── Icon-only ──────────────────────────────────────────── */
.button--icon {
  width: var(--button-height-md);
  min-width: var(--button-height-md);
  padding: 0;
  background: transparent;
  color: var(--z-sapphire);
  border-color: var(--z-sapphire);
}
.button--icon:hover,
.button--icon.is-hover {
  background: var(--z-sapphire-fill);
  border-color: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
}

.button:hover .ph-arrow-right,
.button.is-hover .ph-arrow-right,
.z-button:hover .ph-arrow-right {
  transform: translateX(var(--button-motion-nudge));
}
.button:hover .ph-arrow-down,
.button.is-hover .ph-arrow-down,
.z-button:hover .ph-arrow-down {
  transform: translateY(var(--button-motion-nudge-y));
}
.button:hover .ph-arrow-up-right,
.button.is-hover .ph-arrow-up-right {
  transform: translate(2px, -2px);
}
.button:hover .ph-caret-right,
.button.is-hover .ph-caret-right {
  transform: translateX(var(--button-motion-nudge));
}
.button:hover .ph-caret-down,
.button.is-hover .ph-caret-down {
  transform: translateY(var(--button-motion-nudge-y));
}

/* ── Sizes / icon placement ─────────────────────────────── */
.button--sm { --_h: var(--button-height-sm); --_px: var(--button-padding-x-sm); --_fs: var(--button-font-size-sm); }
.button--md { --_h: var(--button-height-md); --_px: var(--button-padding-x-md); --_fs: var(--button-font-size-md); }
.button--lg { --_h: var(--button-height-lg); --_px: var(--button-padding-x-lg); --_fs: var(--button-font-size-lg); }
.button--icon.button--sm { width: var(--button-height-sm); min-width: var(--button-height-sm); }
.button--icon.button--lg { width: var(--button-height-lg); min-width: var(--button-height-lg); }
.button--icon-start,
.button--icon-end { flex-direction: row; }

/* ── Focus ──────────────────────────────────────────────── */
.button:focus-visible,
.button.is-focus,
.z-button:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: 3px;
}

/* ── Disabled ───────────────────────────────────────────── */
.button:disabled,
.z-button:disabled,
.button.is-disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  pointer-events: none;
  background: color-mix(in srgb, var(--z-sapphire-fill) 38%, var(--z-porcelain));
  border-color: transparent;
  color: color-mix(in srgb, var(--z-porcelain-light) 78%, var(--z-carbon));
}
.button--secondary:disabled,
.button--secondary.is-disabled,
.button--tertiary:disabled,
.button--tertiary.is-disabled,
.button--icon:disabled,
.button--icon.is-disabled,
.z-button--secondary:disabled {
  background: transparent;
  border-color: color-mix(in srgb, var(--z-sapphire) 28%, transparent);
  color: color-mix(in srgb, var(--z-sapphire) 48%, var(--z-carbon-mid));
}
.button--tertiary:disabled,
.button--tertiary.is-disabled {
  border-color: transparent;
}

/* ── Groups ─────────────────────────────────────────────── */
.button-group,
.z-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--button-group-gap);
}

/* ── Links (not buttons) ────────────────────────────────── */
.link-inline {
  color: var(--z-sapphire);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.link-inline:hover { color: var(--z-sapphire-hover); }
.link-nav {
  color: inherit;
  text-decoration: none;
}
.link-nav:hover { color: var(--z-sapphire); }

/* ── Surface inversions ─────────────────────────────────── */
.z-band .button--secondary,
.z-band .button--icon,
.z-band .z-button:not(.button--tertiary):not(.z-button--secondary) {
  color: currentColor;
  border-color: currentColor;
  background: transparent;
}
.z-band .button--secondary:hover,
.z-band .button--secondary.is-hover,
.z-band .button--icon:hover,
.z-band .z-button:not(.button--tertiary):not(.z-button--secondary):hover {
  background: currentColor;
  border-color: currentColor;
  color: var(--color-sapphire, var(--z-sapphire-fill));
}
.z-band--gold .button--secondary:hover,
.z-band--gold .button--secondary.is-hover,
.z-band--gold .button--icon:hover {
  background: var(--z-sapphire-fill);
  border-color: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
}
.z-band .button--tertiary,
.z-band .z-button--secondary {
  color: currentColor;
  border-color: transparent;
  background: transparent;
}
.z-band .button--tertiary:hover,
.z-band .z-button--secondary:hover {
  background: transparent;
  color: currentColor;
}

.z-section--sapphire .button--primary,
.z-section--carbon .button--primary {
  background: var(--z-porcelain-light);
  color: var(--z-sapphire-fill);
  border-color: var(--z-porcelain-light);
}
.z-section--sapphire .button--primary:hover,
.z-section--carbon .button--primary:hover {
  background: var(--z-porcelain);
  border-color: var(--z-porcelain);
  color: var(--z-sapphire-fill);
}
.z-section--sapphire .button--secondary,
.z-section--carbon .button--secondary,
.z-section--sapphire .button--icon,
.z-section--carbon .button--icon,
.z-section--sapphire .z-button:not(.button--tertiary):not(.z-button--secondary),
.z-section--carbon .z-button:not(.button--tertiary):not(.z-button--secondary) {
  color: var(--z-porcelain-light);
  border-color: var(--z-porcelain-light);
  background: transparent;
}
.z-section--sapphire .button--secondary:hover,
.z-section--carbon .button--secondary:hover,
.z-section--sapphire .button--icon:hover,
.z-section--carbon .button--icon:hover {
  background: var(--z-porcelain-light);
  border-color: var(--z-porcelain-light);
  color: var(--z-sapphire-fill);
}
.z-section--sapphire .button--tertiary,
.z-section--carbon .button--tertiary,
.z-section--sapphire .z-button--secondary,
.z-section--carbon .z-button--secondary {
  color: var(--z-porcelain-light);
  border-color: transparent;
  background: transparent;
}
.z-section--sapphire .button--tertiary:hover,
.z-section--carbon .button--tertiary:hover {
  background: transparent;
  color: var(--z-porcelain-light);
}

.z-section--gold .button--primary {
  background: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
  border-color: var(--z-sapphire-fill);
}
.z-section--gold .button--secondary,
.z-section--gold .button--icon,
.z-section--gold .z-button:not(.button--tertiary):not(.z-button--secondary) {
  color: var(--z-carbon);
  border-color: var(--z-carbon);
  background: transparent;
}
.z-section--gold .button--secondary:hover,
.z-section--gold .button--icon:hover {
  background: var(--z-sapphire-fill);
  border-color: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
}
.z-section--gold .button--tertiary,
.z-section--gold .z-button--secondary {
  color: var(--z-carbon);
  border-color: transparent;
  background: transparent;
}
.z-section--gold .button--tertiary:hover {
  background: transparent;
  color: var(--z-carbon);
}

.z-cta .button--secondary,
.z-cta .z-button--secondary {
  color: var(--z-carbon);
  border-color: var(--z-carbon);
}
.z-cta .button--secondary:hover {
  background: var(--z-sapphire-fill);
  border-color: var(--z-sapphire-fill);
  color: var(--z-porcelain-light);
}

@media (max-width: 71.99rem) {
  .button-group,
  .z-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .button-group .button--primary,
  .button-group .button--secondary,
  .z-actions .button--primary,
  .z-actions .button--secondary,
  .z-actions .z-button:not(.z-button--secondary):not(.button--tertiary) {
    width: 100%;
  }
  .button--tertiary,
  .z-button--secondary { width: auto; }
}

html[data-qa-consent="off"] .consent-banner { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .button,
  .z-button,
  .button i,
  .z-button i {
    transition: none;
    transform: none;
  }
}
