:root {
  --bg-1: #050505;
  --bg-2: #161616;
  --panel: #0b0b0b;
  --card: #121212;
  --card-2: #1a1a1a;
  --line: #2a2a2a;
  --line-2: #3a3a3a;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --dim: #5c5c5c;
  --danger: #ff5c5c;
  --ok: #e6e6e6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}

.center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

img[src$="logo.png"] {
  mix-blend-mode: lighten;
}

.hero-logo {
  width: min(256px, 60vw);
  height: auto;
  animation: rise 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 56px;
  animation: fadeIn 1.2s 0.4s both;
}

.hero-actions .btn {
  width: 160px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, transform 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn:active:not(:disabled) {
  transform: scale(1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background: var(--text);
  color: #050505;
}

.btn-primary:hover:not(:disabled) {
  background: #cfcfcf;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: rise 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-card .mini-logo {
  display: block;
  width: 72px;
  margin: 0 auto 20px;
}

h1, .h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  animation: fadeIn 1s 0.2s both;
}

h2 {
  font-size: 22px;
  font-weight: 600;
}

.field {
  margin-bottom: 16px;
}

.input {
  width: 100%;
  padding: 15px 14px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.input:hover {
  border-color: #6a6a6a;
}

.input:focus {
  border-color: var(--text);
}

.input.code {
  font-family: 'Cascadia Mono', Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.error {
  color: var(--danger);
  text-align: center;
  font-size: 14px;
  min-height: 0;
  margin-top: 12px;
}

.error:empty {
  display: none;
}

.note {
  color: var(--ok);
  text-align: center;
  font-size: 14px;
  margin-top: 12px;
}

.note:empty {
  display: none;
}

.auth-card form .btn {
  margin-top: 12px;
}

.foot {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.foot a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
}

.foot a:hover {
  border-color: var(--text);
}

.price-card {
  max-width: 440px;
}

.plan {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #171717, #101010);
}

.plan-name {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.plan-price {
  font-size: 48px;
  font-weight: 700;
  margin: 10px 0 2px;
}

.plan-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.plan ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.plan li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: #d6d6d6;
}

.plan li svg {
  flex: none;
  margin-top: 2px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-in-out;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.sidebar-logo img {
  width: 50%;
  height: auto;
}

.nav {
  list-style: none;
  flex: 1;
  padding: 8px 0;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav button.active {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--text);
  color: var(--text);
}

.nav svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.who {
  padding: 10px 20px 4px;
  font-size: 13px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  min-width: 0;
}

.menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.35s ease both;
}

.section.narrow {
  max-width: 600px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h1 {
  margin: 0;
}

.box {
  background: var(--card-2);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 24px;
}

.box + .box {
  margin-top: 16px;
}

.box h2 {
  margin-bottom: 18px;
}

.box p {
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.readout {
  background: #232323;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
}

.readout small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.readout strong {
  font-size: 20px;
  font-weight: 600;
}

.mono {
  font-family: 'Cascadia Mono', Consolas, monospace;
  letter-spacing: 1px;
}

.stat {
  text-align: center;
  padding: 40px 24px;
}

.stat small {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.stat .big {
  font-size: 52px;
  font-weight: 700;
  margin: 12px 0 8px;
}

.stat .sub {
  color: var(--muted);
}

.steps {
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.steps li:first-child {
  padding-top: 0;
}

.steps .label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.steps .label span {
  color: var(--muted);
  font-size: 14px;
}

.steps .state {
  font-size: 14px;
  color: var(--dim);
  white-space: nowrap;
}

.steps .state.done {
  color: var(--text);
}

.steps .link-btn {
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-2);
  padding: 0;
}

.join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #232323;
  border-radius: 4px;
  padding: 14px 16px;
}

.join .mono {
  font-size: 16px;
}

.tiles {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  min-height: 400px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-content: flex-start;
}

.tile {
  position: relative;
  width: 215px;
  height: 215px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tile:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tile.selected {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.tile .tag {
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.tile .sel {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.tile .del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile .del:hover {
  color: var(--danger);
}

.tile.pending {
  cursor: default;
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.tile.pending:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pending .code {
  font-family: 'Cascadia Mono', Consolas, monospace;
  font-size: 22px;
  letter-spacing: 2px;
}

.pending .hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

.pending a {
  font-size: 13px;
}

.bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--text);
  width: 100%;
}

.empty {
  width: 100%;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.empty strong {
  font-size: 20px;
  font-weight: 500;
}

.loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  overflow: hidden;
  display: none;
}

.loader.on {
  display: block;
}

.loader::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--text);
  animation: load 1s ease-in-out infinite;
}

@keyframes load {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

dialog {
  margin: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: min(420px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

dialog h2 {
  margin-bottom: 12px;
}

dialog p {
  color: var(--muted);
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 92, 92, 0.4);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
}

@media (max-width: 900px) {
  .menu-btn {
    display: flex;
  }

  .sidebar {
    width: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 76px 16px 24px;
  }

  .tiles {
    padding: 16px;
    justify-content: center;
  }

  .tile {
    width: calc(50% - 8px);
    height: auto;
    aspect-ratio: 1;
  }

  .section-head {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .auth-card {
    padding: 24px;
  }

  .tile {
    width: 100%;
    aspect-ratio: auto;
    min-height: 150px;
  }
}
