/* Tetkik app — Step 0 styles. Values come from replica/design/tokens.css
   (Tetkik's own brand). The app is always light. No inline styles/scripts,
   to keep the same CSP posture as the website. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-opsz-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

:root {
  --bg:#faf8f7; --surface:#fff; --surface-tint:#f3e6e8; --border:#e9e3e4;
  --border-input:#8a8183; --text:#1c1416; --text-muted:#6b6264;
  --accent:#73081d; --accent-edge:#8e2236; --on-accent:#faf8f7;
  --danger:#8e2236; --success:#2f6b4f; --info:#2f5d7c; --focus:#e0566f;
  --font:"Inter",Arial,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --r-sm:8px; --r-md:12px; --r-lg:20px; --pill:999px;
  --shadow-card:0 1px 2px rgba(28,20,22,.05),0 1px 3px rgba(28,20,22,.08);
  --ease:cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position:absolute; left:-9999px; }
.skip-link:focus { left:16px; top:16px; background:var(--text); color:var(--bg); padding:10px 14px; border-radius:8px; z-index:10; }

/* ---------- pre-auth pages (login, application, demo, set password) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 960px; width: 100%; align-items: center; }
.auth-intro h1 { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 20px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); }
.auth-points .chk { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--surface-tint); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 32px; }
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-head img { width: 36px; height: 36px; border-radius: 10px; }
.auth-head .word { font-size: 20px; font-weight: 600; }
.auth-tag { color: var(--text-muted); font-size: 14px; margin: 0 0 22px; }
.auth-title { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.auth-sub { color: var(--text-muted); font-size: 15px; margin: 0 0 20px; }
@media (max-width: 760px) { .auth-grid { grid-template-columns: 1fr; gap: 28px; } .auth-intro { display: none; } }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 14px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--text-muted); }
.field input, .field select, .field textarea {
  min-height: 48px; padding: 0 14px; border: 1px solid var(--border-input);
  border-radius: var(--r-md); font: 400 16px var(--font); color: var(--text);
  background: var(--surface); width: 100%;
}
.field textarea { min-height: 90px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--surface-tint);
}
.field .hint { font-size: 13px; color: var(--text-muted); }
.field.invalid input { border-color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }

.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw .eye { position: absolute; right: 8px; top: 8px; height: 32px; width: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-muted); font-size: 15px; }

.checkrow { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 18px; }
.checkrow input { width: 16px; height: 16px; }

/* buttons */
.btn { min-height: 48px; padding: 0 20px; border-radius: var(--pill); border: 1px solid transparent; font: 600 16px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background var(--ease) .2s, border-color var(--ease) .2s; text-decoration: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--text); border-color: var(--text); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-input); }
.btn-secondary:hover { background: var(--bg); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--surface-tint); color: var(--accent); }
.btn-danger { background: var(--danger); color: var(--on-accent); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.auth-links { display: flex; gap: 10px; align-items: center; font-size: 14px; margin-top: 14px; flex-wrap: wrap; }
.auth-links a { color: var(--text-muted); }
.auth-links a.strong { color: var(--accent); font-weight: 600; background: var(--surface-tint); padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.auth-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.auth-foot a { font-weight: 600; }

.banner { border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; margin-bottom: 18px; }
.banner-info { background: var(--surface-tint); color: var(--accent); }
.banner-error { background: #f6e2e4; color: var(--danger); }
.banner-ok { background: #e3efe9; color: var(--success); }

.note-dev { background: #fff6d6; border: 1px solid #e8d7a0; color: #6b541a; border-radius: var(--r-md); padding: 10px 14px; font-size: 13px; }

/* ---------- app shell (dashboard) ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar img { width: 28px; height: 28px; border-radius: 8px; }
.topbar .word { font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .ava { width: 34px; height: 34px; border-radius: 999px; background: var(--surface-tint); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.topbar form { margin: 0; }
.shell-body { flex: 1; display: flex; }
.nav { width: 230px; border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 15px; }
.nav a.active { color: var(--accent); background: var(--surface-tint); font-weight: 600; position: relative; }
.nav a.active::before { content:""; position:absolute; left:0; top:9px; bottom:9px; width:3px; border-radius:2px; background:var(--accent); }
.nav a:hover:not(.active) { background: var(--bg); color: var(--text); }
.main { flex: 1; padding: 32px; }
.empty { max-width: 420px; margin: 56px auto; text-align: center; }
.empty .ic { width: 60px; height: 60px; border-radius: 999px; background: var(--surface-tint); color: var(--accent); display: grid; place-items: center; margin: 0 auto 18px; font-size: 26px; }
.empty h2 { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.empty p { color: var(--text-muted); margin: 0 0 20px; }
@media (max-width: 720px) { .shell-body { flex-direction: column; } .nav { width: auto; flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); } .main { padding: 20px; } }

/* ---------- dev approvals table ---------- */
.page { max-width: 960px; margin: 0 auto; padding: 40px 20px 80px; }
.page h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.tbl th { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tbl tr:last-child td { border-bottom: 0; }
.kind { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.kind.demo { background: var(--blue-tint,#e6eef4); color: var(--info); }
.kind.account { background: var(--surface-tint); color: var(--accent); }
.status { font-size: 12px; font-weight: 600; }
.status.pending { color: var(--text-muted); }
.status.approved { color: var(--success); }
.status.rejected { color: var(--danger); }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 8px; }
.invite-link { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 8px; display: inline-block; margin-top: 6px; }
