/* Kebun Sawit Simulator — gaya bersama situs (Beranda, Dashboard, Top Up). */
:root {
  --sky: #4cb8f5;
  --sky-soft: #e6f5ff;
  --leaf: #2f9e44;
  --leaf-dark: #1f7a32;
  --leaf-soft: #eaf8e6;
  --sun: #ffcf33;
  --sun-dark: #e5a800;
  --sun-soft: #fff6d6;
  --sawit: #e8562a;
  --red: #d63b2f;
  --ink: #1d2a3a;
  --muted: #5b6b7d;
  --paper: #fdfcf7;
  --card: #ffffff;
  --line: rgba(29, 42, 58, 0.1);
  --radius: 18px;
  --shadow: 0 2px 0 rgba(29, 42, 58, 0.06), 0 10px 24px rgba(29, 42, 58, 0.08);
  --display: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --body: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.55;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: 0.2px; }
p { margin: 0; }
.hidden { display: none !important; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sun-dark); outline-offset: 2px; }

/* Tombol: gaya tombol game (tebal, berbibir bawah). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; border: 0; border-radius: 16px; cursor: pointer;
  font-family: var(--display); font-size: 19px; text-decoration: none; letter-spacing: 0.3px; white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: 17px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-yellow { background: var(--sun); color: #5a3a00; box-shadow: 0 4px 0 var(--sun-dark); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--sun-dark); }
.btn-green { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 var(--leaf-dark); }
.btn-green:active { box-shadow: 0 1px 0 var(--leaf-dark); }
.btn-white { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #c9d6e3; }
.btn-white:active { box-shadow: 0 1px 0 #c9d6e3; }
.btn-red { background: #fff; color: var(--red); box-shadow: inset 0 0 0 2px #f1c4c0; }
.btn-ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.btn-play { background: #111; color: #fff; padding: 8px 22px 8px 16px; min-height: 58px; text-align: left; box-shadow: 0 4px 0 #000; }
.btn-play svg { width: 30px; height: 30px; fill: var(--sun); flex: none; }
.btn-play span { display: flex; flex-direction: column; font-size: 21px; line-height: 1.05; }
.btn-play small { font-family: var(--body); font-size: 12px; font-weight: 600; opacity: 0.8; letter-spacing: 0.5px; text-transform: uppercase; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand img { height: 44px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--muted); }
.nav > a:hover { color: var(--ink); background: var(--sky-soft); }
.nav > a[aria-current='page'] { color: var(--leaf-dark); background: var(--leaf-soft); }
.nav-auth { display: flex; gap: 8px; margin-left: 8px; }
.menu-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--sky-soft);
  cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between;
}
.menu-toggle span { display: block; height: 3px; border-radius: 3px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Footer */
.footer { background: #14202e; color: rgba(255, 255, 255, 0.82); padding: 32px 0; font-size: 15px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; }
.footer strong { color: #fff; font-family: var(--display); font-weight: 400; font-size: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--sun); }
.copy { grid-column: 1 / -1; opacity: 0.65; font-size: 14px; }

/* Modal & form */
.modal {
  position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px;
  background: rgba(10, 18, 28, 0.72);
}
.modal.show { display: grid; }
.modal-card { position: relative; width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 28px 24px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.modal-card h2 { font-size: 32px; color: var(--leaf-dark); padding-right: 40px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--sky-soft); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
}
.modal-sub { color: var(--muted); margin: 4px 0 16px; font-size: 15px; }
.modal-card label { display: block; font-weight: 600; margin: 10px 0 6px; }
.modal-card input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line);
  font: inherit; color: var(--ink); background: #f8fbff;
}
.modal-card input:focus { border-color: var(--sky); outline: none; }
.form-error { min-height: 22px; color: var(--red); font-size: 15px; margin: 8px 0; }
/* Login Google di modal Masuk */
.login-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 14px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--line); }
.btn-google svg { flex: none; }
.login-note { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* Notifikasi di halaman */
.notice { border-radius: 14px; padding: 12px 16px; font-weight: 600; background: var(--sky-soft); color: #0f4b72; }
.notice.ok { background: var(--leaf-soft); color: var(--leaf-dark); }
.notice.warn { background: var(--sun-soft); color: #7a5400; }
.notice.err { background: #fdecea; color: #a1281e; }

@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch;
    gap: 4px; padding: 12px 16px 18px; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(29, 42, 58, 0.12);
  }
  body.menu-open .nav { display: flex; }
  .nav > a { padding: 12px 14px; font-size: 18px; }
  .nav-auth { margin: 8px 0 0; }
  .nav-auth .btn { flex: 1; min-height: 48px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
