/* Login page ke-2 — gaya Sakuga VFX (finktheartist/sakuga-vfx, MIT).
   Palet & variabel PERSIS dari repo (--sk-*): kertas putih, lavender,
   garis violet, aksen pink. Aturan gambar repo: bentuk datar (flat),
   tanpa gradasi, tanpa blur; efek pergi dengan mengecil, bukan memudar;
   pink hanya untuk aksen; kontrol polos saat diam. */
:root {
  --sk-card: #fff;
  --sk-ink: #1d1a4a;
  --sk-dim: #8580b0;
  --sk-soft: #b8b3ff;
  --sk-pri: #8f8df7;
  --sk-pri-ink: #1d1a4a;
  --sk-acc: #ff5fa8;
  --sk-track: #c9cbe0;
  --sk-r: 15px;
  --sk-bw: 3.2px;
  --sk-sh: 6px 7px 0 var(--sk-soft);
  --sk-on-pri: #fff;
  --paper: #fdfcff;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--sk-ink);
  background: var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Latar kertas + bentuk datar (flat, tanpa gradasi) ---- */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
}

.deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.deco-star {
  top: -70px;
  right: -40px;
  width: 320px;
  height: 320px;
  opacity: 0.9;
}

.deco-ring {
  bottom: 8%;
  left: -90px;
  width: 260px;
  height: 260px;
  border: 3.2px solid var(--sk-soft);
  border-radius: 50%;
}

.deco-lines {
  top: 12%;
  left: 6%;
  width: 120px;
  height: 120px;
}

.deco-word {
  position: absolute;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 900;
  color: var(--sk-soft);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.deco-word-a {
  top: 6%;
  right: 10%;
  font-size: 84px;
  transform: rotate(8deg);
}

.deco-word-b {
  bottom: 5%;
  right: 6%;
  font-size: 64px;
  transform: rotate(-6deg);
  color: var(--sk-track);
}

/* ---- Kartu login (panel komik: outline tebal + bayangan keras) ---- */
.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  background: var(--sk-card);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: var(--sk-r);
  box-shadow: var(--sk-sh);
  padding: 32px 30px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.brand-name {
  font-family: "Archivo Black", sans-serif;
  font-size: 30px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--sk-ink);
}

.brand-name em {
  font-style: normal;
  color: var(--sk-acc);
}

.brand-sub {
  font-size: 13px;
  color: var(--sk-dim);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.title {
  font-family: "Archivo Black", sans-serif;
  font-size: 24px;
  line-height: 1.15;
  margin: 18px 0 4px;
}

.subtitle {
  font-size: 14px;
  color: var(--sk-dim);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ---- Tabs (Sign In / Sign Up) ---- */
.tabs {
  position: relative;
  display: flex;
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 12px;
  background: var(--sk-card);
  margin-bottom: 22px;
  overflow: hidden;
}

.tabs-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  background: var(--sk-pri);
  border-right: var(--sk-bw) solid var(--sk-ink);
  transition: transform 0.38s cubic-bezier(0.2, 1.4, 0.4, 1);
  will-change: transform;
}

.tabs-indicator.to-signup {
  transform: translateX(100%);
  border-right: none;
  border-left: var(--sk-bw) solid var(--sk-ink);
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  background: transparent;
  border: none;
  font: 700 15px/1 "Inter", sans-serif;
  color: var(--sk-ink);
  padding: 13px 0;
  cursor: pointer;
}

.tab.is-active {
  color: var(--sk-on-pri);
}

.tab:focus-visible {
  outline: 2.5px solid var(--sk-acc);
  outline-offset: 3px;
}

/* ---- Form ---- */
.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}

.input {
  width: 100%;
  background: var(--sk-card);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: 500 15px/1.4 "Inter", sans-serif;
  color: var(--sk-ink);
  outline: none;
  transition: box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--sk-dim);
}

.input:focus {
  box-shadow: 4px 4px 0 var(--sk-soft);
}

.input.is-error {
  border-color: var(--sk-acc);
  box-shadow: 4px 4px 0 rgba(255, 95, 168, 0.35);
}

.input-row {
  position: relative;
}

.input-row .input {
  padding-right: 48px;
}

.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  border-radius: 8px;
}

.eye-btn:hover {
  background: rgba(184, 179, 255, 0.25);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
}

.link {
  background: none;
  border: none;
  padding: 0;
  font: 600 13px/1.4 "Inter", sans-serif;
  color: var(--sk-pri);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--sk-acc);
}

