@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Brand and neutral palette: RescueForm Design System 0.9.0. */
  --rf-color-navy: #103a5c;
  --rf-color-blue: #2563eb;
  --rf-color-blue-hover: #1d4ed8;
  --rf-color-blue-active: #1e40af;
  --rf-color-teal: #14b8a6;
  --rf-color-teal-accessible: #0f766e;
  --rf-color-canvas: #f8fafc;
  --rf-color-white: #ffffff;
  --rf-color-neutral-50: #f8fafc;
  --rf-color-neutral-100: #f1f5f9;
  --rf-color-neutral-200: #e2e8f0;
  --rf-color-neutral-300: #cbd5e1;
  --rf-color-neutral-400: #94a3b8;
  --rf-color-neutral-500: #64748b;
  --rf-color-neutral-600: #475569;
  --rf-color-neutral-700: #334155;
  --rf-color-neutral-800: #1e293b;
  --rf-color-neutral-900: #0f172a;

  /* Default product theme: Blue. Alternate themes remain out of scope. */
  --rf-color-structure: var(--rf-color-navy);
  --rf-color-action: var(--rf-color-blue);
  --rf-color-action-hover: var(--rf-color-blue-hover);
  --rf-color-action-active: var(--rf-color-blue-active);
  --rf-color-accent: var(--rf-color-teal);
  --rf-color-focus: #93c5fd;
  --rf-color-nav-active: #dbeafe;
  --rf-color-selection: #eff6ff;
  --rf-color-link: var(--rf-color-blue-hover);
  --rf-color-highlight: #e0f2fe;

  --rf-color-text: var(--rf-color-neutral-900);
  --rf-color-text-muted: var(--rf-color-neutral-600);
  --rf-color-text-subtle: var(--rf-color-neutral-500);
  --rf-color-surface: var(--rf-color-white);
  --rf-color-surface-subtle: var(--rf-color-neutral-100);
  --rf-color-border: var(--rf-color-neutral-300);
  --rf-color-border-subtle: var(--rf-color-neutral-200);

  --rf-color-success: #047857;
  --rf-color-success-surface: #ecfdf5;
  --rf-color-warning: #b45309;
  --rf-color-warning-surface: #fffbeb;
  --rf-color-danger: #b91c1c;
  --rf-color-danger-hover: #991b1b;
  --rf-color-danger-surface: #fef2f2;
  --rf-color-info: #0369a1;
  --rf-color-info-surface: #f0f9ff;

  /* Approved Phase 1 feedback accents are retained without visual redesign. */
  --rf-feedback-info: #0079c1;
  --rf-feedback-success: #0f9f6e;
  --rf-feedback-danger: #d14b5a;
  --rf-feedback-border: #dce5f1;
  --rf-feedback-scrim: rgba(15, 23, 42, 0.48);
  --rf-feedback-surface: rgba(255, 255, 255, 0.96);
  --rf-feedback-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
  --rf-feedback-modal-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  --rf-feedback-focus: rgba(37, 99, 235, 0.28);
  --rf-feedback-modal-radius: 18px;
  --rf-feedback-control-min-height: 42px;

  --rf-space-xs: 4px;
  --rf-space-sm: 8px;
  --rf-space-md: 16px;
  --rf-space-lg: 24px;
  --rf-space-xl: 32px;
  --rf-space-2xl: 48px;
  --rf-space-3xl: 64px;

  --rf-radius-sm: 4px;
  --rf-radius-md: 8px;
  --rf-radius-lg: 12px;
  --rf-radius-xl: 16px;
  --rf-radius-full: 9999px;

  --rf-shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.05);
  --rf-shadow-md: 0 18px 45px rgba(15, 23, 42, 0.12);
  --rf-shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.18);

  --rf-border-width: 1px;
  --rf-border-style: solid;
  --rf-border: var(--rf-border-width) var(--rf-border-style) var(--rf-color-border);
  --rf-border-subtle: var(--rf-border-width) var(--rf-border-style) var(--rf-color-border-subtle);

  --rf-font-sans: "Inter", Arial, sans-serif;
  --rf-font-weight-regular: 400;
  --rf-font-weight-medium: 500;
  --rf-font-weight-semibold: 600;
  --rf-font-weight-bold: 700;
  --rf-font-size-caption: 12px;
  --rf-font-size-small: 14px;
  --rf-font-size-body: 16px;
  --rf-font-size-large: 18px;
  --rf-font-size-subtitle: 20px;
  --rf-font-size-h3: 24px;
  --rf-font-size-h2: 30px;
  --rf-font-size-h1: 36px;
  --rf-font-size-display: 48px;
  --rf-line-height-caption: 16px;
  --rf-line-height-small: 20px;
  --rf-line-height-body: 24px;
  --rf-line-height-large: 28px;
  --rf-line-height-subtitle: 28px;
  --rf-line-height-h3: 32px;
  --rf-line-height-h2: 36px;
  --rf-line-height-h1: 44px;
  --rf-line-height-display: 56px;

  --rf-control-min-height: 44px;
  --rf-focus-ring-width: 3px;
  --rf-focus-ring-offset: 2px;
  --rf-disabled-opacity: 0.48;
  --rf-loading-opacity: 0.72;
  --rf-scrim-opacity: 0.56;

  --rf-motion-fast: 120ms;
  --rf-motion-normal: 180ms;
  --rf-motion-slow: 240ms;
  --rf-motion-easing: cubic-bezier(0.2, 0, 0, 1);

  /* Reference values; media queries below use the same fixed boundaries. */
  --rf-breakpoint-mobile-max: 767px;
  --rf-breakpoint-tablet-min: 768px;
  --rf-breakpoint-desktop-min: 1024px;

  --rf-z-toast: 1300;
  --rf-z-modal: 1400;
}

