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

/* ── Initial states (menggantikan inline style di HTML) ── */
#flyerPanel { display: none; }
#flyerLoadingState { display: none; }
#flyerCanvasWrap { position: relative; display: none; }
#flyerCanvas { cursor: zoom-in; }
#canvasWrap { position: relative; display: none; }
#previewCanvas { cursor: zoom-in; }

:root {
  --teal: #008fa8;
  --teal-dark: #006e80;
  --teal-light: #d6f1f5;
  --yellow: #f5c842;
  --white: #ffffff;
  --gray-100: #f4f7f9;
  --gray-200: #e2e8ed;
  --gray-500: #8a9ab0;
  --gray-700: #3d4f60;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.navbar-logo {
  height: 32px;
  width: auto;
  display: block;
}
.navbar-tagline {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
}
.navbar-hero-text {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.navbar-hero-sub {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
  opacity: 0.85;
}
.navbar-hero-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gray-700);
  text-align: right;
  line-height: 1.3;
}

/* ── Hero ── */
.hero {
  background: var(--teal);
  padding: 20px 24px;
  color: var(--white);
  position: sticky;
  top: 52px;
  z-index: 9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.hero-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
}

/* ── App Container ── */
.app-container {
  padding: 20px 24px 52px;
  width: 100%;
  flex: 1;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.18s;
}
.tab-btn:hover {
  border-color: var(--teal);
}
.tab-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}
.tab-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tab-btn.disabled:hover {
  border-color: var(--gray-200);
}
.tab-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.tab-text-wrap {
  display: flex;
  flex-direction: column;
}
.tab-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: inherit;
}
.tab-btn:not(.active) .tab-label { color: var(--gray-700); }
.tab-sub {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 1px;
}
.tab-btn:not(.active) .tab-sub { color: var(--gray-500); opacity: 1; }

/* ── Layout 2 Kolom ── */
.layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.form-panel {
  flex: 4;
  min-width: 0;
}
.preview-panel {
  flex: 8;
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Lightbox fullscreen */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 200;
  align-items: center; justify-content: center;
  padding: 16px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
  cursor: default;
}
.lightbox-size {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: 0.75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  pointer-events: none;
  letter-spacing: 0.5px;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15); border: none;
  color: white; font-size: 1.2rem; cursor: pointer;
  z-index: 201; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ── Footer Bar ── */
.footer-bar {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 11px 20px;
  font-size: 0.78rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 7px;
  position: sticky;
  bottom: 0;
  z-index: 10;
  white-space: nowrap;
  overflow: hidden;
}
.footer-bar a { color: var(--teal); text-decoration: none; font-weight: 700; }
.footer-bar-icon { font-size: 0.9rem; flex-shrink: 0; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .form-panel { flex: none; width: 100%; }
  .preview-panel { display: none; }

  .hero {
    padding: 8px 16px;
    top: 52px;
  }
  .hero-sub { font-size: 0.7rem; letter-spacing: 0.8px; margin-bottom: 1px; font-weight: 600; }
  .hero-title { font-size: 0.875rem; line-height: 1.3; font-weight: 700; }

  body { display: block; min-height: unset; }

  .app-container { padding-bottom: 68px; }

  .footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    font-size: 0.72rem;
    flex-wrap: wrap;
    gap: 4px;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }
  .footer-bar-icon { display: none; }

  .tab-btn {
    padding: 8px 10px;
    gap: 8px;
  }
  .tab-icon { font-size: 1rem; }
  .tab-label { font-size: 0.78rem; }
  .tab-sub { display: none; }
}
