/* =========================================================
   SIPLIK Landing Page Styles (refactored)
   - Nature palette, dark-green accents, modals, hero, features
   ========================================================= */

/* ========== CSS Variables ========== */
:root {
  --color-primary: #0ec04f;
  --color-primary-dark: #2e7d32;
  --color-primary-darker: #1b5e20;
  --color-primary-light: #e8f5e9;
  --color-accent: #66bb6a;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-bg: #ffffff;
  --color-footer-bg: #000000;
  --color-footer-text: #ffffff;

  --radius: 14px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .10);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, .14);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, .18);

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --max-w: 1500px;
  --lh: 1.5rem;
}

/* ========== Base Reset & Typography ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-size: 110%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: var(--lh);
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 1 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 6px);
}

/* Global focus style */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ========== Layout Helpers ========== */
.container {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 12px 0;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.page-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== Form Controls ========== */
/* Shared input styles */
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: .72rem .9rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--color-text);
  box-shadow: var(--shadow-xs) inset;
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Focus state */
input[type="text"]:focus-visible,
input[type="password"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-primary);
}

/* Labels */
label {
  font-weight: 700;
  color: var(--color-text);
}

/* Checkbox group */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  color: var(--color-text);
}

.checkbox input {
  width: 1rem;
  height: 1rem;
}

/* Inline radio group */
.radio-inline-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

.radio-inline-group label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
}

.radio-inline-group input[type="radio"] {
  accent-color: #1b5e20;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Inline validation text */
.field-error {
  display: block;
  margin-top: .25rem;
  color: #b91c1c;
  font-weight: 600;
  min-height: 1em;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .72rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid currentColor;
  transition:
    transform .08s ease,
    box-shadow .18s ease,
    background-color .18s ease,
    color .18s ease,
    border-color .18s ease;
  box-shadow: var(--shadow-xs);
}

/* Primary (green) button, used in navbar & hero */
.btn-primary {
  background-color: #1cb957;
  color: #ffffff !important;
  border-color: #1cb957;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: #189a49;
  border-color: #189a49;
  box-shadow: var(--shadow-md);
}

/* Secondary outline button (hero) */
.btn-secondary {
  background-color: #ffffff;
  color: #1cb957;
  border: 1px solid #1cb957;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: #f0fdf4;
  color: #189a49;
}

/* Generic non-primary variant */
.btn:not(.btn-primary):not(.btn-secondary) {
  color: var(--color-primary);
  background: transparent;
  border-color: var(--color-primary);
}

.btn:not(.btn-primary):not(.btn-secondary):hover,
.btn:not(.btn-primary):not(.btn-secondary):focus-visible {
  background: var(--color-primary-light);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

/* ========== Navbar ========== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 60px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #2d3748;
  font-size: 24px;
  font-weight: 600;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
}

.navbar-right ul {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-right li {
  margin: 0;
  padding: 0;
}

.navbar-right a {
  text-decoration: none;
  color: #4a5568;
  font-size: 16px;
  font-weight: 500;
  transition: color .3s ease;
}

.navbar-right a:hover {
  color: #1cb957;
}

.navbar-link-primary {
  background-color: #1cb957;
  color: #ffffff !important;
  border-color: #1cb957;
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
  border-radius: 999px;
  margin: 0px;
}

/* ========== Hero Section ========== */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 128px;
  width: 100%;
  max-width: 1340px;
  margin: 40px auto;
  padding: 40px 20px;
  background-color: #ffffff;
}

.hero-content {
  flex: 1;
  max-width: 480px;
}

.hero-content h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
  line-height: 1.3;
  text-align: center;
}

.hero-content p {
  font-size: 16px;
  line-height: 1.6;
  color: #6b7280;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-buttons .btn {
  width: 100%;
  text-align: center;
}

.hero-image {
  flex: 1;
  min-width: 0;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.07);
}

/* ========== Simple Features Section (#features) ========== */
#features .container {
  display: grid;
  gap: var(--space-8);
}

#features h2 {
  margin: 0 0 var(--space-4);
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
}

#features .container > .card {
  background: #fff;
  border: 1px solid #e8efe9;
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
  transition: transform .12s ease, box-shadow .18s ease;
}

#features .container > .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.icon-emoji {
  font-size: 2rem;
  line-height: 1;
  border-radius: 12px;
  background: var(--color-primary-light);
  padding: .6rem .8rem;
  box-shadow: var(--shadow-xs);
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
}

.card p {
  margin: 0;
  color: var(--color-muted);
}

/* ========== CTA Section (#cta) ========== */
#cta {
  background:
    radial-gradient(8000px 400px at 20% -10%, rgba(102, 187, 106, 0.12), transparent 60%),
    radial-gradient(8000px 400px at 120% 110%, rgba(46, 125, 50, 0.10), transparent 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

#cta h2 {
  margin: 0 0 var(--space-3);
  color: var(--color-text);
  text-align: center;
}

#cta p {
  margin: 0 0 var(--space-4);
  color: var(--color-muted);
  text-align: center;
}

/* ========== Footer (black/white landing footer) ========== */
footer.section {
  padding-block: var(--space-8);
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  text-align: center;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, .25);
}

#footer h2 {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
  color: var(--color-footer-text);
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: uppercase;
}

#footer p {
  margin: 0;
  color: var(--color-footer-text);
}

#footer a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 700;
}

#footer a:hover {
  text-decoration: underline;
}

/* ========== Main Footer (bottom of page) ========== */
.main-footer {
  padding: 24px 0;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  transition: color .3s ease;
}

.footer-links a:hover {
  color: #2d3748;
}

