/* Open Sans, served from this site (SIL Open Font License, see fonts/OFL.txt) */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/open-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/open-sans-latin-wght-italic.woff2") format("woff2");
}

:root {
  --brown: #564434;
  --brown-dark: #3e3126;
  --tan: #b08d6a;
  --tan-light: #e9dccd;
  --sand: #f6f1ea;
  --ink: #2f2a25;
  --muted: #6f665d;
  --faint: #8f857a;
  --line: #ddd3c7;
  --white: #ffffff;
  --error: #a5352a;
  --error-bg: #fbecea;
  --ok: #3f6b3a;
  --ok-bg: #edf4ea;
  --focus: 0 0 0 3px rgba(176, 141, 106, .35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brown); font-weight: 600; text-decoration: none; }
a:hover { color: var(--tan); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sign-in pages ---------- */
.page { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.brand {
  position: relative; overflow: hidden; padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 600px at 110% 120%, rgba(176,141,106,.28), transparent 60%),
    linear-gradient(160deg, #fbf8f4 0%, var(--sand) 55%, #efe5d9 100%);
  border-right: 1px solid var(--line);
}
.wordmark-name { font-size: 26px; font-weight: 700; color: var(--brown); letter-spacing: .01em; line-height: 1.1; }
.wordmark-tag { font-size: 13px; color: var(--muted); margin-top: 2px; }
.brand-bird { width: min(440px, 80%); align-self: center; margin: 24px 0; filter: drop-shadow(0 18px 24px rgba(86,68,52,.15)); }
.brand-copy h2 { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--brown); }
.brand-copy p { margin: 0; font-style: italic; letter-spacing: .08em; color: var(--tan); font-size: 17px; }
.brand-copy .rule { width: 48px; height: 2px; background: var(--tan); margin: 18px 0 0; border: 0; }

.panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; background: var(--white); }
.card { width: 100%; max-width: 380px; }
.mobile-mark { display: none; }

.auth h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--brown); }
.sub { margin: 0 0 28px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.alert { margin: 0 0 20px; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.45;
  background: var(--error-bg); color: var(--error); border: 1px solid #efc9c3; }
.alert.info { background: #f3efe8; color: var(--brown); border-color: var(--line); }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #cfe0ca; }
.alert[hidden] { display: none; }

.field { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--brown); margin-bottom: 7px; letter-spacing: .02em; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.input-wrap { position: relative; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"] {
  width: 100%; height: 46px; padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #fdfcfa; border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover { border-color: #cbbfb0; }
input:focus { outline: none; border-color: var(--tan); box-shadow: var(--focus); background: var(--white); }
.input-wrap input { padding-right: 64px; }
input.code { font-size: 24px; letter-spacing: .4em; text-align: center; height: 56px; font-variant-numeric: tabular-nums; }
.toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--tan); cursor: pointer;
}
.toggle:hover { color: var(--brown); background: var(--sand); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 24px; font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; margin: 0; font-weight: 400; }
.check input { width: 16px; height: 16px; accent-color: var(--brown); margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--white); background: var(--brown); text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brown-dark); color: var(--white); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn.block { width: 100%; }
.btn.small { height: 34px; padding: 0 12px; font-size: 11.5px; letter-spacing: .12em; }
.btn.ghost { background: transparent; color: var(--brown); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--sand); color: var(--brown); }
.btn.danger { background: transparent; color: var(--error); border: 1px solid #efc9c3; }
.btn.danger:hover { background: var(--error-bg); color: var(--error); }

.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--faint); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
[hidden] { display: none !important; }

.secure { display: flex; gap: 10px; align-items: flex-start; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.secure svg { flex: none; margin-top: 2px; color: var(--tan); }
.nowrap { white-space: nowrap; }
.auth footer { margin-top: 36px; font-size: 12px; color: var(--faint); text-align: center; line-height: 1.7; }
.auth footer a { font-weight: 400; color: var(--faint); }

.qr { display: flex; justify-content: center; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; }
.qr svg { display: block; width: 220px; height: 220px; max-width: 100%; }
.secret { font-family: Consolas, "Courier New", monospace; font-size: 14px; letter-spacing: .06em; background: var(--sand);
  border: 1px dashed var(--line); padding: 10px 12px; border-radius: 8px; text-align: center; word-break: break-all; margin-bottom: 22px; }
ol.steps { margin: 0 0 18px; padding-left: 20px; font-size: 14px; color: var(--muted); line-height: 1.6; }
ol.steps li { margin-bottom: 4px; }

@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }
  .brand { display: none; }
  .panel { background: var(--sand); padding: 32px 16px; justify-content: flex-start; }
  .card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 28px 22px; margin-top: 8px; box-shadow: 0 10px 30px rgba(86,68,52,.08); }
  .mobile-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
  .mobile-mark img { width: 64px; }
  .mobile-mark span { font-weight: 700; font-size: 19px; color: var(--brown); }
  .auth h1 { font-size: 19px; }
}

/* ---------- Signed-in pages ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--brown); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--brown); }
.logo img { width: 54px; }
.logo b { display: block; font-size: 17px; line-height: 1.1; }
.logo small { display: block; font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--tan); font-weight: 600; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.nav a:hover { background: var(--sand); color: var(--brown); text-decoration: none; }
.nav a.on { color: var(--brown); background: var(--sand); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 6px 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--brown); cursor: pointer; border-radius: 6px; }
.linkbtn:hover { background: var(--sand); }

main.wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 24px; color: var(--brown); font-weight: 700; }
.head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.eyebrow { font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--tan); font-weight: 700; margin-bottom: 6px; }
.box { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 22px; }
.box h2 { margin: 0 0 14px; font-size: 15px; color: var(--brown); letter-spacing: .04em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid2 > .box { margin-bottom: 0; }
.stack > * + * { margin-top: 22px; }
.top-gap, .box .top-gap { margin-top: 26px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #eee7de; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.docname { font-weight: 600; color: var(--ink); word-break: break-word; }
.desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--sand); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.warn { background: #fdf4e3; color: #8a5a12; border-color: #f0dcb5; }
.badge.bad { background: var(--error-bg); color: var(--error); border-color: #efc9c3; }
.badge.good { background: var(--ok-bg); color: var(--ok); border-color: #cfe0ca; }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty img { width: 90px; opacity: .55; display: block; margin: 0 auto 10px; }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 180px; }
.inline-form input[type="email"], .inline-form input[type="text"] { height: 42px; }
.inline-form .btn { height: 42px; }
input[type="file"] { font: inherit; font-size: 14px; width: 100%; padding: 10px; border: 1px dashed var(--tan); border-radius: 8px; background: #fdfcfa; }

.flashes { margin-bottom: 18px; }
.creds { font-family: Consolas, "Courier New", monospace; font-size: 22px; letter-spacing: .06em; padding: 14px; background: var(--sand); border: 1px dashed var(--tan); border-radius: 8px; text-align: center; margin: 8px 0 14px; user-select: all; }
.narrow { max-width: 520px; }
.site-foot { text-align: center; font-size: 12px; color: var(--faint); padding: 0 16px 32px; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .who span { display: none; }
  main.wrap { padding: 22px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  td, th { padding-left: 6px; padding-right: 6px; }
  .box { padding: 16px; }
}
