/* Everything is scoped under .afs-widget so the theme cannot clash with it. */
.afs-widget,
.afs-widget *,
.afs-widget *::before,
.afs-widget *::after { box-sizing: border-box; }

.afs-widget {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #111827;
}
.afs-widget [hidden] { display: none !important; }

.afs-widget .afs-grid { display: flex; gap: 20px; flex-wrap: wrap; }

.afs-widget .afs-box {
  flex: 1;
  min-width: 260px;
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  text-align: center;
  padding: 20px;
  background: #fafafa;
  transition: .25s;
}
.afs-widget .afs-box:hover { border-color: #4f46e5; background: #eef2ff; }

.afs-widget .afs-label { display: block; cursor: pointer; margin: 0; }
.afs-widget .afs-icon { display: block; font-size: 28px; }
.afs-widget .afs-title { display: block; margin: 8px 0 10px; color: inherit; }

.afs-widget .afs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid #4f46e5; border-radius: 8px;
  color: #4f46e5; font-size: 14px; background: transparent;
}

.afs-widget .afs-preview {
  display: block;
  width: 100%; max-width: 100%; height: auto; max-height: 160px;
  margin: 10px auto 0;
  border-radius: 10px; object-fit: contain;
}

.afs-widget .afs-main {
  display: block; width: 100%;
  margin: 20px 0 0; padding: 14px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: none; text-transform: none; letter-spacing: normal;
}
.afs-widget .afs-main:disabled { opacity: .6; cursor: not-allowed; }

.afs-widget .afs-progress {
  margin-top: 15px; height: 10px;
  background: #e5e7eb; border-radius: 10px; overflow: hidden;
}
.afs-widget .afs-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width .2s;
}

.afs-widget .afs-message { margin: 12px 0 0; color: #b91c1c; text-align: center; }

.afs-widget .afs-output {
  margin-top: 20px; padding: 15px;
  background: #f9fafb; border-radius: 12px; text-align: center;
}
.afs-widget .afs-result { display: inline-block; max-width: 100%; max-height: 220px; height: auto; }

.afs-widget .afs-download {
  display: inline-block; margin-top: 12px; padding: 10px 20px;
  background: #10b981; color: #fff !important;
  border-radius: 8px; text-decoration: none !important; box-shadow: none;
}

.elementor-editor-active .afs-widget .afs-label { pointer-events: none; }
