/* =========================
   Global
   ========================= */

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

:root {
  --gradify-navy: #001d6e;
  --gradify-red: #e12a45;
  --bg-soft: #f1f4ff;
  --bg-page: #edf2ff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-soft: #6b7280;
  --border-soft: #e5e7eb;
  --radius-xl: 24px;
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.12);
  --shadow-button: 0 12px 30px rgba(15, 23, 42, 0.18);
  --transition-fast: 0.18s ease-out;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(
    circle at top left,
    #f4f6ff 0,
    #e3ebff 40%,
    #dde7ff 100%
  );
  color: var(--text-main);
  scroll-behavior: smooth;
}

/* =========================
   Page layout
   ========================= */

.tw-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 32px;
}

.tw-main {
  width: 100%;
  max-width: 1080px;
  margin: 24px auto 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tw-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* =========================
   Header
   ========================= */

.tw-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #ffffff 0, #f3f6ff 40%, #eef3ff 100%);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tw-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tw-logo-pill {
  width: 80px;
  height: 80px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.tw-logo-letter {
  font-weight: 700;
  font-size: 26px;
  color: #ffffff;
}

.tw-logo-img {
  width: 50px;
  height: auto;
  object-fit: contain;
  display: block;
}

.tw-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tw-header-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0;
}

.tw-header-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--gradify-navy);
}

.tw-header-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* =========================
   Step chips kecil (indikator 1-2-3)
   ========================= */

.tw-step-chips-section {
  background: transparent;
  padding: 6px 4px 0;
}

.tw-step-chips-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 8px 4px;
}

.tw-step-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-chip {
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
  cursor: default;
}

.step-chip__number {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #d4dcff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gradify-navy);
}

.step-chip__label {
  font-weight: 600;
}

.step-chip--active {
  background: var(--gradify-navy);
  color: #ffffff;
}

.step-chip--active .step-chip__number {
  background: #ffffff;
  color: var(--gradify-navy);
}

/* =========================
   Sticky step label (DINONAKTIFKAN)
   ========================= */

.tw-sticky-step-label {
  position: sticky;
  top: 8px;
  z-index: 10;
  align-self: flex-start;
  margin: 0 auto 4px;
  max-width: 1080px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: none !important;
  align-items: center;
  gap: 6px;
  background: rgba(248, 250, 255, 0.92);
  color: #6b7280;
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
}

.tw-sticky-step-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gradify-navy);
}

.tw-sticky-step-label--visible {
  display: none !important;
}

/* =========================
   Guide box (Panduan Post Twibbon)
   ========================= */

.tw-guide-card {
  margin-bottom: 0;
  padding: 18px 18px 16px;
  background: rgba(248, 250, 255, 0.96);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

/* versi collapsible (untuk panduan paling atas) */
.tw-guide-card--collapsible {
  padding: 12px 16px 10px;
}

.tw-guide-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.tw-guide-card__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tw-guide-toggle-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e7eeff;
  color: var(--gradify-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background-color 0.2s ease-out;
  font-size: 0;
  position: relative;
}

.tw-guide-toggle-icon::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gradify-navy);
  border-bottom: 2px solid var(--gradify-navy);
  transform: rotate(45deg);
}

.tw-guide-card__header:hover .tw-guide-toggle-icon {
  background: #dde6ff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.tw-guide-card--collapsed .tw-guide-toggle-icon {
  transform: rotate(180deg);
}

.tw-guide-card__body {
  margin-top: 8px;
  max-height: 480px;
  overflow: hidden;
  transition: max-height 0.24s ease, opacity 0.2s ease, margin-top 0.2s ease;
  opacity: 1;
}

.tw-guide-card--collapsed .tw-guide-card__body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.tw-guide-card--collapsed .tw-guide-toggle-icon {
  transform: rotate(-90deg);
}

.tw-guide-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gradify-navy);
}

.tw-guide-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.tw-guide-list {
  margin: 0 0 10px 0;
  padding-left: 4px;
  font-size: 13px;
  color: var(--text-main);
}

.tw-guide-list li {
  margin-bottom: 4px;
}

.tw-guide-footer {
  margin: 4px 0 0;
  font-size: 12px;
  color: #4b5563;
}

/* IG full-frame icon */

.ig-frame-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  /* hitam dengan sedikit transparency, biar kelihatan abu-abu lembut */
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.55);
  margin: 0 3px;
  vertical-align: middle;
}

.ig-frame-icon svg {
  display: block;
}

/* =========================
   Cards (big steps)
   ========================= */

.tw-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 20px 20px 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    transform 0.15s ease-out;
}

.big-step {
  opacity: 0.96;
  background: rgba(255, 255, 255, 0.96);
}

.big-step--active {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(239, 246, 255, 0.98);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.18);
}

