:root {
  color-scheme: dark;
  --bg: #020706;
  --panel: #050d0b;
  --text: #ffffff;
  --muted: #8ea59c;
  --primary: #19f0b0;
  --primary-dark: #0fb98a;
  --primary-soft: #19f0b0;
  --accent: var(--primary);
  --border: rgba(25, 240, 176, 0.2);
  --line: rgba(255, 255, 255, 0.07);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 55% 45% at 30% 45%, rgba(25, 240, 176, 0.1), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(25, 240, 176, 0.14) 1px, transparent 1.5px) 0 0 / 38px 38px,
    linear-gradient(180deg, #03100c 0%, var(--bg) 100%);
  color: var(--text);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

/* network pill */
.net-pill {
  position: absolute;
  top: 24px;
  right: 6vw;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 20, 15, 0.7);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.net-pill i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse 2s ease-in-out infinite;
}

/* layout: visual left, card right (DOM keeps card first) */
.auth-page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 5.5rem 1.25rem 4rem;
  align-items: center;
  justify-items: center;
}

@media (min-width: 1024px) {
  .auth-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4rem clamp(2rem, 6vw, 6rem) 4rem;
    max-width: 1280px;
    margin: 0 auto;
  }
  .auth-visual { order: -1; }
}

/* card */
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2.25rem 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(8, 24, 19, 0.92), rgba(4, 12, 10, 0.95));
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(25, 240, 176, 0.05);
  animation: rise 0.8s var(--ease) both;
}

.auth-topbar { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-brand { display: inline-flex; position: relative; }
.auth-brand img { height: 54px; width: auto; filter: drop-shadow(0 6px 18px rgba(25, 240, 176, 0.25)); }

.auth-card h1 {
  margin: 0 0 0.45rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-card p {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.text-center { text-align: center; }

/* fields */
.auth-field { display: grid; gap: 0.5rem; margin: 0 0 1.1rem; }
.auth-field label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-left: 4px;
}
.field-with-icon { position: relative; }
.field-with-icon .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--primary);
  opacity: 0.8;
  pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.1rem 0.85rem 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(2, 8, 6, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}
.auth-field input::placeholder { color: rgba(142, 165, 156, 0.55); }
.auth-field input:hover { border-color: rgba(25, 240, 176, 0.4); }
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(25, 240, 176, 0.1);
}
.auth-field input[disabled] { cursor: not-allowed; color: var(--muted); }

/* button */
.auth-btn {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(25, 240, 176, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, #1af5b4 0%, #0fc994 100%);
  color: #03150e;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s;
  box-shadow: 0 10px 28px rgba(25, 240, 176, 0.18);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(25, 240, 176, 0.3); filter: brightness(1.05); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(25, 240, 176, 0.25); }

/* links */
.card .auth-note, .auth-card .auth-note {
  margin: 1.2rem 0 0.9rem;
  text-align: center;
  font-size: 0.75rem;
}
.auth-note a { font-weight: 600; }
.auth-links { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.9rem; }
.auth-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(2, 8, 6, 0.8);
  color: #cfe3da;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.3s var(--ease), color 0.3s, transform 0.3s var(--ease);
}
.auth-links a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.auth-icon, .input-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-icon { width: 15px; height: 15px; }

/* terms row (register) */
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.gap-2 { gap: 0.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-decoration-none { text-decoration: none !important; }
.fw-semibold { font-weight: 600 !important; }
.text-danger { color: #ff6b6b !important; }
.small { font-size: 0.78rem !important; }
.form-check-label { cursor: pointer; line-height: 1.4; }
.form-check-input {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.1rem; height: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(2, 8, 6, 0.85);
  cursor: pointer;
  display: grid; place-content: center;
  transition: background 0.25s, border-color 0.25s;
}
.form-check-input:checked { background: var(--primary); border-color: var(--primary); }
.form-check-input:checked::after { content: ""; width: 5px; height: 9px; border: solid #03150e; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* left visual */
.auth-visual { width: 100%; display: grid; place-items: center; }
.orbit-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 380px; animation: rise 0.9s var(--ease) 0.1s both; }
.orbit { position: relative; width: min(340px, 82vw); aspect-ratio: 1; margin-bottom: 1.5rem; }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(25, 240, 176, 0.14); }
.ring.r1 { inset: 0; }
.ring.r2 { inset: 11%; border-style: dashed; animation: spin 60s linear infinite; }
.ring.r3 { inset: 22%; }
.orbit::before {
  content: ""; position: absolute; inset: 20%; border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 240, 176, 0.22), transparent 70%);
}
.orbit-core {
  position: absolute; left: 50%; top: 50%;
  width: 28%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 24%;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #0b1f19, #040c0a);
  box-shadow: 0 0 40px rgba(25, 240, 176, 0.2);
  animation: breathe 4s ease-in-out infinite;
}
.orbit-core img { width: 46%; height: auto; }
.orb-chip {
  position: absolute;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(3, 12, 9, 0.92);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: floaty 5s ease-in-out infinite;
}
.c-up { left: 50%; top: 10%; }
.c-in { left: 93%; top: 40%; animation-delay: -1s; }
.c-re { left: 7%; top: 40%; animation-delay: -2s; }
.c-sp { left: 25%; top: 88%; animation-delay: -3s; }
.c-dn { left: 77%; top: 88%; animation-delay: -4s; }
.nc-pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(25, 240, 176, 0.07);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.visual-title { margin: 0 0 0.6rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.visual-text { margin: 0; font-size: 0.8rem; line-height: 1.7; color: var(--muted); }

.auth-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
}

