/* Log in, sign up and password pages. Same paper-and-ink look as the landing page.
   No inline styles (CSP), no gradients, no emoji. */
:root {
  --paper: #f4f7fb; --sheet: #ffffff;
  --ink: #14213d; --body: #34415c; --muted: #5a6781;
  --rule: #c9d8ee; --rule-strong: #a9bcda;
  --red: #d9413b; --red-text: #be312b; --ok: #0f766e; --hl: #ffe14d;
  --brand: #4f46e5; --brand-dark: #4338ca; --link: #4338ca; --on-brand: #ffffff;
  --band: #14213d; --on-band: #ffffff;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1626; --sheet: #172036;
    --ink: #eaf0fb; --body: #b9c4da; --muted: #93a0bb;
    --rule: #26324d; --rule-strong: #34446a;
    --red: #ff6b64; --red-text: #ff8a84; --ok: #5eead4; --hl: #4a4112;
    --brand: #6c63f2; --brand-dark: #7d75f6; --link: #a9a4ff;
    --band: #1b2a4a;
  }
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body.auth { margin: 0; background: var(--paper); color: var(--body); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.shell { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }

/* ---------- the paper side ---------- */
.side { background: var(--band); color: var(--on-band); display: flex; align-items: center; position: relative; padding: 64px 56px 64px 96px; }
.side::before { content: ""; position: absolute; top: 0; bottom: 0; left: 64px; width: 2px; background: var(--red); opacity: .7; }
.side-in { width: 100%; max-width: 420px; }
.side-line { margin: 0 0 32px; font: 700 clamp(30px, 3.2vw, 42px)/1.12 var(--serif); letter-spacing: -.015em; }
.mini { list-style: none; margin: 0 0 28px; padding: 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.mini li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .22); font-weight: 600; }
.mini em { font-style: normal; font-weight: 500; font-size: 14px; color: rgba(255, 255, 255, .72); white-space: nowrap; }
.mini .late em { color: #ff9b95; font-weight: 700; }
.mini .today { background: var(--hl); color: #14213d; margin: 0 -10px; padding: 13px 10px; }
.mini .today em { color: #14213d; font-weight: 700; }
.side-foot { margin: 0; color: rgba(255, 255, 255, .78); max-width: 24em; }

/* ---------- the form side ---------- */
.main { display: flex; flex-direction: column; padding: 28px 40px 28px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; color: var(--ink); text-decoration: none;
  font: 700 22px/1 var(--serif); view-transition-name: brand; }
.brand img { height: 32px; width: auto; }
.card { width: 100%; max-width: 400px; margin: auto; padding: 24px 0; }
.card h1 { margin: 0 0 8px; color: var(--ink); font: 700 34px/1.15 var(--serif); letter-spacing: -.015em; }
.card p { margin: 0 0 14px; }
.hint { color: var(--muted); }

/* one entrance when the page opens: the pieces arrive in reading order */
.card > * { animation: arrive .45s cubic-bezier(.3, .7, .2, 1) both; }
.card > :nth-child(2) { animation-delay: .06s; }
.card > :nth-child(3) { animation-delay: .12s; }
.card > :nth-child(4) { animation-delay: .18s; }
.card > :nth-child(n+5) { animation-delay: .24s; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- fields ---------- */
.card label { display: block; margin: 16px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.card input[type=email], .card input[type=password], .card input[type=text], .card input:not([type]) {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: 400 16px/1.3 var(--sans);
  color: var(--ink); background: var(--sheet); border: 1.5px solid var(--rule-strong); border-radius: 8px;
  transition: border-color .18s, box-shadow .18s;
}
.card input:hover { border-color: var(--muted); }
.card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.card label.checkrow { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-weight: 400; }
.card label.checkrow input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); }
.card label.checkrow span { color: var(--body); font-size: 14px; line-height: 1.5; }
.card .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.card input.pmuser { position: absolute; left: -9999px; width: 1px; height: 1px; padding: 0; border: 0; margin: 0; opacity: 0; pointer-events: none; }

.card button[type=submit] {
  display: block; width: 100%; margin-top: 22px; padding: 14px 18px; font: 700 17px/1.2 var(--sans);
  color: var(--on-brand); background: var(--brand); border: 2px solid var(--brand); border-radius: 8px; cursor: pointer;
  transition: background-color .18s, border-color .18s, transform .18s;
}
.card button[type=submit]:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.card button[type=submit]:active { transform: translateY(1px); }

/* ---------- messages ---------- */
.err, .okmsg { padding: 10px 14px; border-left: 4px solid; border-radius: 0 6px 6px 0; background: var(--sheet); font-weight: 600; }
.err { border-color: var(--red); color: var(--red-text); animation: notice .4s cubic-bezier(.3, .7, .2, 1) both; }
.okmsg { border-color: var(--ok); color: var(--ok); }
@keyframes notice { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.muted { color: var(--muted); font-size: 15px; }
.card > .muted { margin-top: 18px; }

/* ---------- Google ---------- */
.author { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 14px; }
.author::before, .author::after { content: ""; flex: 1; border-top: 1px solid var(--rule-strong); }
.googlebtn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--rule-strong);
  border-radius: 8px; background: var(--sheet); color: var(--ink); text-decoration: none; font-weight: 700;
  transition: border-color .18s, background-color .18s; }
.googlebtn:hover { border-color: var(--ink); }

.legalfoot { margin: 32px 0 0 !important; font-size: 13px; }
.legalfoot a { color: var(--muted); }

/* ---------- narrow screens: the form alone ---------- */
@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 22px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
