:root {
  --bg: #0c0f14;
  --bg-card: #141a24;
  --border: #243044;
  --text: #e8edf5;
  --muted: #8b9cb3;
  --accent: #3dd6c6;
  --accent-dim: #2a9d8f;
  --danger: #f07178;
  --success: #7ee787;
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }

.page-auth {
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -20% -10% auto auto;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(61, 214, 198, 0.18), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .shell { grid-template-columns: 1fr 420px; min-height: 100vh; }
}

.brand .logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand .logo span { color: var(--accent); }

.tagline { color: var(--muted); line-height: 1.55; max-width: 36ch; }

.features {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.features li {
  padding: 8px 0 8px 28px;
  position: relative;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.card h2 { margin: 0 0 12px; font-size: 1.1rem; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: #0a0d12;
  border-radius: 12px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tab.active {
  background: var(--border);
  color: var(--text);
}

.panel[hidden] { display: none; }

.muted { color: var(--muted); }
.muted.small, .small { font-size: 0.875rem; }

.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 0.875rem; color: var(--muted); }
.field input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a0d12;
  color: var(--text);
  font: inherit;
}
.field input:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04201c;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.small { padding: 8px 12px; font-size: 0.875rem; }

.error { color: var(--danger); font-size: 0.9rem; margin-top: 12px; }
.alert {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}
.success { color: var(--success); }

.tg-widget { min-height: 48px; margin: 20px 0 8px; }

/* App layout */
.page-app { min-height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.topbar .logo { font-weight: 700; font-size: 1.25rem; }
.topbar .logo span { color: var(--accent); }

.app-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  gap: 20px;
}

.highlight {
  border-color: rgba(61, 214, 198, 0.35);
  background: linear-gradient(160deg, #141a24, #101820);
}

.inbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.inbox-row code {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  background: #0a0d12;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  word-break: break-all;
}

.steps { color: var(--muted); padding-left: 1.2rem; }
.muted-card { opacity: 0.85; }
