/* Conta Rakta. Neutral on purpose: the product the person came from gives the accent color. */
:root {
  --bg: #f6f6f4; --surface: #ffffff; --text: #18181b; --muted: #6b6b73; --line: #e4e4e0;
  --accent: #18181b; --accent-ink: #ffffff; --danger: #b42318; --danger-bg: #fef3f2;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0c0d; --surface: #161618; --text: #f4f4f5; --muted: #a1a1aa; --line: #2a2a2e;
    --accent: #f4f4f5; --accent-ink: #0c0c0d; --danger: #fda29b; --danger-bg: #2a1512; --shadow: none; }
}
.accent-crm { --accent: #e60000; --accent-ink: #fff; }
.accent-prospecta { --accent: #4f46e5; --accent-ink: #fff; }
.accent-adbase { --accent: #ea3a00; --accent-ink: #fff; }
.accent-rarik { --accent: #ff6b4a; --accent-ink: #18181b; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
body.wide main { align-items: flex-start; }
footer { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 20px 16px 28px; color: var(--muted); font-size: 13px; }
footer span:first-child { font-weight: 600; color: var(--text); }

.card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 28px 28px; }
.card header { text-align: center; margin-bottom: 22px; }
h1 { font-size: 22px; line-height: 1.25; margin: 14px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0; }
.sub { margin: 0; color: var(--muted); font-size: 14.5px; }
.lead { margin: 0 0 10px; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.sent { margin: 0 0 14px; font-size: 14.5px; overflow-wrap: anywhere; }

.mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 20px; flex: none; }

label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 6px; }
input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); font: inherit; }
input:focus-visible, .btn:focus-visible, .org:focus-visible, .link:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[name="code"] { letter-spacing: .4em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
form { display: grid; gap: 0; }
form .btn { margin-top: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 18px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn:hover { filter: brightness(.96); }
.btn[disabled] { opacity: .6; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.links { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.actions { display: grid; gap: 8px; margin-top: 18px; }

.notice { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.notice.is-info { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
[hidden] { display: none !important; }

.orgs { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.org { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.org:hover, .org.is-active { border-color: var(--accent); }
.org .mark { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
.org-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; flex: none; }
details { border-top: 1px solid var(--line); padding-top: 14px; }
summary { cursor: pointer; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
details[open] summary { color: var(--text); font-weight: 600; }

.scopes { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; }
.scopes li { padding: 11px 14px 11px 38px; position: relative; font-size: 14.5px; }
.scopes li + li { border-top: 1px solid var(--line); }
.scopes li::before { content: ""; position: absolute; left: 15px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.home { width: 100%; max-width: 720px; display: grid; gap: 16px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-head h1 { margin: 0 0 2px; font-size: 26px; }
.home-head .btn { width: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel .orgs { margin-bottom: 12px; }
.panel > .hint { margin: 0 0 14px; }
.panel > .hint + .products { margin-top: 0; }
.row { display: flex; gap: 8px; }
.row .btn { width: auto; margin-top: 0; }
.products { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.product { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.product-text { flex: 1; min-width: 0; }
.product-text p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.product .btn { width: auto; height: 38px; padding: 0 14px; font-size: 14px; }
.invites { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.invite { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.invite .mark { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
.invite-actions { display: flex; gap: 6px; flex: none; }
.invite-actions .btn { width: auto; height: 38px; padding: 0 14px; font-size: 14px; }
@media (max-width: 520px) {
  .card { padding: 26px 20px 22px; }
  .product, .invite { flex-wrap: wrap; }
  .product .btn { width: 100%; }
  .invite-actions { width: 100%; }
  .invite-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .org { transition: filter .12s, border-color .12s; } }
