:root {
  --bg: #07110d;
  --surface: rgba(16, 35, 27, 0.9);
  --surface-2: #132b21;
  --line: rgba(167, 243, 208, 0.14);
  --text: #ecfdf5;
  --muted: #9fb8aa;
  --green: #32d583;
  --green-strong: #12b76a;
  --amber: #fdb022;
  --danger: #f97066;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

button { cursor: pointer; }

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(50, 213, 131, 0.18), transparent 31rem),
    radial-gradient(circle at 92% 18%, rgba(253, 176, 34, 0.1), transparent 26rem),
    linear-gradient(145deg, #07110d 0%, #0a1912 52%, #07110d 100%);
}

.shell {
  position: relative;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  margin-bottom: clamp(42px, 7vw, 90px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  color: #062d1b;
  background: linear-gradient(145deg, #6ce9a6, #32d583);
  box-shadow: 0 12px 30px rgba(50, 213, 131, 0.2);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 0.78rem; }

.top-actions, .dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
}

.badge-muted { color: var(--muted); background: rgba(255, 255, 255, 0.035); }
.badge-online { color: #a7f3d0; background: rgba(50, 213, 131, 0.12); border-color: rgba(50, 213, 131, 0.3); }

.view[hidden] { display: none !important; }

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(36px, 8vw, 100px);
}

.intro { max-width: 570px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5.2vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 { margin-bottom: 6px; font-size: 1.15rem; }

.intro > p:not(.eyebrow) {
  max-width: 55ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #a7f3d0;
  background: rgba(0, 0, 0, 0.2);
  overflow-wrap: anywhere;
}

.check-list {
  display: grid;
  gap: 11px;
  margin: 28px 0 0;
  padding: 0;
  color: #cfe9dc;
  list-style: none;
}

.check-list li { display: flex; align-items: flex-start; gap: 10px; }
.check-list li::before { content: "✓"; color: var(--green); font-weight: 900; }

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20, 46, 35, 0.92), rgba(11, 27, 20, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-card {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 38px);
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 4px;
}

.card-heading p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.step {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #062d1b;
  background: var(--green);
  font-weight: 900;
}

label { display: grid; gap: 8px; color: #d8eee3; font-size: 0.88rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(167, 243, 208, 0.18);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(3, 12, 8, 0.48);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(50, 213, 131, 0.12); }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
}

.button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary { color: #052e1b; background: linear-gradient(135deg, #6ce9a6, #32d583); }
.button-ghost { color: #d8eee3; border-color: var(--line); background: rgba(255, 255, 255, 0.035); }
.button-danger { color: #fecaca; border-color: rgba(249, 112, 102, 0.28); background: rgba(249, 112, 102, 0.1); }
.button-small { min-height: 34px; padding: 0 12px; font-size: 0.78rem; }

.message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(430px, calc(100% - 40px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #132b21;
  box-shadow: var(--shadow);
}

.message-error { border-color: rgba(249, 112, 102, 0.45); background: #351713; }
.message-success { border-color: rgba(50, 213, 131, 0.45); }

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.dashboard h1 { margin-bottom: 10px; font-size: clamp(2.3rem, 4vw, 3.8rem); }
.muted { color: var(--muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 35, 26, 0.78);
}

.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { min-height: 42px; font-size: 0.82rem; font-weight: 700; }
.stat-card strong { display: block; margin: 13px 0 8px; font-size: 2.2rem; letter-spacing: -0.05em; }
.stat-card small { font-size: 0.76rem; }

.empty-state {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 24px;
}

.empty-state p { margin: 0; color: var(--muted); line-height: 1.6; }
.empty-icon { display: grid; width: 50px; height: 50px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: #052e1b; background: var(--green); font-weight: 900; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-grid { grid-template-columns: 1fr; }
  .intro { max-width: 680px; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 22px, 1160px); padding-top: 12px; }
  .topbar { align-items: flex-start; margin-bottom: 42px; }
  .top-actions { align-items: flex-end; flex-direction: column; }
  .badge { display: none; }
  h1 { font-size: 2.45rem; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions .button { flex: 1; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 140px; }
  .empty-state { align-items: flex-start; }
}
