/* Server-rendered pages (sign-in, account). Light by default, from the logo
   palette: navy ink, orange action, red for anything that went wrong. The two
   dark palettes below mirror the canvas app's themes — the PHP layouts stamp
   data-theme from the account (or the nvt_theme cookie), so crossing between
   the canvas and these pages never flashes a different skin. */

:root {
  --ink:      #0c1d30;
  --body:     #41505f;
  --muted:    #6b7a8d;
  --line:     #dde3ea;
  --paper:    #ffffff;
  --ground:   #f4f6f9;
  --orange:   #f5821f;
  --orange-d: #d96f10;
  --red:      #e12b20;
  --red-soft: #e12b20;
  --ok:       #1d7a4c;
  --input-border: #c9d2dc;
  --hover-wash:   #f7f9fb;
  --flash-ok-bg:   #eef8f2;  --flash-ok-line:   #bfe3d0;
  --flash-err-bg:  #fdeeed;  --flash-err-line:  #f4c6c3;
  --flash-info-bg: #eef3f9;  --flash-info-line: #cfdcea;
  --notice-bg: #fff8ef;      --notice-line: #f6d9b4;
  --card-shadow: 0 1px 2px rgba(12, 29, 48, .05), 0 8px 28px rgba(12, 29, 48, .06);
  --radius:   9px;
}

[data-theme="brand"] {
  --ink:      #ffffff;
  --body:     #c7d4e2;
  --muted:    #93a7bc;
  --line:     #24405e;
  --paper:    #112741;
  --ground:   #0c1d30;
  --red-soft: #ff6f66;
  --ok:       #4cc487;
  --input-border: #2e4f74;
  --hover-wash:   #17324f;
  --flash-ok-bg:   #12301f;  --flash-ok-line:   #1d5a3a;
  --flash-err-bg:  #3a1416;  --flash-err-line:  #7c2a25;
  --flash-info-bg: #0e2136;  --flash-info-line: #2e4f74;
  --notice-bg: #33270e;      --notice-line: #7a5a1e;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
}

[data-theme="blue"] {
  --ink:      #ffffff;
  --body:     #c6cfdc;
  --muted:    #8b97a8;
  --line:     #2a3342;
  --paper:    #161b25;
  --ground:   #0e1117;
  --orange:   #f5821f;
  --orange-d: #f5821f;
  --red-soft: #ff6f66;
  --ok:       #4cc487;
  --input-border: #3a465a;
  --hover-wash:   #1d2430;
  --flash-ok-bg:   #12301f;  --flash-ok-line:   #1d5a3a;
  --flash-err-bg:  #3a1416;  --flash-err-line:  #7c2a25;
  --flash-info-bg: #131822;  --flash-info-line: #3a465a;
  --notice-bg: #2a2116;      --notice-line: #6b5420;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--body);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  display: grid;
  place-items: start center;
  padding: 6vh 20px 40px;
}

.shell { width: 100%; max-width: 420px; }

/* ── Lockup ──────────────────────────────────────────────────────── */

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; margin-bottom: 22px;
}
.brand img { display: block; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.b-no { color: var(--ink); }
.b-over { color: var(--orange); }
.b-there { color: var(--red); }
.brand-tag { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ── Card ────────────────────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  box-shadow: var(--card-shadow);
}

h1 { font-size: 20px; color: var(--ink); margin: 0 0 4px; }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* ── Fields ──────────────────────────────────────────────────────── */

.field { margin-bottom: 15px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }

input[type=text], input[type=email], input[type=password] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 10px 12px;
}
input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 31, .16);
}
input[aria-invalid="true"] { border-color: var(--red); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(225, 43, 32, .14); }

.err { color: var(--red-soft); font-size: 13px; margin: 5px 0 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 5px 0 0; }

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  font: inherit; font-weight: 650;
  padding: 11px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn-google { background: var(--paper); border-color: var(--input-border); color: var(--ink); }
.btn-google:hover { background: var(--hover-wash); }
.btn-google svg { flex: 0 0 auto; }

/* ── Divider ─────────────────────────────────────────────────────── */

.or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--muted); font-size: 12.5px;
}
.or::before, .or::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* ── Flash + footer ──────────────────────────────────────────────── */

.flash {
  margin: 0 0 18px; padding: 11px 13px;
  border-radius: 6px; font-size: 14px;
  border: 1px solid;
}
.flash-ok   { background: var(--flash-ok-bg); border-color: var(--flash-ok-line); color: var(--ok); }
.flash-err  { background: var(--flash-err-bg); border-color: var(--flash-err-line); color: var(--red-soft); }
.flash-info { background: var(--flash-info-bg); border-color: var(--flash-info-line); color: var(--ink); }

.alt { margin: 18px 0 0; font-size: 14px; text-align: center; color: var(--muted); }
a { color: var(--orange-d); }
a:hover { color: var(--red-soft); }

.foot { text-align: center; margin: 18px 0 0; font-size: 13.5px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ── Signed-in shell ─────────────────────────────────────────────── */

body.wide { display: block; padding: 0 0 48px; }
body.wide .shell { max-width: 520px; margin: 28px auto 0; padding: 0 20px; }
body.wide .card { margin-bottom: 18px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .brand { margin: 0; }
.topbar .brand-name { font-size: 16px; }

.topnav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--orange-d); text-decoration: underline;
}
.linkish:hover { color: var(--red-soft); }

.notice {
  background: var(--notice-bg); border: 1px solid var(--notice-line);
  border-radius: 6px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px;
}
.notice p { margin: 0 0 6px; }

.methods { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.methods li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.methods li:last-child { border-bottom: 0; }
.methods .yes { color: var(--ok); font-weight: 600; }
.methods .no { color: var(--muted); }

/* ── Theme choice (account page) ─────────────────────────────────── */

.themes { display: flex; gap: 10px; margin-bottom: 16px; }
.theme-opt {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 8px;
  border: 1px solid var(--input-border); border-radius: 6px;
  font-weight: 600; font-size: 14px; color: var(--body);
  cursor: pointer;
}
.theme-opt.is-on { border-color: var(--orange); color: var(--ink); box-shadow: 0 0 0 2px rgba(245, 130, 31, .25); }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--input-border);
}
/* Each swatch previews ITS theme, whatever the page is painted in. */
.theme-swatch-light { background: linear-gradient(135deg, #ffffff 55%, #f5821f 55%); }
.theme-swatch-brand { background: linear-gradient(135deg, #0c1d30 55%, #f5821f 55%); }
.theme-swatch-blue  { background: linear-gradient(135deg, #0e1117 55%, #4a9eff 55%); }
