:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --fg: #e6e9ef;
  --fg-dim: #9aa3b2;
  --accent: #6cc4ff;
  --accent-2: #4ade80;
  --danger: #f87171;
  --warn: #fbbf24;
  --border: #1f242e;
  --code-bg: #0e1116;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.55;
  font-size: 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.brand .dot { color: var(--accent); }
nav a {
  color: var(--fg-dim);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
}
nav a:hover { color: var(--fg); }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 700;
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  color: var(--fg-dim);
  font-size: 1.15rem;
  max-width: 38em;
  margin: 0 0 2rem;
}
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: var(--accent); color: #00131f; }
.btn.primary:hover { background: #4db8f5; }
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--fg-dim); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 4rem;
}
.feature {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.feature h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--fg-dim); font-size: 0.95rem; }

.form-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
}
.form-card h1 {
  margin: 0 0 0.6rem;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}
.form-card .lede {
  color: var(--fg-dim);
  margin: 0 0 1.6rem;
}

form label {
  display: block;
  margin-bottom: 1.2rem;
}
form label span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}
form input:focus {
  outline: none;
  border-color: var(--accent);
}
form small { display: block; color: var(--fg-dim); font-size: 0.8rem; margin-top: 0.3rem; }
form button[type="submit"] { margin-top: 0.4rem; width: 100%; }

.error {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 0.9rem;
}

.success-banner {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.kv {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0;
  font-size: 0.95rem;
  align-items: center;
}
.kv .k { color: var(--fg-dim); }
.kv .v { font-family: var(--mono); font-size: 0.88rem; word-break: break-all; }
.kv .copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.kv .copy:hover { color: var(--fg); border-color: var(--fg-dim); }

.plan-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-badge.free { background: var(--border); color: var(--fg-dim); }
.plan-badge.pro  { background: var(--accent); color: #00131f; }

.section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.section h2 { font-size: 1.1rem; margin: 0 0 0.8rem; }
.section p  { color: var(--fg-dim); font-size: 0.95rem; margin: 0 0 0.8rem; }

.dev-note {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.dev-note summary { cursor: pointer; }
.dev-note code { font-family: var(--mono); background: var(--code-bg); padding: 0.1rem 0.3rem; border-radius: 3px; }
.dev-note ol { padding-left: 1.2rem; }
.dev-note li { margin-bottom: 0.3rem; }

.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

footer {
  text-align: center;
  padding: 2rem;
  color: var(--fg-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* T12: login page */
.login-divider {
  text-align: center;
  margin: 1.6rem 0;
  position: relative;
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-divider::before,
.login-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.btn.full-width { display: block; width: 100%; text-align: center; }
.g-logo {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  line-height: 1.1em;
  text-align: center;
  background: var(--fg);
  color: var(--bg);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85em;
  margin-right: 0.4em;
  vertical-align: -0.05em;
}
.lock-icon {
  display: inline-block;
  margin-right: 0.4em;
  vertical-align: -0.05em;
  font-size: 0.95em;
}

/* T12: /me dashboard */
#tenant-list {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0;
}
.tenant-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s;
}
.tenant-card:hover { border-color: var(--accent); }
.tenant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.tenant-name { font-weight: 600; font-size: 1.05rem; }
.tenant-issuer {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg-dim);
  word-break: break-all;
}

/* --- signup result: credentials shown once --- */

/* The "copy these now" notice. Deliberately loud: these values cannot be
   retrieved again, so missing this message costs the user their secret. */
.warn {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.warn code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.cred-row { margin-bottom: 1.1rem; }
.cred-row label { display: block; }
.cred-row > label > span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.cred-row small {
  display: block;
  margin-top: 0.35rem;
  color: var(--fg-dim);
  font-size: 0.82rem;
}

.cred-line {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.cred-line .btn { flex: 0 0 auto; white-space: nowrap; }

/* Monospaced and selectable: a secret that wraps mid-token is easy to
   mis-copy by hand when the clipboard API is unavailable. */
.cred-value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  color: var(--fg);
}
