/* Same design system as the generator: soft grey dotted canvas, light floating panels,
   large radii, pill buttons. Dark theme via html[data-theme="dark"] (set by theme.js). */
:root {
  --bg: #efefef;
  --dots: #cfcfcf;
  --surface: #fafafa;
  --white: #fff;
  --line: #e6e6e6;
  --line2: #dcdcdc;
  --text: #1c1c1c;
  --muted: #6f6f6f;
  --soft: #ededed;
  --danger: #d93f3f;
  --danger-bg: rgba(217, 63, 63, 0.08);
  --shadow: 0 1px 0 #fff inset, 0 12px 34px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --r-card: 28px;
  --r-item: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141414;
  --dots: #2c2c2c;
  --surface: #1d1d1d;
  --white: #242424;
  --line: #2d2d2d;
  --line2: #3a3a3a;
  --text: #ececec;
  --muted: #9b9b9b;
  --soft: #2a2a2a;
  --danger: #ef6a6a;
  --danger-bg: rgba(239, 106, 106, 0.1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 34px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dots) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
  color: var(--text);
  font: 15px/1.45 "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.muted { color: var(--muted); }

/* brand: capybara in the same white tile as the generator header */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; letter-spacing: -0.2px; white-space: nowrap; }
.brand .mark-box {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 12px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
}
.brand .mark { width: 24px; height: 24px; filter: invert(1); }
:root[data-theme="dark"] .brand .mark-box { background: #262626; }
:root[data-theme="dark"] .brand .mark { filter: none; }
.brand-dot { display: inline-block; margin: 0 -0.07em 0 -0.05em; }

/* login */
.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.auth-head { display: grid; gap: 4px; margin-bottom: 22px; justify-items: center; text-align: center; }
.auth-head .brand { margin-bottom: 16px; }
.auth-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.25; }

.alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--r-item);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

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

.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 2px; }

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-item);
  background: var(--white);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:hover:not(:disabled) { border-color: var(--line2); }
.field input:focus-visible { border-color: var(--line2); box-shadow: 0 0 0 4px var(--soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input:disabled { opacity: 0.5; cursor: not-allowed; }

.password { position: relative; display: block; }
.password input { padding-right: 46px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.reveal:hover { color: var(--text); background: var(--soft); }
.reveal[aria-pressed="true"] { color: var(--text); }
.reveal:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--line2); }

/* = generator .btn.dark */
button.primary {
  height: 44px;
  margin-top: 6px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: background 0.15s, transform 0.05s;
}
button.primary:hover:not(:disabled) { background: #333; }
:root[data-theme="dark"] button.primary:hover:not(:disabled) { background: #cfcfcf; }
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--line2); }
button.primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* signed-in placeholder shell (used only when the generator is not proxied) */
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-title { color: var(--muted); font-size: 14px; }
.logout { margin-left: auto; }
button.ghost { height: 34px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: var(--white); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
button.ghost:hover { background: var(--soft); }
.workspace { display: grid; place-items: center; min-height: calc(100% - 68px); padding: 24px; }
.empty { max-width: 460px; text-align: center; }
.empty h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.4px; }
.empty p { margin: 0; }

@media (max-width: 420px) {
  .auth-card { padding: 24px 18px 18px; border-radius: 22px; }
  .topbar-title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
