:root {
  --deep-ice: #071a2e;
  --glacier: #0f2c4c;
  --frost: #bfe6ff;
  --frost-bright: #7fd4ff;
  --white: #f4fbff;
  --danger: #ff6b6b;
  --radius: 14px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--white);
  background:
    radial-gradient(ellipse at top, rgba(127, 212, 255, 0.10), transparent 55%),
    linear-gradient(180deg, #0a2036 0%, #071a2e 40%, #051220 100%);
  overflow-x: hidden;
}

/* Kabut lembut di bawah layar agar konten tetap terbaca di atas foto */
body::before {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 45vh;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 26, 46, 0.55) 100%);
}

/* Foto Antartika asli — berganti sesuai waktu, menempel (fixed) saat digeser */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
  opacity: 0.45;
  transition: background-image 1.5s ease, opacity 1.5s ease;
  animation: sceneDrift 40s ease-in-out infinite alternate;
}
body[data-time="day"]::after   { background-image: url('bg-day.jpg'); opacity: 0.40; }
body[data-time="dusk"]::after  { background-image: url('bg-dusk.jpg'); opacity: 0.50; }
body[data-time="night"]::after { background-image: url('bg-night.jpg'); opacity: 0.55; }

@keyframes sceneDrift {
  0%   { transform: scale(1.06) translateX(-1%); }
  100% { transform: scale(1.12) translateX(1.5%); }
}

/* Siklus siang/malam — background berubah sesuai data-time di <body> */
body[data-time="day"] {
  background:
    radial-gradient(ellipse at top, rgba(191, 230, 255, 0.25), transparent 60%),
    linear-gradient(180deg, #4a90c2 0%, #6fb3d9 35%, #a8d4e8 70%, #d9ecf2 100%);
}
body[data-time="dusk"] {
  background:
    radial-gradient(ellipse at top, rgba(255, 180, 140, 0.20), transparent 55%),
    linear-gradient(180deg, #2a3a5c 0%, #5a4066 35%, #a8637a 70%, #e8a87c 100%);
}
body[data-time="night"] {
  background:
    radial-gradient(ellipse at top, rgba(127, 212, 255, 0.10), transparent 55%),
    linear-gradient(180deg, #0a2036 0%, #071a2e 40%, #051220 100%);
}

/* Siluet gunung — warna menyesuaikan waktu */
/* Kabut bawah layar disesuaikan agar tidak terlalu gelap di siang/senja */
body[data-time="day"]::before {
  background: linear-gradient(180deg, transparent 0%, rgba(120, 170, 210, 0.35) 100%);
}
body[data-time="dusk"]::before {
  background: linear-gradient(180deg, transparent 0%, rgba(90, 60, 90, 0.45) 100%);
}

/* Aurora — cuma tampil malam hari */
.aurora {
  position: fixed;
  top: -10%;
  left: -20%;
  width: 140%;
  height: 55%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
  filter: blur(40px);
  mix-blend-mode: screen;
}
body[data-time="night"] .aurora { opacity: 0.55; }

.aurora-1 {
  background: linear-gradient(120deg, transparent 10%, #4dffb8 35%, #7fd4ff 55%, transparent 80%);
  animation: auroraDrift1 18s ease-in-out infinite alternate;
}
.aurora-2 {
  background: linear-gradient(100deg, transparent 15%, #b47fff 40%, #4dffb8 65%, transparent 85%);
  animation: auroraDrift2 24s ease-in-out infinite alternate;
  top: -5%;
}
@keyframes auroraDrift1 {
  0%   { transform: translateX(-5%) scaleY(1); }
  100% { transform: translateX(8%) scaleY(1.15); }
}
@keyframes auroraDrift2 {
  0%   { transform: translateX(6%) scaleY(1.05); }
  100% { transform: translateX(-8%) scaleY(0.95); }
}

code {
  background: rgba(191, 230, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Canvas salju jatuh — fixed di belakang semua konten */
#snowCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Auth page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.frost-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(127, 212, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(191, 230, 255, 0.12), transparent 50%);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  margin: 24px;
  padding: 36px 32px;
  background: rgba(15, 44, 76, 0.75);
  border: 1px solid rgba(191, 230, 255, 0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand-mark { font-size: 22px; color: var(--frost-bright); }
.auth-brand h1 { margin: 6px 0 2px; font-size: 22px; letter-spacing: 0.5px; }
.auth-brand p { margin: 8px 0 0; color: var(--frost); font-size: 13px; opacity: 0.8; }

.brand-logo {
  height: 28px;
  width: auto;
  border-radius: 6px;
  animation: brandGlow 3s ease-in-out infinite;
}
.brand-logo-lg { height: 56px; border-radius: 10px; }

@keyframes brandGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(127, 212, 255, 0.3)); transform: translateY(0); }
  50% { filter: drop-shadow(0 0 10px rgba(127, 212, 255, 0.7)); transform: translateY(-2px); }
}

.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 12px; color: var(--frost); margin-top: 10px; }
.auth-form input {
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(191, 230, 255, 0.25);
  background: rgba(7, 26, 46, 0.6);
  color: var(--white);
  font-size: 14px;
}
.auth-form input:focus {
  outline: 2px solid var(--frost-bright);
  outline-offset: 1px;
}
.auth-form button {
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--frost-bright), #4aa8e0);
  color: var(--deep-ice);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.auth-form button:hover { filter: brightness(1.08); }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: rgba(255, 107, 107, 0.15); color: var(--danger); border: 1px solid rgba(255, 107, 107, 0.3); }
.alert-success { background: rgba(127, 212, 255, 0.15); color: var(--frost-bright); border: 1px solid rgba(127, 212, 255, 0.3); }

/* ---------- Page shell (header + off-canvas menu) ---------- */
.page-wrap { position: relative; z-index: 2; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(15, 44, 76, 0.55);
  border-bottom: 1px solid rgba(191, 230, 255, 0.1);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
}
.menu-toggle {
  background: rgba(191, 230, 255, 0.08);
  border: 1px solid rgba(191, 230, 255, 0.15);
  color: var(--white);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-toggle:hover { background: rgba(191, 230, 255, 0.15); }

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 15;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }

.side-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100vh;
  background: rgba(11, 33, 58, 0.97);
  border-left: 1px solid rgba(191, 230, 255, 0.15);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  transition: right 0.25s ease;
  z-index: 20;
  overflow-y: auto;
}
.side-menu.open { right: 0; }

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 14px;
  border-bottom: 1px solid rgba(191, 230, 255, 0.1);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--frost);
}
.menu-close {
  background: none;
  border: none;
  color: var(--frost);
  font-size: 16px;
  cursor: pointer;
}

.side-menu a {
  padding: 13px 20px;
  color: var(--frost);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.side-menu a:hover { background: rgba(191, 230, 255, 0.06); }
.side-menu a.active {
  color: var(--white);
  background: rgba(127, 212, 255, 0.1);
  border-left-color: var(--frost-bright);
  font-weight: 600;
}
.side-menu-logout {
  margin-top: auto;
  color: var(--danger) !important;
}

.content { padding: 24px 20px 60px; max-width: 900px; margin: 0 auto; }

.content-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}
.content-header h1 { margin: 0; font-size: 22px; }
.welcome { color: var(--frost); font-size: 13px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: rgba(15, 44, 76, 0.6);
  border: 1px solid rgba(191, 230, 255, 0.12);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label { font-size: 12px; color: var(--frost); opacity: 0.8; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--frost-bright); }

.panel-box {
  background: rgba(15, 44, 76, 0.5);
  border: 1px solid rgba(191, 230, 255, 0.1);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--frost);
}