/* ---- Checkbox sakuga (Remember me) ---- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.check-box {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--sk-card);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.check-box svg {
  width: 16px;
  height: 16px;
  stroke: var(--sk-on-pri);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.check input:checked + .check-box {
  background: var(--sk-acc);
  border-color: var(--sk-ink);
}

.check input:checked + .check-box svg {
  animation: tickDraw 0.35s ease forwards;
}

.check input:focus-visible + .check-box {
  outline: 2.5px solid var(--sk-acc);
  outline-offset: 3px;
}

@keyframes tickDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---- Toggle (tampilkan password) ---- */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.toggle-wrap input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.toggle-track {
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  background: var(--sk-track);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--sk-card);
  border: 2.5px solid var(--sk-ink);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s cubic-bezier(0.2, 1.5, 0.4, 1), background 0.2s ease;
}

.toggle-wrap input:checked + .toggle-track {
  background: var(--sk-pri);
}

.toggle-wrap input:checked + .toggle-track .toggle-knob {
  transform: translateY(-50%) translateX(20px);
  background: var(--sk-acc);
}

.toggle-wrap input:focus-visible + .toggle-track {
  outline: 2.5px solid var(--sk-acc);
  outline-offset: 3px;
}

/* ---- Tombol sakuga ---- */
.btn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--sk-pri);
  color: var(--sk-on-pri);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 12px;
  box-shadow: var(--sk-btn-sh);
  font: 700 16px/1 "Inter", sans-serif;
  padding: 15px 20px;
  cursor: pointer;
  will-change: transform;
  user-select: none;
}

.btn:active {
  box-shadow: 2px 2px 0 var(--sk-soft);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2.5px solid var(--sk-acc);
  outline-offset: 3px;
}

.btn.is-done {
  background: var(--sk-acc);
}

.btn-check {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.btn.is-done .btn-check {
  animation: tickDraw 0.35s ease forwards;
}

.btn-ghost {
  background: var(--sk-card);
  color: var(--sk-ink);
  box-shadow: var(--sk-sh);
  font-size: 15px;
}

.btn-ghost .g-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--sk-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--sk-track);
}

.error-text {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--sk-acc);
  margin: -8px 0 14px;
}

.error-text.is-visible {
  display: block;
}

/* ---- OTP ---- */
.otp-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 6px 0 18px;
}

.otp-box {
  width: 58px;
  height: 64px;
  text-align: center;
  font: 700 28px/1 "Inter", sans-serif;
  color: var(--sk-ink);
  background: var(--sk-card);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 12px;
  outline: none;
  transition: box-shadow 0.15s ease;
}

.otp-box:focus {
  box-shadow: 4px 4px 0 var(--sk-soft);
}

.otp-box.is-error {
  border-color: var(--sk-acc);
  box-shadow: 4px 4px 0 rgba(255, 95, 168, 0.35);
}

.otp-meta {
  text-align: center;
  font-size: 13px;
  color: var(--sk-dim);
  margin-bottom: 18px;
  line-height: 1.6;
}

.otp-meta b {
  color: var(--sk-ink);
}

.back-link {
  display: block;
  margin: 16px auto 0;
  text-align: center;
}

/* ---- Progress otentikasi (awan badai menunggangi ujung bar) ---- */
.auth-progress {
  margin: 16px 2px 0;
}

.auth-progress-track {
  position: relative;
  height: 14px;
  background: var(--sk-card);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 999px;
  overflow: visible;
}

.auth-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--sk-pri);
  border-radius: 999px;
}

.auth-progress-cloud {
  position: absolute;
  top: -22px;
  left: -12px;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(1px 1px 0 var(--sk-ink));
  transition: left 0.1s linear;
}

/* ---- Sukses ---- */
.success {
  text-align: center;
  padding: 10px 0 4px;
}

.success-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  background: var(--sk-acc);
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 50%;
  box-shadow: var(--sk-sh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-mark svg {
  width: 44px;
  height: 44px;
  stroke: #fff;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: tickDraw 0.45s ease 0.1s forwards;
}

.success-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 24px;
  margin-bottom: 6px;
}

.success-text {
  font-size: 14px;
  color: var(--sk-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ---- Toast sakuga ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(24px) scale(0.9);
  background: var(--sk-ink);
  color: #fff;
  border: var(--sk-bw) solid var(--sk-ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 var(--sk-soft);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.2s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

/* ---- Lapisan efek (canvas, di atas segalanya, tanpa pointer) ---- */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* ---- Pane (mode) ---- */
.pane {
  display: none;
}

.pane.is-active {
  display: block;
}

.foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--sk-dim);
  line-height: 1.6;
}

.foot b {
  color: var(--sk-ink);
}

/* ---- Responsif ---- */
@media (max-width: 520px) {
  .stage {
    padding: 24px 14px;
  }

  .card {
    padding: 26px 20px 22px;
  }

  .deco-star {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -30px;
  }

  .deco-word-a {
    font-size: 56px;
  }

  .deco-word-b {
    font-size: 42px;
  }

  .otp-box {
    width: 52px;
    height: 58px;
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs-indicator,
  .toggle-knob,
  .toast {
    transition: none;
  }
}
