:root {
  --bg-1: #051224;
  --bg-2: #071a32;
  --bg-3: #0a2342;
  --panel: rgba(4, 17, 34, 0.84);
  --panel-2: rgba(8, 24, 48, 0.92);
  --border: rgba(129, 190, 255, 0.16);
  --text: #eef5ff;
  --muted: #9fb4d5;
  --muted-2: #7f95b8;
  --pill-1: #10385e;
  --pill-2: #0b2748;
  --button-1: #7bddff;
  --button-2: #6b7aff;
  --success: #70e0b2;
  --danger: #ff8698;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(70, 146, 255, 0.18), transparent 25%),
    radial-gradient(circle at 84% 23%, rgba(108, 121, 255, 0.12), transparent 28%),
    linear-gradient(120deg, var(--bg-1), var(--bg-2), var(--bg-3), var(--bg-1));
  background-size: 220% 220%;
  animation: pageGradient 18s ease infinite;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.background-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}
.blob-1 {
  width: 22rem;
  height: 22rem;
  left: 8%;
  top: 18%;
  background: rgba(86, 171, 255, 0.2);
  animation: driftOne 14s ease-in-out infinite;
}
.blob-2 {
  width: 18rem;
  height: 18rem;
  right: 12%;
  top: 15%;
  background: rgba(116, 112, 255, 0.18);
  animation: driftTwo 18s ease-in-out infinite;
}
.blob-3 {
  width: 16rem;
  height: 16rem;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  background: rgba(91, 255, 218, 0.12);
  animation: driftThree 16s ease-in-out infinite;
}

