/* Carbon Design System tokens and components used by the Rimac demo.
   Themes: White (light) and Gray 100 (dark). IBM Plex Sans is self-hosted (SIL OFL 1.1). */

@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-ext-300.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "IBM Plex Sans"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-300.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-400.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("ibm-plex-sans-latin-600.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, [data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --layer: #f4f4f4;
  --layer-hover: #e8e8e8;
  --field: #f4f4f4;
  --border-subtle: #e0e0e0;
  --border-strong: #8d8d8d;
  --text-primary: #161616;
  --text-secondary: #525252;
  --text-placeholder: #a8a8a8;
  --text-error: #da1e28;
  --support-error: #da1e28;
  --link: #0f62fe;
  --focus: #0f62fe;
  --tag-bg: #e0e0e0;
  --tag-text: #161616;
  --logo-filter: none;
  --page-glow: radial-gradient(60rem 28rem at 15% -10%, rgba(120, 169, 255, 0.18), transparent 70%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #161616;
  --layer: #262626;
  --layer-hover: #333333;
  --field: #262626;
  --border-subtle: #393939;
  --border-strong: #6f6f6f;
  --text-primary: #f4f4f4;
  --text-secondary: #c6c6c6;
  --text-placeholder: #6f6f6f;
  --text-error: #ff8389;
  --support-error: #fa4d56;
  --link: #78a9ff;
  --focus: #ffffff;
  --tag-bg: #393939;
  --tag-text: #f4f4f4;
  --logo-filter: invert(1);
  --page-glow: radial-gradient(60rem 28rem at 15% -10%, rgba(138, 63, 252, 0.16), transparent 70%);
}

/* Header and side nav stay dark in both themes (Carbon UI shell). */
:root {
  --shell-bg: #161616;
  --shell-border: #393939;
  --shell-text: #f4f4f4;
  --shell-text-muted: #c6c6c6;
  --shell-hover: #333333;
  --shell-active: #1c2f5c;
  --interactive: #0f62fe;
  --interactive-hover: #0353e9;
  --interactive-active: #002d9c;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: 0.16px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; letter-spacing: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---- Text input ---- */
.cds-field { margin-bottom: 24px; }

.cds-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
}

.cds-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--field);
  color: var(--text-primary);
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.cds-input::placeholder { color: var(--text-placeholder); }
.cds-input:focus { outline-color: var(--focus); }

.cds-input.is-invalid { outline: 2px solid var(--support-error); outline-offset: -2px; }
.cds-input.is-invalid:focus { outline-color: var(--focus); }

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.32px;
  color: var(--text-error);
}
.field-error-icon { flex: none; width: 16px; height: 16px; margin-top: 0; fill: var(--support-error); }

/* ---- Buttons ---- */
.cds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 64px 0 16px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--interactive);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.cds-btn:hover { background: var(--interactive-hover); }
.cds-btn:active { background: var(--interactive-active); }
.cds-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; box-shadow: inset 0 0 0 1px var(--background); }
.cds-btn.block { display: flex; width: 100%; }
.cds-btn-icon { position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: currentColor; }

.cds-btn-ghost {
  background: transparent;
  color: var(--link);
  padding: 0 16px;
  min-height: 40px;
}
.cds-btn-ghost:hover { background: var(--layer-hover); }
.cds-btn-ghost:active { background: var(--border-subtle); }

/* ---- Icon button used in the header and login page ---- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: var(--shell-hover); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* ---- Tile and tag ---- */
.cds-tile {
  background: var(--layer);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 24px;
}
.cds-tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 16px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.32px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
