/* lp-error-modal.css — Friendly error modal + PDF splitter UI.
 *
 * Two components share this file:
 *   .lp-error-modal   — the friendly error message shown on any caught error
 *   .lp-split-modal   — the PDF splitter shown when upload.too_large fires
 *
 * Both follow the LegalPrecision visual system: dark green primary,
 * generous spacing, Inter / system sans, no decoration.
 */

/* ── Shared overlay + panel base ─────────────────────────────────────── */

.lp-error-modal,
.lp-split-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.lp-error-modal__backdrop,
.lp-split-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.55);
  backdrop-filter: blur(2px);
}

.lp-error-modal__panel,
.lp-split-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  color: #1a2229;
  line-height: 1.5;
}

.lp-error-modal__close,
.lp-split-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #6b7680;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}

.lp-error-modal__close:hover,
.lp-split-modal__close:hover {
  background: #f0f3f5;
  color: #1a2229;
}

/* ── Friendly error modal ────────────────────────────────────────────── */

.lp-error-modal__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #0f3a2e;
  line-height: 1.3;
}

.lp-error-modal__body {
  font-size: 16px;
  margin: 0 0 20px 0;
  color: #2a3640;
}

.lp-error-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.lp-error-modal__escalation {
  font-size: 14px;
  color: #5a6770;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e6eaee;
}

.lp-error-modal__escalation a {
  color: #0f3a2e;
  text-decoration: underline;
}

/* Severity indicator (top accent bar) */
.lp-error-modal__panel[data-severity="error"] {
  border-top: 4px solid #b3261e;
}
.lp-error-modal__panel[data-severity="warn"] {
  border-top: 4px solid #c47b00;
}
.lp-error-modal__panel[data-severity="info"] {
  border-top: 4px solid #0f3a2e;
}

/* ── Splitter modal ──────────────────────────────────────────────────── */

#lp-split-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #0f3a2e;
  line-height: 1.3;
}

.lp-split-modal__intro {
  font-size: 15px;
  color: #2a3640;
  margin: 0 0 20px 0;
}

.lp-split-modal__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  background: #f4faf7;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 20px 0;
  border: 1px solid #d8e7df;
}

.lp-split-modal__filename {
  color: #1a2229;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.lp-split-modal__pagecount {
  color: #0f3a2e;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.lp-split-modal__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a2229;
  margin: 0 0 6px 0;
}

.lp-split-modal__input {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid #c2cdd5;
  border-radius: 8px;
  background: #ffffff;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #1a2229;
}

.lp-split-modal__input:focus {
  outline: none;
  border-color: #0f3a2e;
  box-shadow: 0 0 0 3px rgba(15, 58, 46, 0.15);
}

.lp-split-modal__input:disabled {
  background: #f0f3f5;
  color: #8b97a0;
  cursor: not-allowed;
}

.lp-split-modal__hint {
  font-size: 13px;
  color: #5a6770;
  margin: 8px 0 0 0;
}

.lp-split-modal__hint code {
  background: #eef2f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #1a2229;
}

.lp-split-modal__error {
  font-size: 14px;
  color: #b3261e;
  margin: 12px 0 0 0;
  min-height: 20px;
}

.lp-split-modal__error:empty {
  margin: 0;
  min-height: 0;
}

.lp-split-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ── Buttons (shared) ────────────────────────────────────────────────── */

.lp-error-modal__btn,
.lp-split-modal__btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  line-height: 1.2;
}

.lp-error-modal__btn--primary,
.lp-split-modal__btn--primary {
  background: #0f3a2e;
  color: #ffffff;
  border-color: #0f3a2e;
}

.lp-error-modal__btn--primary:hover:not(:disabled),
.lp-split-modal__btn--primary:hover:not(:disabled) {
  background: #0a2c22;
  border-color: #0a2c22;
}

.lp-error-modal__btn--primary:disabled,
.lp-split-modal__btn--primary:disabled {
  background: #6b8278;
  border-color: #6b8278;
  cursor: not-allowed;
}

.lp-error-modal__btn--ghost,
.lp-split-modal__btn--ghost {
  background: #ffffff;
  color: #2a3640;
  border-color: #c2cdd5;
}

.lp-error-modal__btn--ghost:hover,
.lp-split-modal__btn--ghost:hover {
  background: #f0f3f5;
  border-color: #94a2ac;
}

.lp-error-modal__btn--link {
  background: transparent;
  color: #0f3a2e;
  border-color: transparent;
  text-decoration: underline;
  padding: 11px 8px;
}

/* ── Mobile tightening ───────────────────────────────────────────────── */

@media (max-width: 480px) {
  .lp-error-modal__panel,
  .lp-split-modal__panel {
    padding: 24px 20px 20px;
    border-radius: 10px;
  }
  .lp-error-modal__title,
  #lp-split-title {
    font-size: 19px;
  }
  .lp-split-modal__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .lp-split-modal__actions .lp-split-modal__btn {
    width: 100%;
  }
  .lp-error-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .lp-error-modal__actions .lp-error-modal__btn {
    width: 100%;
  }
}
