/* ==========================================================================
   Kompas Fit - Design System: "Gerak Tropis"
   components.css: Header, Drawer, Buttons, Bento Cards, Stepper, Banner & Footer
   ========================================================================== */

/* --- Header & Navigasi --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 247, 242, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  background: var(--lime);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}

.desktop-nav {
  display: none;
}

@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  .desktop-nav a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0.4rem 0.2rem;
    position: relative;
  }
  .desktop-nav a:hover,
  .desktop-nav a.active {
    color: var(--ink);
    opacity: 1;
  }
  .desktop-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--lime);
    border-radius: 2px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-wa {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.btn-header-wa:hover {
  transform: scale(1.05);
}

.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}

@media (min-width: 992px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* --- Mobile Drawer --- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 34, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(85vw, 360px);
  height: 100%;
  background: var(--bg);
  box-shadow: -8px 0 32px rgba(15, 42, 34, 0.15);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.drawer-close {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1.5rem;
  flex: 1;
}

.drawer-nav a {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.drawer-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Buttons (Aturan Kontras WCAG AA) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-target-min);
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-align: center;
  line-height: 1.2;
}

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

/* Tombol Utama: Background Lime -> Teks WAJIB --ink */
.btn-primary {
  background-color: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(184, 240, 74, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--sand);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  background-color: #dce2d2;
}

.btn-outline {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover {
  background-color: rgba(15, 42, 34, 0.05);
}

.btn-coral {
  background-color: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
}

.btn-coral:hover {
  box-shadow: 0 4px 16px rgba(255, 107, 74, 0.35);
  transform: translateY(-2px);
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

/* --- Badges & Tag --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-lime {
  background: var(--lime);
  color: var(--ink);
}

.badge-sand {
  background: var(--sand);
  color: var(--ink);
}

.badge-outline {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
}

/* --- Bento Grid System --- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-col-2 {
    grid-column: span 2;
  }
  .bento-col-3 {
    grid-column: span 3;
  }
}

.bento-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

.sand-card {
  background-color: var(--sand);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.card-icon-lime {
  background: var(--lime);
}

/* --- Stepper Komponen --- */
.stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
  gap: 0.5rem;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  position: relative;
  z-index: 2;
}

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.step-indicator.active .step-bubble {
  background: var(--lime);
  border-color: var(--ink);
  color: var(--ink);
}

.step-indicator.completed .step-bubble {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.step-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.step-indicator.active .step-title {
  color: var(--ink);
}

/* --- Formulir & Kontrol --- */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: var(--touch-target-min);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(184, 240, 74, 0.4);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--ink);
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Banner Box & Notifikasi --- */
.banner-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.warning-box {
  background: #fff8e6;
  border: 1px solid #ffd591;
  color: #873800;
}

.banner-icon {
  flex-shrink: 0;
}

/* --- Floating WhatsApp Button --- */
.floating-wa-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  background: #25d366;
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-wa-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45);
  opacity: 1;
}

@media (max-width: 540px) {
  .floating-wa-btn span {
    display: none;
  }
  .floating-wa-btn {
    padding: 0.85rem;
    width: 52px;
    height: 52px;
    justify-content: center;
  }
}

/* --- Cookie Banner (UU PDP No. 27/2022) --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 42, 34, 0.98);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  z-index: 180;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

.cookie-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cookie-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e0e7e3;
}

.cookie-text a {
  color: var(--lime);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--ink);
  color: #e0e7e3;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand h3 {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.footer-disclaimer-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #b5c7be;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: #b5c7be;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--lime);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.82rem;
  color: #8ba396;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.dev-toggle-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d1ded6;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  cursor: pointer;
  align-self: flex-start;
}

.dev-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Toast Message */
.app-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--ink);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 999;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}
