/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.default.min.css");

.ts-wrapper.single .ts-control {
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  min-height: 42px;
  padding: 0.45rem 0.625rem;
  box-shadow: none;
}

.ts-wrapper.single.focus .ts-control {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.35);
}

.ts-wrapper .ts-dropdown {
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.ts-wrapper .ts-dropdown .option,
.ts-wrapper .ts-dropdown .active {
  font-size: 0.875rem;
}

/* Loaded after CDN tom-select.css — reinforce selected-row styling (theme vars from Tailwind :root) */
.ts-wrapper .ts-dropdown .option.active:not(.selected) {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.ts-wrapper .ts-dropdown .option.selected {
  background-color: hsl(var(--primary) / 0.16);
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: inset 3px 0 0 hsl(var(--ring));
}

.ts-wrapper .ts-dropdown .option.selected.active {
  background-color: hsl(var(--primary) / 0.26);
}

/* Turbo global loader (see page_loader_controller.js) */
html.page-loader-active {
  cursor: progress;
}

@keyframes securePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(17, 94, 89, 0.12), 0 0 0 8px rgba(17, 94, 89, 0.08);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(17, 94, 89, 0.08), 0 0 0 16px rgba(17, 94, 89, 0.04);
    transform: scale(1.025);
  }
}

@keyframes statusFade {
  0% {
    opacity: 0.45;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressGlow {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.prefill-step-node-active {
  animation: securePulse 1.8s ease-in-out infinite;
}

.prefill-step-connector-active {
  animation: progressGlow 1.6s ease-in-out infinite;
}

.prefill-step-entered {
  animation: statusFade 0.45s ease-out;
}

/* Prefill timeline loader — Apple Watch / premium step flow */
@keyframes prefillHeroEnter {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes prefillHeroExit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-36px) scale(0.72);
  }
}

@keyframes prefillChipEnter {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes prefillHeroGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(41, 91, 45, 0.18);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(41, 91, 45, 0);
  }
}

@keyframes prefillLineDraw {
  0% {
    transform: scaleY(0);
    opacity: 0.35;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.prefill-timeline-loader__completed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  transition: min-height 0.35s ease;
}

.prefill-timeline-loader__completed--empty {
  min-height: 0;
  margin-top: 0 !important;
}

.prefill-timeline-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(41, 91, 45, 0.12);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 0.875rem;
  box-shadow: 0 8px 24px -18px rgba(41, 91, 45, 0.45);
}

.prefill-timeline-chip--entered {
  animation: prefillChipEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.prefill-timeline-chip__icon {
  display: flex;
  height: 1.35rem;
  width: 1.35rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #295B2D;
  color: #fff;
}

.prefill-timeline-chip__icon svg {
  height: 0.7rem;
  width: 0.7rem;
}

.prefill-timeline-chip__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #295B2D;
  letter-spacing: -0.01em;
}

.prefill-timeline-loader__hero-icon {
  display: flex;
  height: 3rem;
  width: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(41, 91, 45, 0.1);
  animation: prefillHeroGlow 2.4s ease-in-out infinite;
  overflow: hidden;
}

.prefill-timeline-loader__hero-emoji {
  display: block;
  font-size: 1.375rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

@media (min-width: 640px) {
  .prefill-timeline-loader__hero-icon {
    height: 3.25rem;
    width: 3.25rem;
  }

  .prefill-timeline-loader__hero-emoji {
    font-size: 1.5rem;
  }
}

.prefill-timeline-loader__hero-icon,
.prefill-timeline-loader__hero-title,
.prefill-timeline-loader__hero-detail {
  max-width: 100%;
}

.prefill-timeline-loader__hero-title {
  line-height: 1.25;
}

.prefill-timeline-loader__hero-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.prefill-hero-entering {
  animation: prefillHeroEnter 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.prefill-hero-exiting {
  animation: prefillHeroExit 0.48s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

.prefill-timeline-dot {
  display: block;
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
  background: rgba(41, 91, 45, 0.18);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.prefill-timeline-dot--active {
  height: 0.625rem;
  width: 0.625rem;
  background: #295B2D;
  box-shadow: 0 0 0 4px rgba(41, 91, 45, 0.12);
}

.prefill-timeline-dot--done {
  background: #7BAE4F;
}

.prefill-timeline-rail-item {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.35rem 0;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease;
}

.prefill-timeline-rail-item[hidden] {
  display: none;
}

.prefill-timeline-rail-item__track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

.prefill-timeline-rail-item__line {
  position: absolute;
  top: -0.35rem;
  bottom: 50%;
  width: 2px;
  transform-origin: top center;
  background: rgba(41, 91, 45, 0.14);
}

.prefill-rail-line--active {
  background: linear-gradient(to bottom, #7BAE4F, rgba(41, 91, 45, 0.14));
}

.prefill-rail-line--draw {
  animation: prefillLineDraw 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.prefill-timeline-rail-item__node {
  position: relative;
  z-index: 1;
  display: flex;
  height: 1.75rem;
  width: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.prefill-rail-node--pending {
  border: 1.5px solid rgba(41, 91, 45, 0.18);
  background: #fff;
}

.prefill-rail-pending-dot {
  display: block;
  height: 0.4rem;
  width: 0.4rem;
  border-radius: 9999px;
  background: rgba(41, 91, 45, 0.22);
}

.prefill-rail-node--active {
  border: 2px solid #295B2D;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(41, 91, 45, 0.1);
}

.prefill-rail-dot {
  display: block;
  height: 0.55rem;
  width: 0.55rem;
  border-radius: 9999px;
  background: #295B2D;
  animation: securePulse 1.8s ease-in-out infinite;
}

.prefill-rail-node--completed {
  border: none;
  background: #295B2D;
}

.prefill-timeline-rail-item__label {
  padding-top: 0.2rem;
  font-size: 0.875rem;
  line-height: 1.35;
  transition: color 0.3s ease, font-weight 0.3s ease;
}

.prefill-rail-label--pending {
  color: rgba(41, 91, 45, 0.38);
  font-weight: 500;
}

.prefill-rail-label--active {
  color: #295B2D;
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Active step title lives in the hero — rail row stays compact */
.prefill-timeline-rail-item[data-state="active"] .prefill-timeline-rail-item__label {
  opacity: 0.55;
  font-weight: 500;
  font-size: 0.8125rem;
}

.prefill-rail-label--completed {
  color: #295B2D;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .prefill-hero-entering,
  .prefill-hero-exiting,
  .prefill-timeline-chip--entered,
  .prefill-rail-line--draw,
  .prefill-timeline-loader__hero-icon,
  .prefill-rail-dot {
    animation: none !important;
  }
}

/* SweetAlert2 — prefill success celebration */
.prefill-success-swal-popup {
  border-radius: 1rem;
  padding: 1.5rem 1.25rem 1.25rem;
}

.prefill-success-swal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.prefill-success-swal-confirm {
  background-color: #0d9488 !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  padding: 0.6rem 1.5rem !important;
}

.prefill-success-swal-confirm:focus {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.35) !important;
}
