:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --text: #111827;
  --muted: #5f6b7a;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(255, 255, 255, 0.58);
  --field-bg: rgba(255, 255, 255, 0.86);
  --field-border: rgba(148, 163, 184, 0.42);
  --card-bg: rgba(255, 255, 255, 0.64);
  --ok: #0f9d58;
  --bg-glow-a: #dbe8ff;
  --bg-glow-b: #c8f1ff;
  --bg-layer: #f9fbff;
  --ring: rgba(62, 118, 252, 0.35);
  --accent: #1f6fff;
  --danger: #c62828;
  --shadow: 0 22px 54px rgba(15, 23, 42, 0.18);
  --tag-masuk-bg: rgba(45, 125, 255, 0.18);
  --tag-masuk-text: #1d4ed8;
  --tag-kritik-bg: rgba(239, 68, 68, 0.2);
  --tag-kritik-text: #b91c1c;
  --tag-saran-bg: rgba(16, 185, 129, 0.2);
  --tag-saran-text: #0f766e;
  --cursor-x: 50vw;
  --cursor-y: 28vh;
}

html[data-theme="dark"] {
  --bg: #0d111c;
  --text: #e9eef8;
  --muted: #b3bfd4;
  --surface: rgba(17, 24, 39, 0.6);
  --surface-strong: rgba(22, 31, 51, 0.76);
  --border: rgba(255, 255, 255, 0.14);
  --field-bg: rgba(19, 28, 47, 0.88);
  --field-border: rgba(148, 163, 184, 0.3);
  --card-bg: rgba(19, 28, 47, 0.74);
  --ok: #5be1ab;
  --bg-glow-a: #1a2e58;
  --bg-glow-b: #12374a;
  --bg-layer: #0a0f1b;
  --ring: rgba(98, 154, 255, 0.45);
  --accent: #73a7ff;
  --danger: #ff6e6e;
  --shadow: 0 22px 54px rgba(2, 6, 23, 0.5);
  --tag-masuk-bg: rgba(83, 146, 255, 0.2);
  --tag-masuk-text: #b7d0ff;
  --tag-kritik-bg: rgba(239, 68, 68, 0.26);
  --tag-kritik-text: #ffc0c0;
  --tag-saran-bg: rgba(16, 185, 129, 0.24);
  --tag-saran-text: #b8f9e7;
}

* {
  box-sizing: border-box;
}

body,
body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  margin: 0;
  font-family: "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Arial", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 8%, var(--bg-glow-a) 0%, transparent 40%),
    radial-gradient(circle at 88% 10%, var(--bg-glow-b) 0%, transparent 36%),
    linear-gradient(170deg, var(--bg-layer) 0%, var(--bg) 72%);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  pointer-events: none;
  z-index: -1;
  opacity: 0.34;
  background:
    radial-gradient(
      340px circle at var(--cursor-x) var(--cursor-y),
      rgba(115, 167, 255, 0.28) 0%,
      rgba(103, 214, 255, 0.17) 34%,
      transparent 74%
    );
  transition: opacity 260ms ease;
}

body.pointer-active::before {
  opacity: 0.88;
}

body.modal-open {
  overflow: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.24;
  animation: drift 16s ease-in-out infinite, orb-glimmer 10s ease-in-out infinite;
  will-change: transform, opacity, filter;
}

.orb-one {
  width: 340px;
  height: 340px;
  background: #76a8ff;
  top: -70px;
  right: -110px;
  animation-duration: 16s, 12s;
  animation-delay: 0s, -1.8s;
}

.orb-two {
  width: 280px;
  height: 280px;
  background: #67d6ff;
  bottom: -90px;
  left: -60px;
  animation-duration: 18s, 11s;
  animation-delay: 2.4s, -4.6s;
}

.app {
  width: min(980px, calc(100% - 2rem));
  margin: 1.2rem auto 2.2rem;
  display: grid;
  gap: 1rem;
}

.glass {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --spot-x: 12%;
  --spot-y: 8%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: linear-gradient(160deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 280ms ease,
    border-color 220ms ease,
    filter 260ms ease;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 160% at var(--spot-x) var(--spot-y), rgba(255, 255, 255, 0.35), transparent 58%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.22) 100%);
  opacity: 0.46;
  pointer-events: none;
  z-index: -1;
  transition: opacity 280ms ease;
}

.hero {
  padding: 1rem 1rem 1.1rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.66rem;
}

.hero h1 {
  margin: 0.35rem 0 0.35rem;
  font-size: clamp(1.35rem, 2.4vw, 1.86rem);
  line-height: 1.2;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: color 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.back-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(120, 162, 255, 0.16);
  border: 1px solid rgba(120, 162, 255, 0.34);
  box-shadow: 0 6px 18px rgba(58, 110, 220, 0.18);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease,
    border-color 180ms ease;
}

.back-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.back-link:hover {
  color: var(--accent);
}

.back-link:hover .back-icon {
  transform: translateX(-2px);
  background: rgba(120, 162, 255, 0.24);
  border-color: rgba(120, 162, 255, 0.5);
}

.back-link:active .back-icon {
  transform: translateX(-1px) scale(0.96);
}

