/* =============================================
   AGTAG DEMO WIDGET — Inline 30-second demo
   All selectors namespaced under .agtag-demo
   ============================================= */

.agtag-demo {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  font-family: 'Inter', 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #181E14;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 520px;
}

/* ── HEADER ── */
.agtag-demo .demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1E4D12;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.agtag-demo .demo-step-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}
.agtag-demo .demo-step-label strong {
  color: #fff;
}
.agtag-demo .demo-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #4BAD2A;
  background: rgba(75,173,42,0.12);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── PROGRESS ── */
.agtag-demo .demo-progress {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #1E4D12;
  padding-bottom: 10px;
}
.agtag-demo .demo-progress-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.agtag-demo .demo-progress-dot.done {
  background: #4BAD2A;
}
.agtag-demo .demo-progress-dot.active {
  background: #2D7A1A;
}

/* ── BODY ── */
.agtag-demo .demo-body {
  padding: 22px 22px 20px;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

/* ── SCREEN TRANSITIONS ── */
.agtag-demo .demo-screen {
  display: none;
  animation: agtag-fadein 0.25s ease;
}
.agtag-demo .demo-screen.active {
  display: block;
}
@keyframes agtag-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FORM STYLES ── */
.agtag-demo .demo-title {
  font-size: 16px;
  font-weight: 700;
  color: #181E14;
  margin: 0 0 4px;
}
.agtag-demo .demo-subtitle {
  font-size: 12px;
  color: #6B7A65;
  margin: 0 0 18px;
}
.agtag-demo .demo-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #EBF5E6;
  border: 1px solid #DDE8D8;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 11px;
  color: #1E4D12;
}
.agtag-demo .demo-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #2D7A1A;
}
.agtag-demo .demo-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.agtag-demo .demo-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.agtag-demo .demo-row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.agtag-demo label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #6B7A65;
  margin-bottom: 4px;
}
.agtag-demo input,
.agtag-demo select {
  width: 100%;
  background: #F4FAF1;
  border: 1px solid #DDE8D8;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: #181E14;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.agtag-demo input:focus,
.agtag-demo select:focus {
  outline: none;
  border-color: #2D7A1A;
  background: #fff;
}
.agtag-demo input::placeholder {
  color: #A8B5A2;
}
.agtag-demo .demo-label-muted {
  color: #A8B5A2;
  font-weight: 400;
}

/* ── BUTTONS ── */
.agtag-demo .demo-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.agtag-demo .demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #DDE8D8;
  background: #fff;
  color: #181E14;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.agtag-demo .demo-btn:hover {
  background: #F4FAF1;
}
.agtag-demo .demo-btn.primary {
  background: #1E4D12;
  color: #fff;
  border-color: #1E4D12;
}
.agtag-demo .demo-btn.primary:hover {
  background: #2D7A1A;
}
.agtag-demo .demo-btn.green-full {
  background: #4BAD2A;
  color: #fff;
  border-color: #4BAD2A;
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 11px 18px;
}
.agtag-demo .demo-btn.green-full:hover {
  background: #2D7A1A;
}

/* ── LABEL PREVIEW ── */
.agtag-demo .demo-label-card {
  background: #fff;
  border: 1.5px solid #DDE8D8;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}
.agtag-demo .demo-label-header {
  background: #1E4D12;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}
.agtag-demo .demo-pti-badge {
  font-size: 9px;
  font-weight: 600;
  background: #4BAD2A;
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
}
.agtag-demo .demo-label-body {
  padding: 14px;
}
.agtag-demo .demo-barcode-row {
  display: flex;
  gap: 1.5px;
  height: 30px;
  margin-bottom: 4px;
}
.agtag-demo .demo-barcode-row .bar {
  background: #181E14;
  border-radius: 1px;
}
.agtag-demo .demo-gtin {
  font-size: 9px;
  color: #A8B5A2;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
}
.agtag-demo .demo-lbl-farm {
  font-size: 13px;
  font-weight: 700;
  color: #181E14;
  letter-spacing: 0.02em;
}
.agtag-demo .demo-lbl-addr {
  font-size: 10px;
  color: #6B7A65;
  margin-bottom: 8px;
}
.agtag-demo .demo-lbl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  padding-top: 8px;
  border-top: 1px solid #DDE8D8;
  margin-bottom: 8px;
}
.agtag-demo .demo-lbl-k {
  font-size: 9px;
  color: #A8B5A2;
}
.agtag-demo .demo-lbl-v {
  font-size: 11px;
  font-weight: 600;
  color: #181E14;
}
.agtag-demo .demo-lbl-badges {
  display: flex;
  gap: 6px;
}
.agtag-demo .demo-badge-pti {
  font-size: 9px;
  font-weight: 600;
  background: #EBF5E6;
  color: #1E4D12;
  padding: 2px 8px;
  border-radius: 20px;
}
.agtag-demo .demo-badge-gs1 {
  font-size: 9px;
  background: #F4FAF1;
  color: #6B7A65;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #DDE8D8;
}

/* ── REVIEW GRID ── */
.agtag-demo .demo-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.agtag-demo .demo-review-k {
  font-size: 10px;
  color: #6B7A65;
  margin-bottom: 1px;
}
.agtag-demo .demo-review-v {
  font-size: 13px;
  font-weight: 500;
  color: #181E14;
}

/* ── SUCCESS ── */
.agtag-demo .demo-success {
  text-align: center;
  padding: 16px 0 0;
  position: relative;
  overflow: hidden;
}
.agtag-demo .demo-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #EBF5E6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.agtag-demo .demo-success h3 {
  font-size: 18px;
  font-weight: 700;
  color: #181E14;
  margin: 0 0 4px;
}
.agtag-demo .demo-success-time {
  font-size: 36px;
  font-weight: 800;
  color: #1E4D12;
  margin: 8px 0;
}
.agtag-demo .demo-success p {
  font-size: 13px;
  color: #6B7A65;
  line-height: 1.5;
  margin: 0 0 20px;
}
.agtag-demo .demo-success-ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── CONFETTI ── */
.agtag-demo .confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: agtag-confetti-fall 2.5s ease-in forwards;
  pointer-events: none;
}
@keyframes agtag-confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .agtag-demo {
    max-width: 100%;
  }
}
@media (max-width: 480px) {
  .agtag-demo .demo-body {
    padding: 16px;
  }
  .agtag-demo .demo-row2,
  .agtag-demo .demo-row3 {
    grid-template-columns: 1fr;
  }
}