.page-shell,
.app-layout,
.dashboard-shell {
  position: relative;
  z-index: 1;
}
.center-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.glass-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(6, 18, 37, 0.92), rgba(4, 14, 28, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), var(--shadow);
  position: relative;
  overflow: hidden;
}
.glass-card::before,
.glass-card-lite::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 48%, rgba(74, 170, 255, 0.06), transparent 36%),
    radial-gradient(circle at 80% 20%, rgba(108, 121, 255, 0.07), transparent 28%);
  pointer-events: none;
}
.glass-card-lite {
  position: relative;
  border: 1px solid rgba(129, 190, 255, 0.12);
  background: linear-gradient(180deg, rgba(8, 20, 40, 0.72), rgba(5, 15, 30, 0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.hero-card {
  width: min(1180px, 100%);
  border-radius: 2rem;
  padding: 1.9rem;
}
.hero-card-wide {
  padding: 1.6rem 1.6rem 1.5rem;
}
.hero-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  gap: 1.2rem;
  align-items: stretch;
}
.hero-copy {
  display: flex;
  flex-direction: column;
}
.hero-user-chip {
  display: inline-flex;
  flex-direction: column;
  gap: .18rem;
  padding: .85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(129, 190, 255, 0.14);
  background: rgba(255,255,255,0.03);
}
.hero-user-kicker,
.metric-kicker,
.card-kicker,
.dashboard-user-kicker {
  color: var(--muted-2);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.secure-pill,
.auth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 210, 255, 0.34);
  background: linear-gradient(180deg, var(--pill-1), var(--pill-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 18px rgba(81, 179, 255, 0.12);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.secure-pill {
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.secure-pill:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 22px rgba(81, 179, 255, 0.16);
  border-color: rgba(129, 210, 255, 0.46);
}
.secure-pill-static { cursor: default; }
.hero-title,
.dashboard-title {
  margin: 1rem 0 0.75rem;
  font-size: clamp(3.1rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.dashboard-title {
  font-size: clamp(2.6rem, 4vw, 4rem);
}
.hero-subtitle,
.panel-text,
.sidebar-subtitle,
.auth-head p,
.dashboard-stat-card p,
.dashboard-lead,
.hero-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.hero-subtitle {
  max-width: 44rem;
  margin-bottom: 1.35rem;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin: 1.1rem 0 1.2rem;
}
.metric-card,
.auth-copy-card {
  padding: 1rem;
  border-radius: 1.15rem;
}
.metric-card strong,
.auth-copy-card strong {
  display: block;
  margin: .35rem 0 .45rem;
  font-size: 1rem;
}
.metric-card p,
.auth-copy-card small {
  color: var(--muted);
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}
.hero-actions-top { justify-content: flex-end; }
.hero-actions-main { margin-top: auto; }
.ghost-button,
.secondary-button,
.dashboard-menu-link,
.dashboard-logout,
.quick-links a {
  border: 1px solid rgba(145, 175, 220, 0.16);
  border-radius: 1rem;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: .95rem 1rem;
  transition: all .2s ease;
}
.ghost-button:hover,
.secondary-button:hover,
.dashboard-menu-link:hover,
.dashboard-menu-link.is-active,
.dashboard-logout:hover,
.quick-links a:hover {
  border-color: rgba(123, 195, 255, 0.3);
  background: linear-gradient(180deg, rgba(15, 49, 82, 0.7), rgba(10, 29, 53, 0.82));
}
.primary-button {
  border: 0;
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  color: #03111f;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--button-1), var(--button-2));
  box-shadow: 0 14px 34px rgba(104, 148, 255, 0.22);
}
.primary-link { display: inline-flex; align-items: center; justify-content: center; }
.hero-visual,
.dashboard-hero-visual {
  border-radius: 1.7rem;
  padding: 1rem;
}
.hero-animation,
.dashboard-animation {
  position: relative;
  width: 100%;
  min-height: 29rem;
  border-radius: 1.45rem;
  border: 1px solid rgba(123, 162, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(10, 24, 46, 0.34), rgba(8, 20, 40, 0.18)),
    radial-gradient(circle at center, rgba(39, 88, 175, 0.08), transparent 58%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.dashboard-animation { min-height: 22rem; }
.orbit, .halo {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.orbit {
  border: 1px solid rgba(72, 111, 218, 0.16);
  animation: spin linear infinite;
}
.o1 { width: 11rem; height: 11rem; animation-duration: 10s; }
.o2 { width: 17rem; height: 17rem; animation-duration: 15s; animation-direction: reverse; }
.o3 { width: 23rem; height: 23rem; animation-duration: 21s; }
.o4 { width: 30rem; height: 30rem; animation-duration: 28s; animation-direction: reverse; opacity: 0.7; }
.orbiter {
  position: absolute;
  left: 50%; top: 0;
  width: 0.85rem; height: 0.85rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #a6e3ff 30%, #7fd6ff 55%, #6c79ff 100%);
  box-shadow: 0 0 18px rgba(127,214,255,.9);
}
.beam {
  position: absolute;
  left: 50%; top: 50%;
  width: 2px;
  height: 17.5rem;
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(127,214,255,.82), rgba(127,214,255,.02));
  filter: drop-shadow(0 0 10px rgba(127,214,255,.3));
}
.b1 { transform: translate(-50%, -50%) rotate(22deg); animation: swingOne 12s ease-in-out infinite; }
.b2 { transform: translate(-50%, -50%) rotate(82deg); animation: swingTwo 14s ease-in-out infinite; opacity: .42; }
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(16px);
  mix-blend-mode: screen;
  opacity: 0.75;
}
.g1 {
  width: 8.75rem; height: 8.75rem;
  left: 24%; top: 32%;
  background: radial-gradient(circle, rgba(116,223,255,.24), transparent 68%);
  animation: driftOne 11s ease-in-out infinite;
}
.g2 {
  width: 11rem; height: 11rem;
  right: 22%; top: 28%;
  background: radial-gradient(circle, rgba(108,121,255,.20), transparent 70%);
  animation: driftTwo 14s ease-in-out infinite;
}
.g3 {
  width: 11rem; height: 11rem;
  left: 50%; bottom: 8%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(95,255,228,.08), transparent 72%);
  animation: driftThree 12s ease-in-out infinite;
}
.halo {
  border: 1px solid rgba(94,151,255,.12);
  animation: pulse 7s ease-in-out infinite;
}
.h1 { width: 13.75rem; height: 13.75rem; }
.h2 { width: 21.25rem; height: 21.25rem; animation-delay: -2s; }
.h3 { width: 28.75rem; height: 28.75rem; animation-delay: -4s; }
.core {
  position: absolute;
  left: 50%; top: 50%;
  width: 8.25rem; height: 8.25rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.92), rgba(130,212,255,.72) 24%, rgba(80,107,255,.62) 52%, rgba(27,44,108,.42) 74%, rgba(11,22,52,.02) 100%);
  box-shadow: 0 0 40px rgba(104,174,255,.42), 0 0 90px rgba(68,125,255,.18);
  animation: corePulse 5s ease-in-out infinite;
}
.hero-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(170,190,224,.72);
  font-size: 0.75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 8, 18, 0.42);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 20;
}
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  width: min(58rem, 100%);
  border-radius: 1.6rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(5, 18, 34, 0.96), rgba(6, 18, 38, 0.98));
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
  position: relative;
}
.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.95rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(145, 175, 220, 0.2);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(340px, .95fr);
  gap: 1.2rem;
}
.auth-panel {
  position: relative;
  z-index: 1;
}
.auth-panel-copy {
  padding: .4rem .2rem .2rem;
}
.auth-panel-form {
  padding: 1.15rem;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(8, 21, 42, 0.82), rgba(4, 13, 27, 0.96));
  border: 1px solid rgba(145, 175, 220, 0.12);
}
.auth-copy-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.35rem;
}
.auth-head h2 {
  margin: 0.75rem 0 0.35rem;
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.auth-tab {
  border: 1px solid rgba(145, 175, 220, 0.18);
  border-radius: 1rem;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all .2s ease;
}
.auth-tab.is-active {
  color: var(--text);
  border-color: rgba(123, 195, 255, 0.28);
  background: linear-gradient(180deg, rgba(15, 49, 82, 0.76), rgba(10, 29, 53, 0.92));
}
.auth-status {
  min-height: 1.5rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.auth-status.is-error { color: var(--danger); }
.auth-status.is-success { color: var(--success); }
.auth-form { display: none; gap: 0.95rem; }
.auth-form.is-active { display: grid; }
.field {
  display: grid;
  gap: 0.45rem;
}
.field span {
  color: var(--muted);
  font-size: 0.92rem;
}
.field input {
  width: 100%;
  border: 1px solid rgba(145, 175, 220, 0.16);
  border-radius: 0.95rem;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 0.95rem 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus {
  border-color: rgba(123, 195, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(92, 155, 255, 0.08);
}

.dashboard-shell {
  min-height: 100vh;
  padding: 1.35rem;
  display: grid;
  gap: 1.1rem;
}
.dashboard-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 1.45rem;
}
.dashboard-branding {
  display: flex;
  gap: .8rem;
  align-items: center;
}
.dashboard-branding strong {
  display: block;
  font-size: 1rem;
}
.dashboard-branding p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.dashboard-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .7rem;
}
.dashboard-menu-link {
  padding: .85rem 1rem;
  min-width: 8.5rem;
  text-align: center;
}
.dashboard-userbox {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem 1rem;
  border-radius: 1rem;
  min-width: 15rem;
  text-align: right;
}
.dashboard-userbox strong { font-size: 1rem; }
.dashboard-logout {
  margin-top: .45rem;
  text-align: center;
  padding: .75rem .9rem;
}
.dashboard-main-grid {
  display: grid;
  gap: 1.05rem;
}
.dashboard-hero-card,
.profile-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 1rem;
  border-radius: 1.7rem;
  padding: 1.15rem;
}
.profile-hero-card { grid-template-columns: 1fr; }
.dashboard-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
}
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1rem;
}
.dashboard-card-grid,
.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-stat-card {
  border-radius: 1.35rem;
  padding: 1.25rem;
  min-height: 12.5rem;
  grid-column: span 4;
}
.dashboard-stat-card h3 {
  margin: 0.45rem 0 0.6rem;
  font-size: 1.35rem;
}
.dashboard-stat-card-wide {
  grid-column: span 8;
}
.dashboard-mini-panel { min-height: 12.5rem; }
.dash-meta-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.dash-meta-row span {
  padding: .7rem .85rem;
  border-radius: .9rem;
  border: 1px solid rgba(145, 175, 220, 0.12);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: .9rem;
}
.quick-links {
  display: grid;
  gap: .7rem;
  margin-top: .9rem;
}
.quick-links a {
  text-align: center;
}
.profile-card-grid .dashboard-stat-card {
  grid-column: span 6;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes corePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.07); }
}
@keyframes pulse {
  0%, 100% { opacity: .45; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: .85; transform: translate(-50%, -50%) scale(1.03); }
}
@keyframes swingOne {
  0%, 100% { transform: translate(-50%, -50%) rotate(22deg); }
  50% { transform: translate(-50%, -50%) rotate(34deg); }
}
@keyframes swingTwo {
  0%, 100% { transform: translate(-50%, -50%) rotate(82deg); }
  50% { transform: translate(-50%, -50%) rotate(68deg); }
}
@keyframes driftOne {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, 10px, 0) scale(1.08); }
}
@keyframes driftTwo {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-18px, 16px, 0) scale(1.06); }
}
@keyframes driftThree {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-18px) scale(1.06); }
}
@keyframes pageGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 1100px) {
  .hero-grid,
  .dashboard-hero-card {
    grid-template-columns: 1fr;
  }
  .dashboard-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .dashboard-userbox { text-align: left; }
  .dashboard-menu { justify-content: flex-start; }
  .dashboard-stat-card,
  .dashboard-stat-card-wide,
  .profile-card-grid .dashboard-stat-card {
    grid-column: span 12;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .hero-metrics,
  .auth-copy-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .center-layout,
  .dashboard-shell { padding: 1rem; }
  .hero-card,
  .dashboard-hero-card,
  .dashboard-topbar,
  .dashboard-stat-card,
  .modal-card { padding: 1rem; }
  .hero-topbar,
  .hero-actions-top,
  .dashboard-actions,
  .hero-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-animation,
  .dashboard-animation {
    min-height: 19rem;
  }
  .o1 { width: 8rem; height: 8rem; }
  .o2 { width: 13rem; height: 13rem; }
  .o3 { width: 18rem; height: 18rem; }
  .o4 { width: 24rem; height: 24rem; }
  .beam { height: 13rem; }
  .core { width: 6.6rem; height: 6.6rem; }
  .h1 { width: 10rem; height: 10rem; }
  .h2 { width: 15rem; height: 15rem; }
  .h3 { width: 21rem; height: 21rem; }
}
