/*
  The blocked-submit dialog raised by form-validation.js.

  Hand-authored for the same reason as status.css: workspace.css is a Tailwind
  BUILD OUTPUT, and this markup is created at runtime by JavaScript, so Tailwind's
  content scan would never see the classes and would purge them.

  It replaces an in-form red banner that read as one run-on sentence -- "7 fields
  need attention before this can be saved. Company name: Enter a company name.
  Login email: ..." -- which on a long form scrolled out of view and could not be
  acted on. Each failure is now its own row, and each row is a button that takes
  you to the field.
*/

.fv-dialog {
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100vh - 4rem));
  padding: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  background: var(--surface-raised, #ffffff);
  color: var(--text-primary, #0f172a);
  box-shadow: 0 24px 60px -28px rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.fv-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

/* The no-<dialog> fallback: a fixed overlay that centres the same panel. */
.fv-dialog-fallback {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.fv-dialog-fallback[hidden] {
  display: none;
}

.fv-dialog__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem 0.75rem;
}

.fv-dialog__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  background: #fff1f2;
  color: #be123c;
}

.fv-dialog__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.fv-dialog__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-heading, #020617);
}

.fv-dialog__lead {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted, #475569);
}

.fv-dialog__list {
  margin: 0;
  padding: 0 1.25rem;
  max-height: 18rem;
  overflow-y: auto;
  list-style: none;
}

.fv-dialog__item + .fv-dialog__item {
  margin-top: 0.375rem;
}

.fv-dialog__row {
  display: flex;
  width: 100%;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--surface, #ffffff);
  font: inherit;
  text-align: left;
  color: inherit;
}

/* A row only looks clickable when it can actually take you somewhere: group
   rules (a file list, a selection) have no control to focus. */
button.fv-dialog__row {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button.fv-dialog__row:hover {
  border-color: var(--border-hover, #cbd5e1);
  background: var(--inset, #f8fafc);
}

button.fv-dialog__row:focus-visible {
  outline: 2px solid var(--focus-ring, #3b82f6);
  outline-offset: 1px;
}

.fv-dialog__marker {
  flex: 0 0 auto;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.4375rem;
  border-radius: 9999px;
  background: #be123c;
}

.fv-dialog__field {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-heading, #020617);
}

.fv-dialog__msg {
  display: block;
  margin-top: 0.0625rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted, #475569);
}

.fv-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem 1.125rem;
}

.fv-dialog__ok {
  min-width: 5.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--btn-primary-border, #2563eb);
  border-radius: 0.5rem;
  background: var(--btn-primary-bg, #2563eb);
  color: var(--btn-primary-text, #ffffff);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.fv-dialog__ok:hover {
  background: var(--btn-primary-bg-hover, #1d4ed8);
}

.fv-dialog__ok:focus-visible {
  outline: 2px solid var(--focus-ring, #3b82f6);
  outline-offset: 2px;
}

[data-theme="midnight"] .fv-dialog__icon {
  background: rgba(248, 113, 113, 0.16);
  color: #f79c8c;
}

[data-theme="midnight"] .fv-dialog__marker {
  background: #f87171;
}