.rf-type-display,
.rf-type-h1,
.rf-type-h2,
.rf-type-h3,
.rf-type-subtitle,
.rf-type-body,
.rf-type-small,
.rf-type-caption {
  font-family: var(--rf-font-sans);
}

.rf-type-display {
  font-size: var(--rf-font-size-display);
  font-weight: var(--rf-font-weight-bold);
  line-height: var(--rf-line-height-display);
}

.rf-type-h1 {
  font-size: var(--rf-font-size-h1);
  font-weight: var(--rf-font-weight-bold);
  line-height: var(--rf-line-height-h1);
}

.rf-type-h2 {
  font-size: var(--rf-font-size-h2);
  font-weight: var(--rf-font-weight-bold);
  line-height: var(--rf-line-height-h2);
}

.rf-type-h3 {
  font-size: var(--rf-font-size-h3);
  font-weight: var(--rf-font-weight-semibold);
  line-height: var(--rf-line-height-h3);
}

.rf-type-subtitle {
  font-size: var(--rf-font-size-subtitle);
  font-weight: var(--rf-font-weight-semibold);
  line-height: var(--rf-line-height-subtitle);
}

.rf-type-body {
  font-size: var(--rf-font-size-body);
  font-weight: var(--rf-font-weight-regular);
  line-height: var(--rf-line-height-body);
}

.rf-type-small {
  font-size: var(--rf-font-size-small);
  font-weight: var(--rf-font-weight-regular);
  line-height: var(--rf-line-height-small);
}

.rf-type-caption {
  font-size: var(--rf-font-size-caption);
  font-weight: var(--rf-font-weight-medium);
  line-height: var(--rf-line-height-caption);
}

.rf-button,
.rf-icon-button,
.rf-field,
.rf-field *,
.rf-card,
.rf-panel,
.rf-badge,
.rf-loader {
  box-sizing: border-box;
}

.rf-button,
.rf-link,
.rf-field input,
.rf-field select,
.rf-field textarea,
.confirmation-modal button {
  font-family: var(--rf-font-sans);
}

.rf-button,
.rf-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-sm);
  min-height: var(--rf-control-min-height);
  border: var(--rf-border-width) var(--rf-border-style) transparent;
  border-radius: var(--rf-radius-md);
  font-size: var(--rf-font-size-small);
  font-weight: var(--rf-font-weight-semibold);
  line-height: var(--rf-line-height-small);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--rf-motion-fast) var(--rf-motion-easing),
    border-color var(--rf-motion-fast) var(--rf-motion-easing),
    color var(--rf-motion-fast) var(--rf-motion-easing),
    box-shadow var(--rf-motion-fast) var(--rf-motion-easing);
}

