/* Base custom styles — Tailwind CDN handles utilities */

/* Minimum touch target for choice buttons */
.choice-btn {
  min-height: 44px;
  touch-action: manipulation;
}

/* Selected state */
.choice-btn.selected {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}

/* Risk severity button selected states */
.risk-btn[data-severity="low"].selected {
  background-color: #fef9c3;
  border-color: #ca8a04;
  box-shadow: 0 0 0 2px #ca8a04;
}
.risk-btn[data-severity="medium"].selected {
  background-color: #ffedd5;
  border-color: #ea580c;
  box-shadow: 0 0 0 2px #ea580c;
}
.risk-btn[data-severity="high"].selected {
  background-color: #fee2e2;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px #dc2626;
}

/* Smooth conditional reveal */
.question-block {
  transition: opacity 0.2s ease;
}

/* ------------------------------------------------------------------------
   Management record pages (void_management / compliance_management)
   In-place htmx updates — see app/static/js/record-async.js.
   Plain CSS rather than Tailwind utilities so these states don't depend on
   the committed tailwind.css being rebuilt.
   ------------------------------------------------------------------------ */

/* In-flight control: dim it and block a second click while the POST runs, so
   a double-tap can't fire the same toggle twice. */
.htmx-request,
.htmx-request button[type="submit"] {
  opacity: 0.55;
  pointer-events: none;
}

/* Inline failure message, inserted directly after the form that failed. */
.record-async-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
}

/* Transient "Saved" confirmation — without a page reload there is otherwise
   no sign that a Save button did anything. */
.record-async-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  background-color: #111827;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.record-async-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Full-size audit photo opened from a thumbnail (see record-async.js).
   Built in JS, so plain CSS rather than a markup overlay. */
.record-lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: rgba(17, 24, 39, 0.85);
  cursor: zoom-out;
}

.record-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
  background-color: #fff;
}

/* Submission progress overlay (base.html). Moved out of an inline <style>
   block so the page no longer needs 'unsafe-inline' for style elements. */
@keyframes spo-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes spo-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.spo-overlay {
  background: rgba(15, 23, 42, 0.65);
}
.spo-spin {
  animation: spo-spin 0.9s linear infinite;
}
.spo-pulse {
  animation: spo-pulse 1.4s ease-in-out infinite;
}
.spo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  animation: spo-pulse 1s ease-in-out infinite;
}

/* Void Management weekly calendar grid (dashboard.html). Moved out of inline
   style= attributes so the page no longer needs 'unsafe-inline' for styles. */
.cal-grid7 {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-grid7-tall {
  min-height: 350px;
}
.cal-col + .cal-col {
  border-left: 1px solid #e5e7eb;
}
