/**
 * db26 auth kit — the sign-in panel every db26 app shares.
 *
 * Served from https://db26.co.uk/auth-kit.css and linked by each app, so the
 * look is defined once. Change it here and all five apps follow on their next
 * page load, with nothing to redeploy — which is the point: five apps were
 * each given their own sign-in screen and drifted into five different products
 * at the exact moment a customer is deciding whether they trust us.
 *
 * Deliberately plain CSS with its own class names. The apps are a mix of Vite
 * and Next, some with Tailwind and some without, so anything relying on a
 * build step or a utility framework would rule half of them out.
 *
 * Everything is namespaced `db26a-` so it cannot collide with an app's styles.
 * Nothing here targets bare element selectors for the same reason.
 *
 * Markup contract lives in docs/db26-app-playbook.md. If an app's markup
 * drifts from it the panel will look wrong rather than silently different,
 * which is the intended failure.
 */

.db26a {
  /* Redeclared rather than inherited: apps define their own variables, and
     half of them have no design tokens at all. */
  --db26a-brand: #c45d2a;
  --db26a-brand-dark: #9e4a22;
  --db26a-ink: #0f1419;
  --db26a-ink-muted: #5c6470;
  --db26a-surface: #ffffff;
  --db26a-border: #e4e2dc;
  --db26a-error: #b3261e;
  --db26a-ok: #1f6f43;

  box-sizing: border-box;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.75rem;
  border: 1px solid var(--db26a-border);
  border-radius: 1rem;
  background: var(--db26a-surface);
  color: var(--db26a-ink);
  font-family:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.db26a *,
.db26a *::before,
.db26a *::after {
  box-sizing: inherit;
}

.db26a-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.db26a-intro {
  margin: 0.75rem 0 0;
  color: var(--db26a-ink-muted);
  font-size: 0.9375rem;
}

.db26a-notice {
  margin: 0.75rem 0 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid #f0dfae;
  border-radius: 0.5rem;
  background: #fdf8ec;
  color: #6b5312;
  font-size: 0.875rem;
}

.db26a-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.db26a-field {
  display: grid;
  gap: 0.375rem;
}

.db26a-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.db26a-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--db26a-border);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--db26a-ink);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming the page on focus */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.db26a-input:focus {
  outline: none;
  border-color: var(--db26a-brand);
  box-shadow: 0 0 0 3px rgb(196 93 42 / 0.18);
}

.db26a-hint {
  color: var(--db26a-ink-muted);
  font-size: 0.8125rem;
}

.db26a-submit {
  width: 100%;
  padding: 0.6875rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--db26a-ink);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.db26a-submit:hover:not(:disabled) {
  background: #23282f;
}

.db26a-secondary {
  width: 100%;
  padding: 0.6875rem 1rem;
  border: 1px solid var(--db26a-border);
  border-radius: 0.5rem;
  background: none;
  color: var(--db26a-ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.db26a-secondary:hover:not(:disabled) {
  border-color: var(--db26a-ink);
}

.db26a-secondary:disabled {
  opacity: 0.6;
  cursor: default;
}

.db26a-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Messages. Both roles are announced to screen readers by the markup, so
   colour is never the only signal. */
.db26a-error,
.db26a-ok {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.db26a-error {
  border: 1px solid #f3c9c6;
  background: #fdf3f2;
  color: var(--db26a-error);
}

.db26a-ok {
  border: 1px solid #c3e6d3;
  background: #f1faf5;
  color: var(--db26a-ok);
}

/* Switching between sign in, sign up and reset. Buttons, not links: they
   change what this panel does rather than navigating anywhere. */
.db26a-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--db26a-border);
}

.db26a-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--db26a-ink-muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.db26a-switch button:hover {
  color: var(--db26a-ink);
}

.db26a-footer {
  margin: 1.25rem 0 0;
  color: var(--db26a-ink-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.db26a-footer a {
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  /* Only applied where an app has opted in, so a light-only app is not
     dragged into a half-dark state it never designed for. */
  .db26a[data-theme='auto'] {
    --db26a-ink: #f2f4f6;
    --db26a-ink-muted: #a2abb6;
    --db26a-surface: #14171a;
    --db26a-border: #2a3038;
  }

  .db26a[data-theme='auto'] .db26a-input {
    background: #1b1f24;
    color: var(--db26a-ink);
  }

  .db26a[data-theme='auto'] .db26a-submit {
    background: var(--db26a-brand);
  }

  .db26a[data-theme='auto'] .db26a-submit:hover:not(:disabled) {
    background: var(--db26a-brand-dark);
  }
}