.rf-button {
  padding: 0 var(--rf-space-md);
}

.rf-icon-button {
  width: var(--rf-control-min-height);
  padding: 0;
}

.rf-button--primary {
  border-color: var(--rf-color-action);
  background: var(--rf-color-action);
  color: var(--rf-color-white);
}

.rf-button--primary:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--rf-color-action-hover);
  background: var(--rf-color-action-hover);
}

.rf-button--primary:active:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--rf-color-action-active);
  background: var(--rf-color-action-active);
}

.rf-button--secondary,
.rf-icon-button {
  border-color: var(--rf-color-border);
  background: var(--rf-color-surface);
  color: var(--rf-color-structure);
}

.rf-button--secondary:hover:not(:disabled):not([aria-disabled="true"]),
.rf-icon-button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--rf-color-action);
  background: var(--rf-color-selection);
  color: var(--rf-color-action-hover);
}

.rf-button--danger {
  border-color: var(--rf-color-danger);
  background: var(--rf-color-danger);
  color: var(--rf-color-white);
}

.rf-button--danger:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--rf-color-danger-hover);
  background: var(--rf-color-danger-hover);
}

.rf-button:disabled,
.rf-icon-button:disabled,
.rf-button[aria-disabled="true"],
.rf-icon-button[aria-disabled="true"] {
  opacity: var(--rf-disabled-opacity);
  cursor: not-allowed;
}

.rf-button[aria-busy="true"],
.rf-icon-button[aria-busy="true"] {
  opacity: var(--rf-loading-opacity);
  cursor: wait;
}

.rf-link {
  color: var(--rf-color-link);
  font-weight: var(--rf-font-weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.rf-link:hover {
  color: var(--rf-color-action-active);
  text-decoration-thickness: 2px;
}

.rf-button:focus-visible,
.rf-icon-button:focus-visible,
.rf-link:focus-visible,
.rf-field input:focus-visible,
.rf-field select:focus-visible,
.rf-field textarea:focus-visible {
  outline: var(--rf-focus-ring-width) solid var(--rf-color-focus);
  outline-offset: var(--rf-focus-ring-offset);
}

.rf-field {
  display: grid;
  min-width: 0;
  gap: var(--rf-space-sm);
  color: var(--rf-color-text);
  font-family: var(--rf-font-sans);
}

.rf-field label,
.rf-field__label {
  color: var(--rf-color-neutral-700);
  font-size: var(--rf-font-size-small);
  font-weight: var(--rf-font-weight-semibold);
  line-height: var(--rf-line-height-small);
}

.rf-field__required {
  color: var(--rf-color-danger);
}

.rf-field input,
.rf-field select,
.rf-field textarea {
  width: 100%;
  min-height: var(--rf-control-min-height);
  padding: 10px 12px;
  border: var(--rf-border);
  border-radius: var(--rf-radius-md);
  background: var(--rf-color-surface);
  color: var(--rf-color-text);
  font-size: var(--rf-font-size-body);
  line-height: var(--rf-line-height-body);
  transition:
    border-color var(--rf-motion-fast) var(--rf-motion-easing),
    box-shadow var(--rf-motion-fast) var(--rf-motion-easing),
    background-color var(--rf-motion-fast) var(--rf-motion-easing);
}

.rf-field textarea {
  min-height: 96px;
  resize: vertical;
}

.rf-field input:hover:not(:disabled):not([readonly]),
.rf-field select:hover:not(:disabled),
.rf-field textarea:hover:not(:disabled):not([readonly]) {
  border-color: var(--rf-color-neutral-400);
}

.rf-field input:focus,
.rf-field select:focus,
.rf-field textarea:focus {
  border-color: var(--rf-color-action);
}

.rf-field input:disabled,
.rf-field select:disabled,
.rf-field textarea:disabled {
  background: var(--rf-color-neutral-100);
  color: var(--rf-color-neutral-500);
  opacity: var(--rf-disabled-opacity);
  cursor: not-allowed;
}

.rf-field input[readonly],
.rf-field textarea[readonly] {
  background: var(--rf-color-neutral-50);
  color: var(--rf-color-neutral-600);
}

.rf-field.is-error input,
.rf-field.is-error select,
.rf-field.is-error textarea,
.rf-field input[aria-invalid="true"],
.rf-field select[aria-invalid="true"],
.rf-field textarea[aria-invalid="true"] {
  border-color: var(--rf-color-danger);
  background: var(--rf-color-danger-surface);
}

.rf-field.is-success input,
.rf-field.is-success select,
.rf-field.is-success textarea {
  border-color: var(--rf-color-success);
  background: var(--rf-color-success-surface);
}

.rf-field__help,
.rf-field__error {
  margin: 0;
  font-size: var(--rf-font-size-caption);
  line-height: var(--rf-line-height-caption);
}

.rf-field__help {
  color: var(--rf-color-text-subtle);
}

.rf-field__error {
  color: var(--rf-color-danger);
  font-weight: var(--rf-font-weight-semibold);
}

.rf-card,
.rf-panel {
  border: var(--rf-border-subtle);
  background: var(--rf-color-surface);
  color: var(--rf-color-text);
  font-family: var(--rf-font-sans);
}

.rf-card {
  padding: var(--rf-space-md);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-sm);
}

.rf-card.is-selected {
  border-color: var(--rf-color-action);
  background: var(--rf-color-selection);
}

.rf-panel {
  border-radius: var(--rf-radius-xl);
  box-shadow: var(--rf-shadow-md);
}

.rf-panel__header,
.rf-panel__body,
.rf-panel__footer {
  padding: var(--rf-space-md) var(--rf-space-lg);
}

.rf-panel__header {
  border-bottom: var(--rf-border-subtle);
}

.rf-panel__footer {
  border-top: var(--rf-border-subtle);
}

.rf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: var(--rf-radius-full);
  background: var(--rf-color-surface-subtle);
  color: var(--rf-color-neutral-700);
  font-family: var(--rf-font-sans);
  font-size: var(--rf-font-size-caption);
  font-weight: var(--rf-font-weight-semibold);
  line-height: var(--rf-line-height-caption);
  white-space: nowrap;
}

