:root {
  color-scheme: dark;
  --bg: #121218;
  --surface: rgba(29, 29, 38, 0.94);
  --surface-raised: #252530;
  --line: rgba(228, 224, 239, 0.12);
  --text: #f4f0f7;
  --muted: #aaa5b2;
  --accent: #e48f88;
  --accent-strong: #efa69d;
  --success: #94d5b4;
  --danger: #ef9d9d;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse at 70% -10%, rgba(111, 81, 118, 0.2), transparent 44%),
    radial-gradient(ellipse at 0% 80%, rgba(172, 106, 101, 0.08), transparent 40%),
    var(--bg);
}

a { color: var(--accent-strong); text-underline-offset: 3px; }
button, input { font: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
}
.ambient-one { top: 16%; left: 72%; background: #8a668f; }
.ambient-two { bottom: -12rem; left: -8rem; background: #c77c76; }

.topbar {
  width: min(1160px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.045em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #17151b;
  background: var(--accent);
  border-radius: 10px;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 800;
}
.brand-dot { color: var(--accent); }
.topbar-label, .eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.shell {
  width: min(1160px, calc(100% - 48px));
  min-height: calc(100vh - 144px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 56px 0 72px;
}
.card {
  width: min(100%, 468px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card.wide { width: min(100%, 880px); }
.eyebrow { margin: 0 0 15px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.055em;
}
h2 { font-size: 20px; letter-spacing: -0.035em; }
h3 { margin: 0 0 8px; font-size: 15px; }
.lead { margin-bottom: 26px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.brand-large { margin-bottom: 28px; }

.form-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label { color: #ded9e5; font-size: 12px; font-weight: 650; }
.field input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #17171e;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 143, 136, 0.13); }
input::placeholder { color: #77727e; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #1a171d;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-1px); background: var(--accent-strong); }
.button:disabled { opacity: 0.6; cursor: wait; transform: none; }
.button.secondary {
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}
.button.secondary:hover { background: var(--surface-raised); }
.button.danger { color: var(--danger); border-color: rgba(239,157,157,0.24); background: transparent; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.text-link { display: inline-block; margin-top: 20px; font-size: 13px; }
.form-actions { margin-top: 6px; }
.message {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.025);
  font-size: 12px;
  line-height: 1.5;
}
.token-box { display: flex; gap: 8px; margin-top: 12px; }
.token-box input { min-width: 0; flex: 1; font-size: 12px; }

.dashboard { width: 100%; align-self: start; }
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
}
.dashboard-head .lead { margin-bottom: 0; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.panel.full { grid-column: 1 / -1; }
.panel p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.invite-list { display: grid; gap: 9px; margin-top: 18px; }
.invite-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.invite-email { overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.invite-status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; }
.loading { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  width: min(1160px, calc(100% - 48px));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: #77727e;
  font-size: 11px;
}

@media (max-width: 680px) {
  .topbar, .shell, .site-footer { width: min(100% - 32px, 1160px); }
  .topbar { height: 70px; }
  .topbar-label { max-width: 130px; text-align: right; line-height: 1.5; }
  .shell { min-height: calc(100vh - 132px); padding: 34px 0 44px; }
  .card { padding: 25px 21px; border-radius: 17px; }
  .dashboard-head { flex-direction: column; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel.full { grid-column: auto; }
  .invite-row { grid-template-columns: 1fr auto; }
  .invite-status { grid-column: 1; grid-row: 2; }
  .invite-row .button { grid-column: 2; grid-row: 1 / span 2; }
  .site-footer { align-items: flex-start; justify-content: center; flex-direction: column; padding: 14px 0; gap: 5px; }
}
