/*
 * Fonts, served by the console rather than Google: no third-party request from
 * a customer page, and nothing for the Content-Security-Policy to allow beyond
 * 'self'. Inter (variable, 100-900) and IBM Plex Mono 400, Latin and Latin
 * Extended only, from Fontsource 5.3.0; OFL-1.1, licences alongside in fonts/.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: 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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: 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: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-latin-ext-400-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: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-latin-400-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;
}

/*
 * SysGit design tokens for server-rendered pages.
 *
 * Ported by hand from ridge-app: ui/tailwind.config.js (daisyUI 4 theme
 * overrides), ui/src/index.css (font variables), and
 * ui/src/components/pageLayout.tsx (the page background). The console has no
 * Node pipeline, so these are plain custom properties rather than Tailwind
 * classes. When ridge-app's theme changes, this file does not -- update both.
 *
 * Dark mode follows the OS. ridge-app toggles data-theme from localStorage,
 * but that preference lives on a different origin and cannot be read here.
 *
 * Deliberately NOT ported: the purple radial-gradient page background from
 * pageLayout.tsx. On a sign-in page it dominated the screen (and read as
 * near-black purple in dark mode), so the page sits on a flat base-200
 * instead -- the same neutral daisyUI uses for surfaces behind cards.
 */

:root {
  --sg-font-body: "Inter", system-ui, sans-serif;
  --sg-font-mono: "Menlo", "Monaco", "IBM Plex Mono", ui-monospace, monospace;

  /* daisyUI light, with ridge-app's overrides */
  --sg-primary: #48349f;
  --sg-primary-hover: #3a2a82;
  --sg-primary-content: #ffffff;
  --sg-neutral: #ffffff;
  --sg-base-100: #ffffff;
  --sg-base-200: hsl(0, 0%, 95%);
  --sg-base-300: hsl(344, 2%, 90%);
  --sg-base-content: #000000;
  --sg-muted: rgba(0, 0, 0, 0.6);
  --sg-border: rgba(0, 0, 0, 0.2);
  --sg-success: #00a96e;
  --sg-error: #dc2626;
  --sg-error-bg: #fee2e2;
  --sg-info-bg: #eef2ff;

  --sg-rounded-box: 0.5rem;
  --sg-rounded-btn: 0.25rem;

}

@media (prefers-color-scheme: dark) {
  :root {
    --sg-primary: #c084fc;
    --sg-primary-hover: #d0a2fd;
    --sg-primary-content: #1a0b2e;
    --sg-neutral: #000000;
    --sg-base-100: #1d232a;
    --sg-base-200: #191e24;
    --sg-base-300: #15191e;
    --sg-base-content: #a6adbb;
    --sg-muted: rgba(166, 173, 187, 0.75);
    --sg-border: rgba(166, 173, 187, 0.2);
    --sg-error-bg: rgba(220, 38, 38, 0.15);
    --sg-info-bg: rgba(192, 132, 252, 0.12);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sg-font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--sg-base-content);
  background-color: var(--sg-base-200);
  display: flex;
  flex-direction: column;
}

.sg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
.sg-header picture, .sg-header img { height: 1.75rem; display: block; }

.sg-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* pageLayout.tsx content card: rounded-lg shadow-lg bg-base-100 border-base-content/20 */
.sg-card {
  width: 100%;
  max-width: 28rem;
  background: var(--sg-base-100);
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-rounded-box);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  padding: 2rem 1.5rem;
}
.sg-card--wide { max-width: 40rem; }

h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
.sg-muted { color: var(--sg-muted); }
.sg-logo-lg { max-width: 8rem; margin-bottom: 1.5rem; }

label { display: block; font-weight: 500; margin-bottom: 0.375rem; }

/* daisyUI .input */
.sg-input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  font: inherit;
  color: inherit;
  background: var(--sg-base-100);
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-rounded-btn);
}
.sg-input:focus {
  outline: 2px solid var(--sg-border);
  outline-offset: 2px;
}

/* daisyUI .btn / .btn-primary */
.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  color: var(--sg-base-content);
  background: var(--sg-base-200);
  border: 1px solid var(--sg-base-200);
  border-radius: var(--sg-rounded-btn);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.sg-btn:hover { background: var(--sg-base-300); border-color: var(--sg-base-300); }
.sg-btn--primary {
  color: var(--sg-primary-content);
  background: var(--sg-primary);
  border-color: var(--sg-primary);
}
.sg-btn--primary:hover { background: var(--sg-primary-hover); border-color: var(--sg-primary-hover); }
.sg-btn--block { width: 100%; }
/* daisyUI .btn-ghost, which ridge-app colours with primary */
.sg-btn--ghost { background: transparent; border-color: transparent; color: var(--sg-primary); }
.sg-btn--ghost:hover { background: var(--sg-base-200); border-color: var(--sg-base-200); }

.sg-field { margin-bottom: 1rem; }
.sg-errors { color: var(--sg-error); margin: 0.375rem 0 0; padding: 0; list-style: none; }

.sg-alert {
  border-radius: var(--sg-rounded-box);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--sg-info-bg);
}
.sg-alert--error { background: var(--sg-error-bg); color: var(--sg-error); }

.sg-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0 0 1.5rem; }
.sg-dl dt { color: var(--sg-muted); }
.sg-dl dd { margin: 0; }
code { font-family: var(--sg-font-mono); font-size: 0.8125rem; }

.sg-footer { text-align: center; padding: 1rem; color: var(--sg-muted); font-size: 0.75rem; }

details > summary { cursor: pointer; font-weight: 600; margin: 0 0 1rem; }

/* Setup checklist on the account page, while a new workspace is being set up. */
.sg-steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.75rem; counter-reset: sg-step; }
.sg-steps li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.25rem 0.75rem; align-items: start; counter-increment: sg-step; }
.sg-steps li::before {
  content: counter(sg-step);
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  border: 1px solid var(--sg-border); font-weight: 600; font-size: 0.875rem;
}
.sg-steps li.is-done::before { content: "✓"; background: var(--sg-success); border-color: var(--sg-success); color: #ffffff; }
.sg-steps li.is-current::before { background: var(--sg-primary); border-color: var(--sg-primary); color: var(--sg-primary-content); }
.sg-steps strong { display: block; }
.sg-steps p { margin: 0.25rem 0 0; }
