/*
 * Every page's styles, in the ClickBid look: navy header, light grey page,
 * white cards, sky blue main button, the Inter typeface. Light only.
 *
 * Colors are chosen for contrast first. Sky blue on white is too faint for
 * text (2.73 to 1), so links are navy and the main button has dark text.
 * The full table is in docs/harness/site-pages/02-plan.md.
 */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* ClickBid Design System 2.0 tokens. */
  --cb-primary-100: #c7ecff;
  --cb-primary-500: #00a3ff;
  --cb-primary-600: #0080cc;
  --cb-primary-900: #002033;
  --cb-navy-50: #e6f0fb;
  --cb-navy-500: #07529c;
  --cb-navy-600: #05417a;
  --cb-bg: #f4f5f6;
  --cb-surface: #ffffff;
  --cb-text: #111827;
  --cb-muted: #6b7280;

  /* Steps of the same families, used only where a token fails contrast. */
  --muted-on-page: #4b5563;
  --card-line: #e5e7eb;
  --input-line: #6b7280;
  --error: #b42318;
  --error-line: #dc2626;
  --error-surface: #fef2f2;
  --notice-line: #b45309;
  --notice-surface: #fffbeb;
  --success: #3f6212;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--cb-bg);
  color: var(--cb-text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  /* 16px, not the guide's 14: these pages are read on phones. */
  font-size: 1rem;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.wrap,
main {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

main.narrow {
  max-width: 36rem;
}

/* Header: navy, structural. */
.site-header {
  background: var(--cb-navy-500);
  color: #ffffff;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  color: #ffffff;
  text-decoration: none;
}

.site-header a:hover {
  /* Stays white: the general link hover color is navy, which would vanish here. */
  color: #ffffff;
  text-decoration: underline;
}

.site-header a:focus-visible {
  outline-color: #ffffff;
}

.brand {
  flex-wrap: wrap;
  gap: 0 0.5rem;
  padding: 0.25rem 0;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
}

.brand-by {
  font-size: 0.875rem;
  font-weight: 400;
}

.site-header nav a {
  padding: 0 0.5rem;
  font-weight: 600;
}

/* Hidden until a keyboard reaches it; then it takes its own line above the header. */
.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  position: static;
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

/* Text. */
h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

a {
  color: var(--cb-navy-500);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--cb-navy-600);
}

:focus-visible {
  outline: 3px solid var(--cb-navy-500);
  outline-offset: 2px;
}

.lead {
  font-size: 1.125rem;
}

.help,
.updated {
  color: var(--cb-muted);
  font-size: 0.9375rem;
  /* Lines at least 24 pixels tall, so a link inside one is easy to tap. */
  line-height: 1.6;
}

.help {
  margin: 0.3rem 0 0;
}

/* On the grey page, outside a card, muted text needs the darker step. */
main > .updated {
  color: var(--muted-on-page);
}

.nowrap {
  white-space: nowrap;
}

/* Cards: white, floating on the grey page. */
.card,
main.narrow > section {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--card-line);
  border-radius: 0.75rem;
  background: var(--cb-surface);
}

@media (min-width: 30rem) {
  .card,
  main.narrow > section {
    padding: 1.75rem;
  }
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.hero h1 {
  font-size: 2rem;
}

@media (min-width: 40rem) {
  .hero h1 {
    font-size: 2.25rem;
    line-height: 1.15;
  }
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 44rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps > li {
  margin: 0;
  counter-increment: step;
}

.steps h3 {
  margin-top: 0;
}

.steps h3::before {
  content: counter(step) ". ";
}

.actions {
  margin: 1.25rem 0 0.5rem;
}

/* The draft notice on the privacy and terms pages. */
.notice {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--notice-line);
  border-left-width: 0.3rem;
  border-radius: 0.5rem;
  background: var(--notice-surface);
  color: var(--cb-text);
}

.notice p {
  margin: 0;
}

/* Buttons. One main (primary) button per view. */
button {
  font: inherit;
  cursor: pointer;
}

.button,
button.primary,
button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.primary {
  border: 1px solid var(--cb-primary-600);
  background: var(--cb-primary-500);
  color: var(--cb-primary-900);
}

.primary:hover,
.primary[aria-disabled="true"] {
  border-color: var(--cb-navy-600);
  background: var(--cb-primary-100);
  color: var(--cb-primary-900);
}

.primary:focus-visible {
  border-color: var(--cb-navy-600);
}

/* While sending: the words and the cursor say "busy". Never faded. */
.primary[aria-disabled="true"] {
  cursor: progress;
}

.secondary {
  border: 1px solid var(--cb-navy-500);
  background: var(--cb-surface);
  color: var(--cb-navy-500);
}

.secondary:hover {
  border-color: var(--cb-navy-600);
  background: var(--cb-navy-50);
  color: var(--cb-navy-600);
}

button.primary {
  width: 100%;
  margin-top: 0.5rem;
}

@media (max-width: 29.99rem) {
  a.button {
    width: 100%;
  }
}

button.link {
  /* Tall enough to tap comfortably on a phone. */
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--cb-navy-500);
  text-decoration: underline;
}

button.link:hover {
  color: var(--cb-navy-600);
}

/* The signup form. */
.who {
  color: var(--cb-muted);
  overflow-wrap: anywhere;
}

.who strong {
  color: var(--cb-text);
}

form {
  margin-top: 1rem;
}

.field {
  margin-bottom: 1.1rem;
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

@media (min-width: 30rem) {
  .row {
    grid-template-columns: 3fr 2fr;
  }
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.hint {
  color: var(--cb-muted);
  font-weight: 400;
}

input,
select {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input-line);
  border-radius: 0.5rem;
  background: var(--cb-surface);
  color: var(--cb-text);
  /* 16px or more, so phones do not zoom in on focus. */
  font: inherit;
  font-size: 1rem;
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error-line);
  border-width: 2px;
}

input[readonly] {
  background: var(--cb-bg);
}

.error {
  margin: 0.35rem 0 0;
  color: var(--error);
  font-weight: 600;
}

.banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border-left: 0.3rem solid currentColor;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.banner p {
  margin: 0;
}

.banner button {
  margin-top: 0.75rem;
}

.banner-error {
  background: var(--error-surface);
  color: var(--error);
}

.banner-wait {
  border-left-color: var(--notice-line);
  background: var(--notice-surface);
  color: var(--cb-text);
}

.connector {
  margin: 0 0 1rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.copy-row input {
  flex: 1 1 14rem;
  min-width: 0;
}

#sign-in {
  margin-top: 1rem;
}

#sending-note {
  min-height: 1.5rem;
  text-align: center;
}

/* A plain "it worked" mark. The words carry the meaning. */
#done-title.fresh::before {
  content: "\2713\00a0";
  color: var(--success);
}

#done-names {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

#done-steps .connector {
  margin: 0.6rem 0 0.4rem;
}

/* Footer: on the grey page. */
.site-footer {
  padding: 0 0 2.5rem;
  color: var(--muted-on-page);
  font-size: 0.9375rem;
}

/* The rule sits on the nav, so it is exactly as wide as the content above. */
.site-footer nav {
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0 0 0.25rem;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.site-footer p {
  margin: 0;
}

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

/* Two buttons side by side, or one above the other on a narrow screen, never touching. */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* A web address shown in a sentence: it may break anywhere to fit a phone. */
.address {
  overflow-wrap: anywhere;
}