/* loader (unchanged behaviour: toggled via .is-active) */
.loader { position: fixed; inset: 0; display: none; place-items: center; z-index: 9999; }
.loader.is-active { display: grid; }
.loader-bg { position: absolute; inset: 0; background: rgba(1, 8, 6, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.loader-main {
  position: relative; z-index: 1;
  width: min(92vw, 420px);
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 24, 19, 0.98), rgba(3, 10, 8, 0.98));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
  padding: 2rem 1.8rem;
  text-align: center;
}
.loader-text { margin: 1.25rem auto 0; max-width: 315px; color: #f2fbf7; font-size: 0.92rem; font-weight: 600; line-height: 1.55; }
.logo-loader {
  position: relative; width: 78px; height: 78px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), rgba(25, 240, 176, 0.15), var(--primary));
  box-shadow: 0 0 34px rgba(25, 240, 176, 0.25);
  animation: spin 1s linear infinite;
}
.logo-loader::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #030b08; }
.logo-loader::after {
  content: "DT"; position: absolute; inset: 17px; display: grid; place-items: center;
  border-radius: 50%; color: #03150e; background: var(--primary);
  font-size: 16px; font-weight: 800;
  animation: counter-spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes counter-spin { to { transform: rotate(-360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 30px rgba(25, 240, 176, 0.15); } 50% { box-shadow: 0 0 55px rgba(25, 240, 176, 0.32); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1023px) {
  .auth-page { padding-top: 5rem; padding-bottom: 5rem; }
  .net-pill { right: 1.25rem; top: 18px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem 1.5rem; }
  .visual-title { font-size: 1.25rem; }
}

/* ---- combined login / public view card ---- */
.brand-fixed { position: absolute; top: 18px; left: 6vw; z-index: 5; }
.brand-fixed img { height: 48px; width: auto; filter: drop-shadow(0 6px 18px rgba(25, 240, 176, 0.25)); }

.auth-btn-pill {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  padding: 0.8rem 1.7rem;
  min-height: 46px;
  background: #1af5b4;
  color: #03150e;
}
.auth-btn-pill .auth-icon { width: 17px; height: 17px; }

.auth-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(25, 240, 176, 0.14);
  color: var(--primary);
  border: 1px solid rgba(25, 240, 176, 0.4);
  box-shadow: 0 0 24px rgba(25, 240, 176, 0.08);
}
.auth-btn-outline:hover { background: rgba(25, 240, 176, 0.22); color: #fff; }

.wallet-line { margin: 0.9rem 0 0; display: flex; flex-direction: column; gap: 0.3rem; text-align: center; }
.wallet-line label { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.wallet-line input {
  width: 100%; border: 0; background: none; outline: 0; text-align: center;
  color: var(--primary); font: inherit; font-size: 0.72rem; text-overflow: ellipsis;
}
.wallet-line input::placeholder { color: rgba(142, 165, 156, 0.5); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 1.2rem 0 1.1rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-divider span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 1.1rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(2, 8, 6, 0.85);
}
.auth-tab {
  border: 1px solid transparent; border-radius: 999px; padding: 0.6rem 0.5rem;
  background: none; color: var(--muted);
  font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s, border-color 0.3s;
}
.auth-tab:hover { color: #fff; }
.auth-tab.is-active { background: rgba(25, 240, 176, 0.16); border-color: rgba(25, 240, 176, 0.45); color: var(--primary); }

.auth-field #username { padding-left: 1.2rem; border-radius: 16px; min-height: 52px; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.02em; }
.auth-card > .auth-btn-pill + .wallet-line + .auth-divider { margin-top: 1rem; }
@media (max-width: 1023px) { .brand-fixed { left: 1.25rem; top: 14px; } }
