:root {
  --bg-deep: #0b101c;
  --bg-mid: #121a2b;
  --accent: #2894ff;
  --accent-bright: #5ec0ff;
  --accent-glow: rgba(40, 148, 255, 0.32);
  --glass-bg: #121a2b;
  --glass-border: rgba(128, 168, 224, 0.16);
  --input-bg: rgba(11, 16, 28, 0.65);
  --input-bg-hover: rgba(11, 16, 28, 0.85);
  --text-main: #f2f6fc;
  --text-soft: #b2c7de;
  --text-muted: #98abc4;
  --danger: #f05d5d;
  --success: #31d48c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(58% 42% at 50% -10%, rgba(40, 148, 255, 0.22), transparent 72%),
    #0b101c;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav-title, .brand-title {
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hidden {
  display: none !important;
}

.center-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(3, 9, 18, 0.52);
}

.boot-card {
  width: 360px;
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.auth-card {
  width: 100%;
  max-width: 416px;
  padding: 30px 28px 26px;
  animation: fadeSlideUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.brand-logo {
  width: 82px;
  height: 82px;
  display: block;
  margin: 0 auto 8px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(60, 168, 255, 0.28));
}

.brand-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ed8ff;
  margin-bottom: 18px;
}

.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.seg-btn {
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(214, 236, 255, 0.12);
  background: rgba(14, 22, 36, 0.72);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.seg-btn:hover {
  background: rgba(26, 40, 62, 0.85);
  color: #fff;
}

.seg-btn.active {
  background: linear-gradient(135deg, #1b88eb 0%, #3caeff 100%);
  border-color: rgba(154, 218, 255, 0.45);
  color: #fff;
  box-shadow: 0 6px 18px rgba(32, 138, 238, 0.30);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(214, 236, 255, 0.14);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder {
  color: rgba(154, 180, 208, 0.56);
}

.field input:hover {
  background: var(--input-bg-hover);
}

.field input:focus {
  border-color: rgba(94, 192, 255, 0.68);
  background: rgba(40, 148, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(60, 168, 255, 0.16);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-primary {
  height: 44px;
  padding: 0 22px;
  border-radius: 9999px;
  border: 1px solid rgba(40, 148, 255, 0.72);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 22px rgba(40, 148, 255, 0.30);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(40, 148, 255, 0.40);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(214, 236, 255, 0.16);
  background: rgba(14, 22, 36, 0.62);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 92, 108, 0.18);
  border-color: rgba(255, 92, 108, 0.45);
  color: #fff;
}

.btn-ghost-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(214, 236, 255, 0.16);
  background: rgba(14, 22, 36, 0.62);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-ghost-link:hover {
  background: rgba(40, 148, 255, 0.22);
  border-color: rgba(94, 192, 255, 0.45);
  color: #fff;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.back-store-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-store-link:hover {
  color: #9ed8ff;
}

.inline-link {
  color: #7ccaff;
  text-decoration: underline;
}

.star-picker {
  display: flex;
  gap: 6px;
}

.star-btn {
  border: none;
  background: transparent;
  font-size: 24px;
  color: rgba(152, 171, 196, 0.35);
  cursor: pointer;
  padding: 2px;
  transition: color 0.14s ease, transform 0.14s ease;
}

.star-btn:hover { transform: scale(1.12); }
.star-btn.active { color: #ffb020; }

.full-width {
  width: 100%;
}

.status-line {
  min-height: 20px;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.status-line.error {
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.muted-text {
  font-size: 13px;
  color: var(--text-muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(200, 230, 255, 0.16);
  border-top-color: #55bdff;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dashboard Layout */
.dashboard-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 44px;
  animation: fadeSlideUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  margin-bottom: 24px;
  background: rgba(11, 16, 28, 0.86);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9ed8ff;
}

.nav-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(12, 20, 32, 0.82);
  border: 1px solid rgba(110, 170, 220, 0.24);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.active {
  color: #a8ffe0;
  border-color: rgba(44, 230, 166, 0.36);
}

.status-pill.active .pill-dot {
  background: var(--success);
  box-shadow: 0 0 10px rgba(44, 230, 166, 0.75);
}

.status-pill.inactive {
  color: var(--text-soft);
}

.user-chip {
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(218, 236, 255, 0.08);
  border: 1px solid rgba(214, 236, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  padding: 20px 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60c0ff;
  box-shadow: 0 0 10px rgba(96, 192, 255, 0.7);
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #eef6ff;
}

.panel-divider {
  height: 1px;
  margin: 12px 0 16px;
  background: linear-gradient(90deg, rgba(150, 210, 255, 0.32), rgba(150, 210, 255, 0.04));
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(10, 18, 30, 0.45);
  border: 1px solid rgba(214, 236, 255, 0.09);
}

.stat-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-box strong {
  font-size: 15px;
  color: var(--text-main);
}

.text-active {
  color: var(--success) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.helper-note {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

code {
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(94, 192, 255, 0.12);
  color: #a9deff;
}

.loader-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(10, 18, 30, 0.45);
  border: 1px solid rgba(214, 236, 255, 0.10);
  margin-bottom: 14px;
}

.loader-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.loader-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.version-tag {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(40, 148, 255, 0.24);
  color: #8fd2ff;
  border: 1px solid rgba(94, 192, 255, 0.35);
}

.loader-specs {
  font-size: 12.5px;
  color: var(--text-muted);
}

.meta-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-soft);
}

.sha-code {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-banner {
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  font-size: 13px;
  color: #c2dcf5;
  background: rgba(40, 148, 255, 0.12);
  border: 1px solid rgba(94, 192, 255, 0.26);
  line-height: 1.45;
}

.history-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 236, 255, 0.10);
}

.history-wrap h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(10, 18, 30, 0.42);
  border: 1px solid rgba(214, 236, 255, 0.08);
  font-size: 12.5px;
}

.history-item .h-meta {
  color: var(--text-muted);
}

.steps-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.5;
}

.steps-list strong {
  color: var(--text-main);
}

@media (max-width: 820px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .glass-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
