﻿:root {
  --bg: #060b16;
  --surface: rgba(13, 21, 34, 0.82);
  --surface-strong: rgba(18, 30, 48, 0.95);
  --text: #eef6ff;
  --muted: #9cb1cf;
  --accent: #24ceb3;
  --accent-strong: #159b87;
  --border: rgba(120, 158, 212, 0.25);
  --danger: #ff808b;
  --shadow: 0 28px 68px rgba(2, 8, 22, 0.48);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 0%, #14335c 0%, #0a152a 30%, #060b16 100%);
  overflow-x: hidden;
}

.bg-aurora {
  position: fixed;
  inset: -24% -14% auto -14%;
  height: 520px;
  background:
    radial-gradient(circle at 28% 50%, rgba(41, 207, 180, 0.28), transparent 63%),
    radial-gradient(circle at 72% 35%, rgba(88, 132, 255, 0.24), transparent 58%),
    radial-gradient(circle at 52% 65%, rgba(24, 167, 199, 0.16), transparent 64%);
  filter: blur(14px);
  animation: auroraDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(143, 175, 214, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 175, 214, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 52% 18%, black, transparent 76%);
  animation: gridDrift 36s linear infinite;
  pointer-events: none;
}

.bg-noise {
  position: fixed;
  inset: 0;
  opacity: 0.2;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.08) 0.7px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.05) 0.7px, transparent 0.7px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 1px;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 14px 44px;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(14, 23, 38, 0.88) 0%, rgba(10, 17, 30, 0.86) 100%);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 14px;
  overflow: visible;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(138, 242, 226, 0.15);
  pointer-events: none;
  animation: topbarPulse 3.4s ease-in-out infinite;
}

.topbar h1 {
  margin: 2px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 45px;
  letter-spacing: 0.4px;
}

.topbar-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 12px;
  font-weight: 700;
}

.mascot-wrap {
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px;
  background: linear-gradient(145deg, rgba(35, 212, 184, 0.26), rgba(47, 99, 227, 0.24));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.38);
  transform: translateY(-10px);
  animation: mascotFloat 4.2s ease-in-out infinite;
}

.mascot-wrap::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 999px;
  border: 1px solid rgba(134, 244, 223, 0.34);
  opacity: 0.55;
  animation: mascotRing 2.8s ease-in-out infinite;
}

.mascot {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 2px solid rgba(28, 193, 169, 0.8);
  object-fit: cover;
}

.auth-view {
  padding: 24px;
  animation: cardIn 0.5s ease both;
}

.auth-view h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 40px;
}

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

.tg-login-root {
  margin-top: 16px;
  min-height: 48px;
}

.error {
  color: var(--danger);
  margin-top: 12px;
}

.hidden {
  display: none;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.profile-name {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
}

.profile-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

#dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  padding: 16px;
  animation: cardIn 0.45s ease both;
}

#dashboard .panel:nth-child(1) {
  animation-delay: 0.02s;
}

#dashboard .panel:nth-child(2) {
  animation-delay: 0.06s;
}

#dashboard .panel:nth-child(3) {
  animation-delay: 0.1s;
}

#dashboard .panel:nth-child(4) {
  animation-delay: 0.14s;
}

#dashboard .panel:nth-child(5) {
  animation-delay: 0.18s;
}

.panel h3 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 20px;
}

.kv {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.kv span:last-child {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn,
a.btn {
  position: relative;
  overflow: hidden;
  appearance: none;
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  color: #042822;
  background: linear-gradient(140deg, #2be1c6 0%, #1cac98 100%);
  box-shadow: 0 12px 24px rgba(19, 159, 139, 0.28);
}

.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -38%;
  width: 30%;
  height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  opacity: 0;
}

.btn.primary:hover::after {
  opacity: 1;
  animation: shine 0.95s ease;
}

.btn.secondary {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(21, 33, 53, 0.74);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.copy-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  border: 1px dashed rgba(149, 177, 212, 0.34);
  border-radius: 10px;
  padding: 8px 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 183, 159, 0.5);
  border-radius: 999px;
  color: #8af2e2;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

.partners {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.partner {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 25, 40, 0.7);
}

.partner-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.partner-contact {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  border: 1px solid rgba(138, 242, 226, 0.35);
  background: rgba(8, 24, 29, 0.92);
  color: #d8fff8;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.2s ease;
}

.toast.error {
  border-color: rgba(255, 128, 139, 0.45);
  background: rgba(36, 10, 14, 0.92);
  color: #ffd9dd;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    border-color: rgba(150, 191, 255, 0.33);
    box-shadow: 0 30px 80px rgba(5, 10, 24, 0.55);
  }

  .btn:hover,
  a.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
  }
}

@media (max-width: 880px) {
  #dashboard {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .auth-view h2 {
    font-size: 28px;
  }

  .mascot-wrap {
    transform: translateY(-4px);
  }

  .mascot {
    width: 74px;
    height: 74px;
  }
}

@media (max-width: 540px) {
  .shell {
    padding: 16px 10px 36px;
  }

  .topbar {
    gap: 10px;
    padding: 14px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .topbar-sub {
    font-size: 13px;
  }

  .panel {
    padding: 14px;
  }

  .btn,
  a.btn {
    width: 100%;
  }

  .profile-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

@keyframes auroraDrift {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4%, -5%, 0) scale(1.06);
  }
}

@keyframes gridDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(34px);
  }
}

@keyframes topbarPulse {
  0%,
  100% {
    opacity: 0.32;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes mascotFloat {
  0%,
  100% {
    transform: translateY(-10px);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes mascotRing {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.03);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  from {
    transform: translateX(0) skewX(-22deg);
  }
  to {
    transform: translateX(360%) skewX(-22deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
