/*
 * The server-rendered pages: sign-in and the allauth family, the error
 * pages, the public home. One small sheet, no framework.
 *
 * Every colour below is a token from frontend/src/design-system/tokens.css
 * (dark palette) so these pages are visibly the same product as the React
 * screens behind the door. Keep them in step: a palette change lands there
 * first and is mirrored here.
 *
 * Form markup is what crispy-forms' bootstrap5 pack emits (.mb-3 /
 * .form-label / .form-control / .form-check / .invalid-feedback / .alert),
 * styled here directly — Bootstrap itself is not loaded.
 */

:root {
  --ink-950: #0b1421;
  --ink-900: #101924;
  --ink-800: #18222f;
  --ink-700: #212d3d;
  --line: #2b3a4e;
  --line-strong: #344357;
  --heading: #ffffff;
  --body: #c2d3e4;
  --muted: #8094ae;
  --faint: #5b6e88;
  --accent: #09c2de;
  --accent-hover: #2bd2ec;
  --accent-active: #08a8c1;
  --on-accent: #0b1421;
  --link: #5aa3f0;
  --link-hover: #8fc1f7;
  --danger: #e85347;
  --danger-soft: rgb(232 83 71 / 0.14);
  --ok: #1ee0ac;
  --warn: #f4bd0e;
  --radius: 0.5rem;
  --radius-card: 0.75rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--ink-900);
  color: var(--body);
  font-family: Montserrat, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

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

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

/* ---- Layout: one card, centred, with the mark above it --------------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 3rem 1rem;
}

.page-brand {
  display: block;
  line-height: 0;
}
.page-brand img {
  height: 2.75rem;
  width: auto;
}

.page-card {
  width: 100%;
  max-width: 26rem;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgb(6 12 20 / 0.5);
  padding: 1.75rem 1.75rem 1.5rem;
  position: relative;
  overflow: hidden;
}
/* The exposure line: the one accent on the page, a thin band of brand cyan
   along the card's top edge — the way a radiograph's bright edge reads. */
.page-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
}

.page-card--wide {
  max-width: 34rem;
}

.page-eyebrow {
  margin: 0 0 0.375rem;
  color: var(--faint);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--heading);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.page-lede {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.page-card > form,
.page-body {
  margin-top: 1.5rem;
}

.page-body p {
  margin: 0 0 0.75rem;
}
.page-body p:last-child {
  margin-bottom: 0;
}

.page-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.page-foot {
  padding: 1rem;
  color: var(--faint);
  font-size: 0.6875rem;
  text-align: center;
}

/* ---- Forms (crispy bootstrap5 markup) -------------------------------- */

.mb-3,
.form-group {
  margin-bottom: 1rem;
}

.form-label,
legend {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--body);
  font-size: 0.75rem;
  font-weight: 500;
}
.asteriskField {
  display: none;
}

.form-control,
.form-select,
textarea {
  display: block;
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  background: var(--ink-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--body);
  font: inherit;
  transition: border-color 150ms;
}
textarea {
  height: auto;
  padding: 0.5rem 0.75rem;
}
.form-control::placeholder {
  color: var(--faint);
}
.form-control:focus {
  border-color: rgb(9 194 222 / 0.6);
  outline: none;
}
.form-control.is-invalid {
  border-color: var(--danger);
}
.form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--body);
  box-shadow: 0 0 0 1000px var(--ink-950) inset;
}

.form-text {
  display: block;
  margin-top: 0.375rem;
  color: var(--muted);
  font-size: 0.6875rem;
}

.invalid-feedback,
.errorlist {
  display: block;
  margin: 0.375rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: 0.75rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.form-check-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}
.form-check-label {
  color: var(--body);
}

/* crispy's non-field errors */
.alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgb(232 83 71 / 0.4);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.75rem;
}
.alert ul {
  margin: 0;
  padding-left: 1rem;
}
.alert-success {
  border-color: rgb(30 224 172 / 0.4);
  background: rgb(30 224 172 / 0.12);
  color: var(--ok);
}

.radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.radio label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.radio input {
  accent-color: var(--accent);
}
.verified,
.unverified,
.primary {
  color: var(--muted);
  font-size: 0.6875rem;
}
.verified {
  color: var(--ok);
}

/* ---- Buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--body);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--on-accent);
}
.btn-primary:active {
  background: var(--accent-active);
}
.btn-danger {
  border-color: rgb(232 83 71 / 0.4);
  color: var(--danger);
}
.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-block {
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ---- Public home: the marketing site, full-bleed ---------------------- */

.home-frame {
  position: fixed;
  inset: 0;
  border: 0;
  width: 100%;
  height: 100%;
}