@media (min-width: 769px) {
  .big-step:hover {
    transform: translateY(-1px);
  }
}

/* Card header */

.tw-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.tw-card-header--accent-soft {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(37, 99, 235, 0.06);
  display: inline-flex;
}

.tw-card-step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tw-card-step-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--gradify-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

.tw-card-step-text {
  font-weight: 700;
  font-size: 15px;
  color: var(--gradify-navy);
}

/* Card body */

.tw-card-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
}

/* Inner card containers */

.tw-inner-card {
  border-radius: 20px;
  padding: 14px 16px 16px;
}

.tw-inner-card--neutral {
  background: #f5f7ff;
}

.tw-inner-card--preview {
  background: #f5f7ff;
}

.tw-inner-card--download {
  background: #f5f7ff;
}

.tw-inner-caption {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-soft);
}

/* =========================
   Buttons
   ========================= */

.tw-primary-button {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    opacity var(--transition-fast);
}

.tw-primary-button--full {
  width: 100%;
}

.tw-primary-button-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tw-primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tw-primary-button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.tw-primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.tw-primary-button.is-loading {
  cursor: wait;
  transform: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
  opacity: 0.95;
}

.tw-button-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  animation: tw-spin 0.75s linear infinite;
}

@keyframes tw-spin {
  to {
    transform: rotate(360deg);
  }
}

.tw-secondary-button {
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  background: #ffe7ea;
  color: #e12a45;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease-out;
}

.tw-secondary-button:hover {
  background: #ffd3d8;
}

.tw-secondary-button:active {
  transform: translateY(1px);
}

.tw-download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tw-zoom-reset {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

/* =========================
   File info & privacy
   ========================= */

.tw-file-info {
  margin: 10px 0 12px;
  font-size: 12px;
  color: var(--text-soft);
}

.tw-privacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #e6eeff;
}

.tw-privacy-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #34d399;
  margin-top: 4px;
}

.tw-privacy-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

/* =========================
   Canvas & preview
   ========================= */

.tw-canvas-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #e5edff;
  border: 2px solid rgba(191, 219, 254, 0.9);
  margin-top: 6px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.tw-canvas-shell--loading {
  position: relative;
}

.tw-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.tw-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  pointer-events: none;
}

.tw-canvas-placeholder--loading {
  background: linear-gradient(90deg, #e8edff 0%, #f6f8ff 50%, #e8edff 100%);
  background-size: 200% 100%;
  animation: tw-shimmer 1.2s infinite;
}

.tw-canvas-placeholder.loading {
  background: linear-gradient(90deg, #e8edff 0%, #f6f8ff 50%, #e8edff 100%);
  background-size: 200% 100%;
  animation: tw-shimmer 1.2s infinite;
}

@keyframes tw-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =========================
   Zoom controls
   ========================= */

.tw-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.tw-zoom-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: #eef2ff;
  color: var(--gradify-navy);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease-out, transform 0.12s ease-out;
}

.tw-zoom-button:hover {
  background: #e0e7ff;
}

.tw-zoom-button:active {
  transform: translateY(1px);
}

.tw-zoom-label {
  font-size: 13px;
  color: var(--text-soft);
}

.tw-preview-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

.tw-preview-tip--muted {
  color: #9ca3af;
}

/* =========================
   Status strip (toast kecil)
   ========================= */

.status-strip {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-strip__icon {
  font-size: 16px;
}

.status-strip__text {
  line-height: 1.4;
}

.status-strip--info {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-strip--success {
  background: #ecfdf5;
  color: #047857;
}

.status-strip--warning {
  background: #fffbeb;
  color: #b45309;
}

.status-strip--error {
  background: #fef2f2;
  color: #b91c1c;
}

/* =========================
   Floating back-to-top button (mobile)
   ========================= */

.tw-back-to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 29, 110, 0.94);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
  z-index: 20;
}

.tw-back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tw-back-to-top-icon {
  font-size: 18px;
  line-height: 1;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 768px) {
  .tw-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 18px;
  }

  .tw-header-left {
    align-items: flex-start;
    gap: 14px;
  }

  .tw-header-subtitle {
    font-size: 12px;
  }

  .tw-main {
    margin-top: 18px;
  }

  .tw-card {
    padding: 16px 16px 14px;
  }

  .tw-inner-card {
    padding: 12px 12px 14px;
  }

  .tw-download-buttons {
    flex-direction: column;
  }

  .tw-primary-button--full {
    width: 100%;
  }

  .tw-canvas-shell {
    max-width: 100%;
  }
}

@media (min-width: 769px) {
  .tw-back-to-top {
    display: none;
  }
}
/* IG full-frame icon (versi kecil) */
.ig-frame-icon--small {
  width: 14px !important;
  height: 14px !important;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
}
