/* ============================================================
   Manava Login (login.php)
   Estetika mengikuti landing manava.id: gelap, aurora, glass.
   Berisi juga panel mini game "Task Rush".
   ============================================================ */

:root {
  --mnv-blue: #1fb6f2;
  --mnv-cyan: #28d2c2;
  --mnv-green: #35dc2f;
  --mnv-bg: #070b14;
  --mnv-ink: #e7edf7;
  --mnv-muted: #93a1b8;
  --mnv-border: rgba(148, 163, 184, .16);
  --mnv-card: rgba(148, 163, 184, .06);
  --mnv-gradient: linear-gradient(135deg, var(--mnv-blue), var(--mnv-cyan) 55%, var(--mnv-green));
  --mnv-ease: cubic-bezier(.83, 0, .17, 1);
  --mnv-ease-out: cubic-bezier(.16, 1, .3, 1);
}

body.mnv-login,
body.mnv-login *,
body.mnv-login *::before,
body.mnv-login *::after {
  box-sizing: border-box;
}

body.mnv-login {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: 'Plus Jakarta Sans', 'Source Sans Pro', sans-serif;
  background: var(--mnv-bg);
  color: var(--mnv-ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.mnv-login ::selection {
  background: rgba(31, 182, 242, .35);
  color: #fff;
}

/* ============ BACKGROUND ============ */
.mnv-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  filter: blur(70px) saturate(1.2);
}

.mnv-aurora i {
  position: absolute;
  border-radius: 50%;
  opacity: .16;
}

.mnv-aurora .a1 {
  width: 46vw;
  height: 46vw;
  left: -12vw;
  top: -14vw;
  background: radial-gradient(circle, var(--mnv-blue), transparent 65%);
  animation: mnvAurora1 26s ease-in-out infinite alternate;
}

.mnv-aurora .a2 {
  width: 40vw;
  height: 40vw;
  right: -10vw;
  top: 24vh;
  background: radial-gradient(circle, var(--mnv-cyan), transparent 65%);
  animation: mnvAurora2 32s ease-in-out infinite alternate;
}

.mnv-aurora .a3 {
  width: 44vw;
  height: 44vw;
  left: 24vw;
  bottom: -20vw;
  background: radial-gradient(circle, var(--mnv-green), transparent 65%);
  animation: mnvAurora3 38s ease-in-out infinite alternate;
  opacity: .1;
}

@keyframes mnvAurora1 { to { transform: translate(14vw, 10vh) scale(1.18); } }
@keyframes mnvAurora2 { to { transform: translate(-12vw, -8vh) scale(.9); } }
@keyframes mnvAurora3 { to { transform: translate(-10vw, -12vh) scale(1.12); } }

.mnv-grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
}

/* ============ LAYOUT ============ */
.mnv-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(18px, 3.5vw, 48px);
  max-width: 1280px;
  margin: 0 auto;
  align-items: center;
}

/* ---- Panel kiri: brand + game ---- */
.mnv-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: mnvSlideIn .9s var(--mnv-ease-out) both;
}

@keyframes mnvSlideIn {
  from { opacity: 0; transform: translateX(-36px); }
  to { opacity: 1; transform: none; }
}

.mnv-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--mnv-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--mnv-border);
  background: rgba(148, 163, 184, .06);
  transition: color .25s ease, border-color .25s ease, transform .25s ease;
}

.mnv-back:hover {
  color: var(--mnv-ink);
  border-color: rgba(40, 210, 194, .5);
  transform: translateX(-3px);
}

.mnv-brand-logo {
  height: 40px;
  width: fit-content;
  animation: mnvLogoFloat 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 18px rgba(31, 182, 242, .3));
}

.mnv-brand-logo img {
  height: 100%;
  width: auto;
  display: block;
}

@keyframes mnvLogoFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

.mnv-brand-tag {
  margin: 0;
  color: var(--mnv-muted);
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 440px;
}

.mnv-brand-tag b {
  background: var(--mnv-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Mini game ---- */
.mnv-game {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--mnv-border);
  background: linear-gradient(160deg, rgba(148, 163, 184, .07), rgba(148, 163, 184, .03));
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
}

.mnv-game canvas {
  display: block;
  width: 100%;
  height: 380px;
  cursor: crosshair;
  touch-action: manipulation;
}

.mnv-game-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.mnv-game-hud span {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(7, 11, 20, .72);
  border: 1px solid var(--mnv-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mnv-game-hud .hud-score b { color: var(--mnv-cyan); }
.mnv-game-hud .hud-combo b { color: var(--mnv-green); }
.mnv-game-hud .hud-level b { color: var(--mnv-blue); }
.mnv-game-hud .hud-lives { letter-spacing: 1px; font-size: 11px; }
.mnv-game-hud .hud-best { margin-left: auto; color: var(--mnv-muted); }
.mnv-game-hud .hud-combo.is-hot {
  border-color: rgba(53, 220, 47, .6);
  animation: mnvHudPulse .5s ease;
}

@keyframes mnvHudPulse {
  40% { transform: scale(1.12); }
}

.mnv-game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  background: rgba(7, 11, 20, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .4s ease, visibility .4s ease;
}

.mnv-game-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.mnv-game-overlay h3 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  letter-spacing: -.01em;
}

.mnv-game-overlay p {
  margin: 0;
  color: var(--mnv-muted);
  font-size: 13px;
  max-width: 300px;
  line-height: 1.6;
}

.mnv-game-overlay .mnv-btn-play {
  margin-top: 6px;
}

/* Statistik pada layar game over */
.mnv-game-ov-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.mnv-game-ov-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 84px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(148, 163, 184, .08);
  border: 1px solid var(--mnv-border);
}

.mnv-game-ov-stats span {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mnv-muted);
}

