/* MakeMode Workspace login (#879) — house look for the sign-in page only.
   Scoped under body.mm-login (set in sessions/new.html.erb); every other screen
   keeps Campfire's own system. Values are copied from the canonical token file,
   site/design/tokens.css in the makemode repo — sync by hand if that changes.
   Sharp corners throughout: the only round thing is the circle. */

/* Campfire paints the html canvas too (base.css `html, body`), and in the dark
   scheme that canvas is black — the ground must be claimed at the html level or
   the paper only covers the body box. */
html:has(> body.mm-login) {
  background: #F3EFE6;
  color-scheme: light;
}

body.mm-login {
  --mm-paper: #F3EFE6;
  --mm-white: #FFFFFF;
  --mm-ink: #1A1A1A;
  --mm-mut: #5C584F;
  --mm-line-2: #D4D0C6;
  --mm-blue: #0048C0;
  --mm-blue-bright: #2E5BB8;
  --mm-font: Futura, "Century Gothic", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  --mm-font-sans: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
  background: var(--mm-paper);
  color: var(--mm-ink);
  font-family: var(--mm-font-sans);
}

/* The fixed footer mark from the layout doubles our own — hide it here. */
body.mm-login #app-logo { display: none; }

/* The layout's main region paints its own scheme color (black in dark mode) —
   it must read as the same paper as the ground. */
body.mm-login main#main-content { background: var(--mm-paper); }

.mm-login__wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.mm-login__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--mm-white);
  border: 2px solid var(--mm-ink);
  border-radius: 0;
  padding: 48px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.mm-login__bar {
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 6px;
  background: var(--mm-blue);
}

.mm-login__mark {
  width: 128px;
  height: auto;
  margin: 0 auto;
}

.mm-login__title {
  font-family: var(--mm-font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--mm-ink);
}

.mm-login__primary {
  display: block;
  background: var(--mm-blue);
  color: var(--mm-paper);
  font-family: var(--mm-font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 2px solid var(--mm-blue);
  border-radius: 0;
  padding: 14px 16px;
  margin-block-start: 8px;
}

.mm-login__primary:hover,
.mm-login__primary:focus-visible {
  background: var(--mm-blue-bright);
  border-color: var(--mm-blue-bright);
  color: var(--mm-white);
}

.mm-login__fallback { text-align: center; }

.mm-login__fallback summary {
  cursor: pointer;
  color: var(--mm-mut);
  font-size: 13.5px;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mm-login__fallback summary::-webkit-details-marker { display: none; }

.mm-login__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block-start: 16px;
  text-align: left;
}

.mm-login__label {
  font-family: var(--mm-font);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mm-mut);
}

.mm-login__input {
  appearance: none;
  width: 100%;
  background: var(--mm-white);
  border: 1px solid var(--mm-line-2);
  border-radius: 0;
  padding: 12px;
  font-family: var(--mm-font-sans);
  font-size: 16px;
  color: var(--mm-ink);
}

.mm-login__input:focus-visible {
  outline: 2px solid var(--mm-blue);
  outline-offset: -1px;
  border-color: var(--mm-blue);
}

.mm-login__secondary {
  background: var(--mm-white);
  color: var(--mm-ink);
  font-family: var(--mm-font);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--mm-ink);
  border-radius: 0;
  padding: 10px 16px;
  margin-block-start: 8px;
  cursor: pointer;
}

.mm-login__secondary:hover,
.mm-login__secondary:focus-visible {
  background: var(--mm-ink);
  color: var(--mm-paper);
}

/* The admin-contact footer (accounts/_help_contact) rides along on this page —
   quiet it down to plain ink-on-paper. */
body.mm-login .mm-login__wrap ~ *,
body.mm-login .mm-login__wrap .btn {
  border-radius: 0;
  box-shadow: none;
}
body.mm-login .mm-login__wrap .btn {
  background: transparent;
  color: var(--mm-mut);
  font-size: 13.5px;
}
body.mm-login .txt-subtle { color: var(--mm-mut); }
