:root {
  --primary: #0d6efd;
  --success: #198754;
  --bg: #f8f9fa;
}

body {
  background-color: var(--bg);
}

/* Snapshot validation styling */
.snapshot-invalid {
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 12px;
  background: #fff5f5;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.snapshot-valid {
  border: 2px solid #198754;
  border-radius: 8px;
  padding: 12px;
  background: #f0fff4;
  transition: border-color 0.3s ease, background 0.3s ease;
}

/* Disabled checkboxes (e.g. when Unfilled is selected) */
.form-check-input:disabled + .form-check-label {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Ensure images fit container */
img {
  max-width: 100%;
  height: auto;
}

/* Real-time validation: smooth border colour transition */
.form-control,
.form-select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Draft Restore Banner */
#draftBanner {
  border-left: 4px solid #0dcaf0;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

/* --- Floating Draft Indicator (Google Forms style) --- */
.draft-indicator {
  position: fixed;
  top: 12px;
  right: 16px;
  background: #323232;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.draft-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}
.draft-indicator.saving { background: #555; }
.draft-indicator.saved  { background: #2e7d32; }
.draft-indicator.error  { background: #c62828; }

.draft-icon {
  font-size: 1rem;
  line-height: 1;
}

@keyframes spin-icon {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.draft-icon.spinning {
  display: inline-block;
  animation: spin-icon 0.8s linear infinite;
}

/* Dynamic fields loader */
#dynamicFieldsLoader {
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Disabled dropdown while loading */
select:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Success Screen ── */
.success-checkmark svg {
  display: inline-block;
}
.success-circle {
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: draw-circle 0.6s ease-out forwards;
}
.success-tick {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-tick 0.4s 0.5s ease-out forwards;
}
@keyframes draw-circle {
  to { stroke-dashoffset: 0; }
}
@keyframes draw-tick {
  to { stroke-dashoffset: 0; }
}