.admin-mini-btn {
  border-radius: 999px;
  padding: 0.34rem 0.76rem;
  min-height: 32px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.admin-mini-btn.is-active {
  border-color: rgba(46, 160, 117, 0.58);
  color: #0f8b63;
}

.segmented-wrap {
  padding: 0.45rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.22rem;
  gap: 0.22rem;
}

.seg-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.64rem 0.74rem;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.seg-btn:active {
  transform: scale(0.985);
}

.panel {
  padding: 1rem;
}

.feedback-motion-rich .hero,
.feedback-motion-rich .panel:not(.admin-sheet) {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  filter: saturate(0.9);
}

.feedback-motion-rich .hero.is-revealed,
.feedback-motion-rich .panel.is-revealed:not(.admin-sheet) {
  animation: feedback-reveal 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.feedback-motion-rich .glass.is-tilting:not(.admin-sheet) {
  transform:
    perspective(1240px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translateY(-2px);
  filter: saturate(1.05);
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 1.08rem;
}

.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.about-head h2 {
  margin: 0;
}

.about-content {
  display: grid;
  gap: 0.36rem;
  font-size: 0.92rem;
}

.about-content p {
  margin: 0;
  color: var(--muted);
}

.about-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.about-content a:hover {
  text-decoration: underline;
}

.form {
  display: grid;
  gap: 0.72rem;
}

label {
  display: grid;
  gap: 0.36rem;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  background: var(--field-bg);
  color: var(--text);
  padding: 0.7rem 0.78rem;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 0.72rem 0.86rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, #3a7eff, var(--accent));
  cursor: pointer;
  transition: transform 140ms ease, filter 180ms ease;
  touch-action: manipulation;
}

button,
.back-link {
  --magnet-x: 0px;
  --magnet-y: 0px;
  position: relative;
  overflow: hidden;
}

button::after,
.back-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(115, 167, 255, 0.5), rgba(115, 167, 255, 0.02) 70%);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
}

button.is-pulsing::after,
.back-link.is-pulsing::after {
  transform: translate(-50%, -50%) scale(13);
  opacity: 0.34;
}

@media (hover: hover) and (pointer: fine) {
  button,
  .back-link {
    transform: translate3d(var(--magnet-x), var(--magnet-y), 0);
  }

  button:hover,
  .back-link:hover {
    transform: translate3d(var(--magnet-x), calc(var(--magnet-y) - 1px), 0);
  }
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform:
    translate3d(
      calc(var(--magnet-x) * 0.35),
      calc(var(--magnet-y) * 0.35),
      0
    )
    scale(0.985);
}

.btn-muted {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  flex-wrap: wrap;
}

.status {
  min-height: 1.1rem;
  font-size: 0.86rem;
  color: var(--muted);
}

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

.status.ok {
  color: var(--ok);
}

.helper {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.honeypot-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.inline-form {
  grid-template-columns: minmax(140px, 0.9fr) minmax(200px, 1.4fr) auto;
  align-items: end;
}

.inline {
  margin: 0;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.admin-list {
  display: grid;
  gap: 0.62rem;
}

.feedback-item {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 16px;
  background: var(--card-bg);
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.42rem;
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.item-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.58rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tag.masukan {
  background: var(--tag-masuk-bg);
  color: var(--tag-masuk-text);
}

.tag.kritik {
  background: var(--tag-kritik-bg);
  color: var(--tag-kritik-text);
}

.tag.saran {
  background: var(--tag-saran-bg);
  color: var(--tag-saran-text);
}

.item-time {
  font-size: 0.76rem;
  color: var(--muted);
}

.item-delete-btn {
  appearance: none;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 26px;
  cursor: pointer;
}

.item-delete-btn:hover {
  filter: none;
  background: rgba(239, 68, 68, 0.2);
}

.item-delete-btn:active {
  transform: scale(0.98);
}

.item-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.item-name {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.item-message {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.admin-overlay.hidden {
  display: none !important;
}

.admin-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  background: rgba(9, 16, 30, 0.34);
  cursor: default;
}

.admin-sheet {
  position: relative;
  width: min(920px, calc(100% - 1.1rem));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1), opacity 250ms ease;
}

.admin-overlay.is-visible .admin-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.admin-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.admin-sheet-head h2 {
  margin: 0;
}

.admin-close-btn {
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  min-height: 32px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--surface-strong);
  }
}

@media (hover: none) and (pointer: coarse) {
  .orb {
    filter: blur(40px);
    opacity: 0.24;
    animation-duration: 18s, 11s;
  }

  .glass {
    backdrop-filter: saturate(190%) blur(18px);
    -webkit-backdrop-filter: saturate(190%) blur(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }

  .orb {
    animation: none !important;
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

@keyframes orb-glimmer {
  0%,
  100% {
    opacity: 0.22;
    filter: blur(42px) saturate(1);
  }
  50% {
    opacity: 0.34;
    filter: blur(44px) saturate(1.16);
  }
}

@keyframes feedback-reveal {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.983);
    filter: saturate(0.86);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.002);
    filter: saturate(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@media (max-width: 768px) {
  .app {
    width: min(980px, calc(100% - 1rem));
    margin: 0.7rem auto 1.4rem;
    gap: 0.82rem;
  }

  .panel,
  .hero {
    border-radius: 20px;
    padding: 0.86rem;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .admin-overlay {
    padding: 0.65rem;
    align-items: end;
  }

  .admin-sheet {
    width: 100%;
    max-height: min(90dvh, 860px);
    border-radius: 22px;
  }

  .admin-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