.rf-badge--info {
  background: var(--rf-color-info-surface);
  color: var(--rf-color-info);
}

.rf-badge--success {
  background: var(--rf-color-success-surface);
  color: var(--rf-color-success);
}

.rf-badge--warning {
  background: var(--rf-color-warning-surface);
  color: var(--rf-color-warning);
}

.rf-badge--danger {
  background: var(--rf-color-danger-surface);
  color: var(--rf-color-danger);
}

.rf-loader {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--rf-color-nav-active);
  border-top-color: var(--rf-color-action);
  border-radius: 50%;
  animation: rf-spin 0.8s linear infinite;
}

.rf-loader--small {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.rf-loader[aria-hidden="false"] {
  vertical-align: middle;
}

.rf-icon,
.rf-button svg,
.rf-icon-button svg {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  stroke-width: 2;
}

.rf-container {
  width: min(100% - (2 * var(--rf-space-md)), 1440px);
  margin-inline: auto;
}

.rf-stack {
  display: grid;
  gap: var(--rf-space-md);
}

.rf-cluster,
.rf-actions {
  display: flex;
  align-items: center;
  gap: var(--rf-space-sm);
  flex-wrap: wrap;
}

.rf-actions {
  justify-content: flex-end;
}

.rf-grid {
  display: grid;
  gap: var(--rf-space-md);
  grid-template-columns: minmax(0, 1fr);
}

.rf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes rf-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 768px) {
  .rf-container {
    width: min(100% - (2 * var(--rf-space-lg)), 1440px);
  }

  .rf-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .rf-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .rf-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rf-actions > .rf-button {
    width: 100%;
  }

  .rf-type-display {
    font-size: var(--rf-font-size-h1);
    line-height: var(--rf-line-height-h1);
  }

  .rf-type-h1 {
    font-size: var(--rf-font-size-h2);
    line-height: var(--rf-line-height-h2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rf-button,
  .rf-icon-button,
  .rf-field input,
  .rf-field select,
  .rf-field textarea {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }

  .rf-loader {
    animation: none;
  }
}
