/*
 * The identity provider's login, dressed as the rest of this container.
 *
 * Dex renders its own templates and serves one stylesheet per theme, loaded
 * after its base sheet. The class names below are Dex's, not ours; the tokens
 * and the shapes are the same ones `src/aiws/admin/style.py` uses, so the login
 * the developer is sent to and the page they land on read as one thing.
 *
 * Several rules are written against `.theme-body` to out-specify the base
 * sheet, which styles the same classes.
 */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: light dark;
  --paper: #f4f5f7;
  --surface: #ffffff;
  --rule: #dde1e7;
  --text: #171b21;
  --muted: #5f6873;
  --brass: #a86b18;
  --on-brass: #ffffff;
  --alarm: #a52218;
  --alarm-wash: #fdf1f0;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12151b;
    --surface: #181c23;
    --rule: #2a303a;
    --text: #e6eaf0;
    --muted: #939dab;
    --brass: #e9a445;
    --on-brass: #1a1205;
    --alarm: #f9847a;
    --alarm-wash: #2a1512;
  }
}

.theme-body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* The bar Dex puts the logo in. Kept as a quiet header rather than a band of
   colour, so the panel below it is what the eye goes to. */
.theme-body .theme-navbar {
  background: transparent;
  border: 0;
  box-shadow: none;
  height: auto;
  padding: 2rem 1.25rem 0;
}

.theme-body .theme-navbar__logo-wrap {
  display: block;
  width: auto;
  height: auto;
  margin: 0 auto;
  max-width: 24rem;
  text-align: left;
}

.theme-body .theme-navbar__logo {
  width: 26px;
  height: 26px;
  max-height: none;
  margin: 0;
}

.theme-body .dex-container {
  max-width: 24rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.theme-body .theme-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: none;
  padding: 1.5rem 1.25rem;
  max-width: none;
  width: auto;
}

.theme-body .theme-heading {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-align: left;
}

.theme-body .theme-form-row {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.theme-body .theme-form-label {
  display: block;
  width: auto;
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.theme-body .theme-form-input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: none;
}

.theme-body .theme-form-input::placeholder { color: var(--muted); opacity: 0.7; }

.theme-body .theme-form-input:focus,
.theme-body .theme-form-input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}

.theme-body .dex-btn,
.theme-body .theme-btn--primary,
.theme-body .theme-btn--success,
.theme-body .theme-btn-provider {
  display: inline-block;
  width: 100%;
  min-height: 0;
  margin: 0.4rem 0 0;
  padding: 0.6rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  background: var(--brass);
  color: var(--on-brass);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

.theme-body .theme-btn-provider {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}

/* The screen that lists login methods. Its buttons carry an icon beside the
   label, so they are laid out as a row rather than centred like the others. */
.theme-body .dex-btn.theme-btn-provider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
}

.theme-body .dex-btn-icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.theme-body .dex-btn-text { font-weight: 500; }

.theme-body .dex-btn:focus-visible,
.theme-body .theme-btn-provider:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.theme-body .dex-error-box {
  margin: 1rem 0 0;
  padding: 0.65rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  background: var(--alarm-wash);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--alarm);
  border-radius: 8px;
}

.theme-body .theme-link-back { margin-top: 1.25rem; text-align: left; }

.theme-body .dex-subtle-text { color: var(--muted); font-size: 0.8125rem; }

.theme-body a { color: var(--brass); }
.theme-body a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