.mnv-game-ov-stats b {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  color: var(--mnv-ink);
}

.mnv-game-ov-stats .rank b {
  font-size: 14.5px;
  background: var(--mnv-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ TOMBOL ============ */
.mnv-btn-grad,
.mnv-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .3s var(--mnv-ease-out), box-shadow .3s ease, background .3s ease, border-color .3s ease;
}

.mnv-btn-grad {
  color: #04121c;
  background: var(--mnv-gradient);
  background-size: 160% 160%;
  box-shadow: 0 8px 26px rgba(31, 182, 242, .35);
}

.mnv-btn-grad:hover {
  background-position: 90% 50%;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(31, 182, 242, .5);
  color: #04121c;
}

.mnv-btn-grad:active { transform: translateY(0); }

.mnv-btn-grad:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.mnv-btn-ghost {
  color: var(--mnv-ink);
  background: rgba(148, 163, 184, .08);
  border: 1px solid var(--mnv-border);
}

.mnv-btn-ghost:hover {
  border-color: rgba(40, 210, 194, .5);
  background: rgba(40, 210, 194, .08);
  color: #fff;
}

.mnv-btn-play {
  width: auto;
  padding: 11px 26px;
}

/* ============ KARTU FORM ============ */
.mnv-card {
  position: relative;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, .2);
  background: linear-gradient(165deg, rgba(148, 163, 184, .1), rgba(11, 18, 32, .55) 55%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
  padding: clamp(26px, 3.4vw, 42px);
  max-width: 460px;
  width: 100%;
  justify-self: center;
  animation: mnvCardIn .9s var(--mnv-ease-out) .12s both;
  overflow: hidden;
}

@keyframes mnvCardIn {
  from { opacity: 0; transform: translateY(38px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* Garis aksen gradient di tepi atas kartu */
.mnv-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--mnv-gradient);
  opacity: .9;
}

.mnv-card h1 {
  margin: 0 0 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.mnv-card h1 .grad {
  background: var(--mnv-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mnv-card-sub {
  margin: 0 0 22px;
  color: var(--mnv-muted);
  font-size: 13.8px;
}

/* ---- Input ---- */
.mnv-field {
  position: relative;
  margin-bottom: 14px;
}

.mnv-field > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mnv-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color .25s ease;
}

.mnv-field .form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: 14px;
  border: 1px solid var(--mnv-border);
  background: rgba(7, 11, 20, .55);
  color: var(--mnv-ink);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.mnv-field .form-control::placeholder { color: rgba(147, 161, 184, .7); }

.mnv-field .form-control:focus {
  border-color: rgba(40, 210, 194, .65);
  background: rgba(7, 11, 20, .75);
  box-shadow: 0 0 0 4px rgba(40, 210, 194, .12), 0 0 24px rgba(31, 182, 242, .12);
}

.mnv-field .form-control:focus + i,
.mnv-field:focus-within > i { color: var(--mnv-cyan); }

.mnv-field .form-control.is-invalid {
  border-color: rgba(244, 63, 94, .7);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, .1);
}

/* Form muncul dengan animasi setiap kali ditampilkan */
#loginForm, #registerForm {
  animation: mnvFormIn .5s var(--mnv-ease-out);
}

@keyframes mnvFormIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---- Pesan status ---- */
.alert,
.warning {
  padding: 11px 15px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  animation: mnvFormIn .4s var(--mnv-ease-out);
}

.alert {
  background: rgba(244, 63, 94, .14);
  border: 1px solid rgba(244, 63, 94, .4);
  color: #fda4af;
}

.alert-success {
  background: rgba(53, 220, 47, .12);
  border: 1px solid rgba(53, 220, 47, .35);
  color: #86efac;
}

.warning {
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .35);
  color: #fcd34d;
}

.text-danger { color: #fda4af; font-size: 12.5px; }

/* ---- Aturan password ---- */
#password-rules { margin-bottom: 10px; }

#password-rules .rule {
  display: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .3s ease, transform .3s ease;
  font-size: 12.5px;
  margin: 3px 0;
}

#password-rules .rule.show {
  opacity: 1;
  transform: translateY(0);
}

#match-message { font-size: 12.5px; }

/* ---- Bagian bawah kartu ---- */
.mnv-card-links {
  margin-top: 16px;
  text-align: center;
  font-size: 13.5px;
}

.mnv-card-links a {
  color: var(--mnv-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color .25s ease;
}

.mnv-card-links a:hover { color: var(--mnv-green); }

.mnv-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--mnv-muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.mnv-sep::before,
.mnv-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .3), transparent);
}

.mnv-google {
  gap: 12px;
}

.mnv-google .fa-google {
  background: var(--mnv-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 16px;
}

.mnv-toggle-row {
  margin: 18px 0 0;
  text-align: center;
  color: var(--mnv-muted);
  font-size: 13.5px;
}

.mnv-toggle-row a {
  color: var(--mnv-cyan);
  font-weight: 700;
  text-decoration: none;
  margin-left: 5px;
}

.mnv-toggle-row a:hover { color: var(--mnv-green); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .mnv-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    align-content: start;
    padding-top: 26px;
  }

  .mnv-brand {
    align-items: center;
    text-align: center;
  }

  .mnv-brand-tag { font-size: 13.5px; }
  .mnv-game { display: none; }
  .mnv-card { justify-self: center; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .mnv-game canvas { height: 300px; }
  .mnv-brand-logo { height: 34px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  body.mnv-login *,
  body.mnv-login *::before,
  body.mnv-login *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