/* ========== Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.is-open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(560px, calc(100% - 2rem));
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-8);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.modal-close:hover {
  filter: brightness(0.96);
}

.modal-header h2 {
  margin: 0 0 .25rem;
  color: var(--color-text);
  font-weight: 800;
  text-align: center;
  line-height: 3ch;
}

.modal-header p {
  margin: 0 0 var(--space-6);
  color: var(--color-muted);
  text-align: center;
}

.modal-form {
  display: grid;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  gap: .375rem;
}

.form-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-actions {
  margin-top: var(--space-2);
}

.form-actions .btn {
  width: 100%;
  font-size: 1rem;
}

.form-footnote {
  text-align: center;
  color: var(--color-text);
}

.form-footnote a.modal-link {
  color: var(--color-primary);
  text-decoration: none;
}

.form-footnote a.modal-link:hover {
  text-decoration: underline;
}

/* Prevent background scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* ========== Loader Overlay ========== */
#loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  z-index: 999999;
}

#loader-overlay .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .9s linear infinite;
}

/* ========== Interactive Features Diagram (.features-section) ========== */
.features-section {
  width: 100%;
  max-width: 100%;
  padding: 60px 20px;
  text-align: center;
  background-color: #fbf9fa;
}

/* Header */
.features-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

.features-header p {
  font-size: 16px;
  line-height: 1.6;
  max-width: 550px;
  margin: 0 auto 50px;
}

/* Content layout */
.features-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Diagram (left) */
.features-diagram {
  flex: 1;
  position: relative;
  max-width: 370px;
  min-height: 370px;
  margin: 0 auto;
}

.diagram-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background-color: #e6f7ec;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.diagram-item {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  width: 90px;
  text-align: center;
}

.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  transition: all .3s ease;
}

.icon-circle svg {
  width: 40px;
  height: 40px;
  color: #a0aec0;
  transition: all .3s ease;
}

/* Diagram positions */
#btn-lacak {
  top: 40px;
  left: 40px;
}

#btn-evaluasi {
  top: 40px;
  right: 40px;
}

#btn-laporkan {
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
}

/* Special style for "Laporkan" */
#btn-laporkan .icon-circle {
  width: 80px;
  height: 80px;
  background-color: #38a169;
  border: none;
}

#btn-laporkan .icon-circle svg {
  width: 32px;
  height: 32px;
  color: #ffffff;
}

/* Active state */
.diagram-item.active .icon-circle {
  border-color: #38a169;
  box-shadow: 0 0 12px rgba(56, 161, 105, 0.5);
}

.diagram-item.active .icon-circle svg {
  color: #38a169;
}

/* Keep Laporkan icon white when active */
#btn-laporkan.active .icon-circle svg {
  color: #ffffff;
}

/* Description (right) */
.features-description {
  flex: 1;
  text-align: left;
  padding-left: 50px;
}

.description-content {
  display: none;
  animation: fadeIn .5s;
}

.description-content.active {
  display: block;
}

.description-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #e6f7ec;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.description-icon svg {
  width: 80px;
  height: 80px;
  color: #38a169;
}

.description-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
}

.description-content p {
  font-size: 16px;
  line-height: 1.7;
  color: #4a5568;
}

.description-content p.muted {
  font-size: 14px;
  color: #718096;
  margin-top: 10px;
}

/* ========== Planet Cards Section ========== */
.planet-section {
  padding: 60px 0;
  text-align: center;
}

.planet-section-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

.planet-section-header p {
  font-size: 16px;
  line-height: 1.6;
  max-width: 550px;
  margin: 0 auto 50px;
  color: #6b7280;
}

/* Cards grid */
.planet-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.planet-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all .3s ease;
  cursor: pointer;
}

.planet-card.active {
  border-color: #38a169;
  box-shadow: 0 6px 16px rgba(56, 161, 105, 0.2);
}

/* Icon wrapper */
.icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon-wrapper svg {
  width: 28px;
  height: 28px;
}

/* Icon color variants */
.planet-card[data-card="laut"] .icon-wrapper {
  background-color: #ebf4ff;
  color: #3b82f6;
}

.planet-card[data-card="bumi"] .icon-wrapper {
  background-color: #fefbeb;
  color: #f59e0b;
}

.planet-card[data-card="lingkungan"] .icon-wrapper {
  background-color: #e6f7ec;
  color: #38a169;
}

.planet-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.planet-card p {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

/* Dots pagination */
.planet-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #d1d5db;
  border: none;
  cursor: pointer;
  transition: background-color .3s ease;
}

.dot.active {
  background-color: #38a169;
}

/* ========== Animations ========== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Responsive Breakpoints ========== */

/* Tablet & up */
@media (min-width: 768px) {
  #hero .container {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
  }

  #features .container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small screens */
@media (max-width: 767.98px) {
  .navbar {
    flex-wrap: wrap;
    row-gap: var(--space-3);
  }

  .navbar-right ul {
    gap: var(--space-4);
    flex-wrap: wrap;
  }

  .hero-section {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }

  .hero-content {
    max-width: 100%;
  }

  .features-content {
    flex-direction: column;
  }

  .features-diagram {
    margin-bottom: 40px;
  }

  .features-description {
    padding-left: 0;
    text-align: center;
  }

  .description-icon {
    margin: 0 auto 16px;
  }

  .planet-cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .planet-section-header p {
    margin-bottom: 30px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
  }

  .footer-links {
    justify-content: center;
    gap: 16px;
  }
}

/* Tiny screens: modal padding */
@media (max-width: 480px) {
  .modal-card {
    padding: var(--space-6);
  }
}

/* Laptop */
@media (min-width: 1024px) {
  .features-content {
    margin: 0 8rem;
  }
}

/* Desktop large */
@media (min-width: 1440px) {
  .features-content {
    margin: 0 12rem;
  }
}
