/* Sign in, password reset and other unauthenticated screens.
   Styled as an architect's drawing sheet: drafting paper, ink linework, one redline accent. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/assets/big-shoulders-display-b358827a.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/ibm-plex-mono-400-d803141a.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/ibm-plex-mono-500-3f7bbac1.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/ibm-plex-mono-600-b71798d4.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #efeadf;
  --paper-light: #f7f4ec;
  --ink: #1c1d1a;
  --ink-soft: #6e6b62;
  --rule: rgba(28, 29, 26, 0.16);
  --grid-minor: rgba(28, 29, 26, 0.04);
  --grid-major: rgba(28, 29, 26, 0.075);
  --redline: #e0471b;
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

html:has(body[data-theme="dark"]) { color-scheme: dark; }

[data-theme="dark"] {
  --paper: #171815;
  --paper-light: #1f201c;
  --ink: #efeadf;
  --ink-soft: #a7a397;
  --rule: rgba(239, 234, 223, 0.16);
  --grid-minor: rgba(239, 234, 223, 0.04);
  --grid-major: rgba(239, 234, 223, 0.075);
  --redline: #f0603a;
}

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

body {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Sheet frame with grid references along the edges */
.sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  height: calc(100vh - 64px);
  min-height: 680px;
  margin: 32px;
  border: 1.5px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 6px;
}

.sheet__ruler {
  position: absolute;
  display: flex;
  justify-content: space-around;
  font-size: 10px;
  color: var(--ink-soft);
}

.sheet__ruler--top { top: -28px; left: 0; right: 0; height: 20px; align-items: center; }
.sheet__ruler--side { top: 0; bottom: 0; left: -28px; width: 20px; flex-direction: column; align-items: center; }

/* Drawing area */
.drawing {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 56px 40px;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
}

.drawing__headline {
  margin: 0;
  font-family: var(--font-display);
  max-width: 11ch;
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.notes { max-width: 420px; font-size: 12px; line-height: 1.6; }

.notes__title {
  display: inline-block;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--ink);
}

.notes__list { margin: 0; padding: 0; list-style: none; counter-reset: note; }

.notes__list li { display: flex; gap: 10px; counter-increment: note; }

.notes__list li::before {
  content: counter(note, decimal-leading-zero) ".";
  color: var(--redline);
  font-weight: 600;
}

/* Title block */
.title-block {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper-light);
  border-left: 1.5px solid var(--ink);
}

.title-block__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 32px;
  border-bottom: 1.5px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.logo { width: 30px; height: 30px; flex: none; }

.title-block__tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.title-block__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 32px;
}

.title-block__meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  margin: 0;
  border-top: 1.5px solid var(--ink);
}

.title-block__meta div { padding: 12px 14px; border-right: 1px solid var(--ink); }
.title-block__meta div:last-child { border-right: 0; }

.title-block__meta dt {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.title-block__meta dd { margin: 4px 0 0; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* Form */
.auth__header { margin-bottom: 32px; }

.auth__label {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.auth__subtitle { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

.auth__link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--redline);
  text-underline-offset: 3px;
}

.auth__link:hover { color: var(--ink); }

.auth__footnote { margin: 28px 0 0; }

.flash {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1.5px dashed;
}

.flash__mark { font-weight: 600; }
.flash--alert { color: var(--redline); background: rgba(224, 71, 27, 0.06); }
.flash--notice { color: var(--ink); background: rgba(28, 29, 26, 0.04); }

.auth-form { display: grid; gap: 28px; }

.field { display: grid; gap: 6px; }

.field__row { display: flex; align-items: baseline; justify-content: space-between; }

.field__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field__index { margin-right: 6px; color: var(--redline); }

.field__control { position: relative; }

.field__input {
  width: 100%;
  height: 44px;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field__control:has(.field__toggle) .field__input { padding-right: 64px; }

.field__input::placeholder { color: #a7a397; }

.field__input:focus {
  outline: none;
  border-bottom-color: var(--redline);
  box-shadow: 0 1.5px 0 var(--redline);
}

.field__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--paper-light) inset;
  -webkit-text-fill-color: var(--ink);
}

.field__toggle {
  position: absolute;
  right: 0;
  bottom: 9px;
  padding: 4px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

.field__toggle:hover,
.field__toggle[aria-pressed="true"] { color: var(--paper-light); background: var(--ink); }

.field__toggle:focus-visible { outline: 2px solid var(--redline); outline-offset: 2px; }

.button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  margin-top: 4px;
  padding: 0 20px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-light);
  background: var(--ink);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.button__arrow { font-size: 18px; transition: transform 0.15s; }

.button:hover { background: var(--redline); }
.button:hover .button__arrow { transform: translateX(4px); }
.button:focus-visible { outline: 2px solid var(--redline); outline-offset: 3px; }

/* Tablet and phone: headline becomes a strip above the title block */
@media (max-width: 1080px) {
  .sheet { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; margin: 16px; min-height: calc(100vh - 32px); outline-offset: 4px; }
  .sheet__ruler { display: none; }
  .drawing { padding: 28px 20px; }
  .drawing__headline { max-width: none; font-size: clamp(2rem, 8vw, 3.5rem); }
  .notes { display: none; }
  .title-block { border-left: 0; border-top: 1.5px solid var(--ink); }
  .title-block__brand { padding: 18px 20px; }
  .title-block__main { padding: 32px 20px; }
  .title-block__meta dd { white-space: normal; }
}
