/*
 * 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.
 *
 * Note: CSS @import does not work with Propshaft's fingerprinted URLs.
 * All styles are inlined below instead.
 */

/* =============================================
   Sync Status Loader Animation
   ============================================= */

.sync-loader {
  width: 282px; /* Half size to match other images */
  height: 319px;
  background: url("/assets/sync_loader_sprite-f62d7754.png") -0 -0;
  background-size: 1410px 319px; /* Scale sprite to 50%: original 2820x638 → 1410x319 */
  background-repeat: no-repeat;
  animation: sync-frames 1.5s steps(5) infinite;
  margin: 0 auto;
  max-width: 100%;
}

/* Small variant for inline use */
.sync-loader--sm {
  width: 47px;
  height: 53px;
  background-size: 235px 53px; /* Scale down to ~1/6 of original size */
  animation: sync-frames-sm 1.5s steps(5) infinite;
}

/* Responsive sizing */
@media (max-width: 768px) {
  .sync-loader {
    width: 200px;
    height: 226px;
  }
}

@media (max-width: 480px) {
  .sync-loader {
    width: 150px;
    height: 170px;
  }
}

@keyframes sync-frames {
  from { background-position: 0px 0px; }
  to { background-position: -1410px 0px; }
}

@keyframes sync-frames-sm {
  from { background-position: 0px 0px; }
  to { background-position: -235px 0px; }
}

/* Pause animation on hover for accessibility */
.sync-loader:hover {
  animation-play-state: paused;
}

/* Loading state specific styling */
.sync-status--loading .sync-loader {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sync-status--completed .sync-loader,
.sync-status--failed .sync-loader {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* =============================================
   Utility Classes
   ============================================= */

/* Height utility */
.h-100 {
  height: 100%;
}

.status-page {
  min-height: 70vh;
}

/* Full height grid layout - for split-screen layouts */
.full-height-grid {
  min-height: 60vh; /* Minimum 60% of viewport height for better visual balance */
  align-items: stretch; /* Allow columns to stretch */
}

.full-height-grid .fr-col-12:first-child {
  display: flex;
  align-items: center; /* Center only the left column content */
}

.full-height-grid .fr-col-12:first-child > * {
  width: 100%; /* Prevent the flex item from shrinking to its content's intrinsic width */
}

.full-height-grid .fr-background-alt--blue-france {
  display: flex; /* Make right column flex to fill height */
}

/* Utility class for centering content (images, etc.) */
.center-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 2rem;
}

.center-content img {
  max-width: 100%;
  height: auto;
}

/* Field display layout classes */
.field-layout-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 1.5rem;
}

.field-layout-container:last-child {
  margin-bottom: 0;
}

.field-layout-content {
  flex: 1;
  margin-right: 1rem;
}

.field-layout-badge {
  flex-shrink: 0;
}

.stepper__separator {
  border: none;
  border-bottom: 1px solid var(--border-default-grey);
  height: 0;
}

.wizard-nav__default-submit {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.badge--no-background {
  background-color: transparent;
  padding: 0;
}

/* Certificate two-columns layout */
.certificate-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px
}

.certificate-col--left,
.certificate-col--right {
  width: 50%;
  min-width: 0;
}

.certificate-col {
  width: 100%;
}

/* Direct upload progress bar */
.direct-upload-progress {
  width: 100%;
  height: 4px;
  background-color: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}

.direct-upload-progress-bar {
  height: 100%;
  background-color: var(--background-action-high-blue-france, #000091);
  transition: width 0.3s ease;
  width: 0%;
}

/* Visibility utility */
.hidden {
  display: none !important;
}

/* File item with delete button */
.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.file-link {
  flex: 1;
}

.file-delete-wrapper {
  flex-shrink: 0;
}

.file-delete-wrapper .fr-btn {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* API Status Display */
.api-status-summary {
  font-size: 14px;
}

.api-status-count {
  font-weight: bold;
}

.api-status-count--success {
  color: #18753C;
}

.api-status-count--warning {
  color: #B34000;
}

.api-status-segments {
  display: flex;
  gap: 0.5rem;
}

.api-status-segment {
  height: 6px;
  flex: 1;
  border-radius: 2px;
}

.fr-header__operator {
  width: 128px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fr-header__operator .fr-responsive-img {
  width: 128px;
  height: 72px;
  object-fit: contain;
}

/* Renamed documents section */
.renamed-documents-list {
  margin-top: 0.5rem;
}

.renamed-document-item {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.renamed-document-item > span {
  display: inline-block;
  vertical-align: middle;
}

.renamed-document-item .document-icon {
  margin-right: 0.5rem;
}

.renamed-document-item .rename-arrow {
  margin-right: 0.5rem;
}

.renamed-document-item svg {
  display: inline-block;
  vertical-align: middle;
}

.renamed-document-text {
  font-size: 14px;
}

/* Header navigation active state */
.fr-header .fr-btns-group .fr-btn.fr-btn--active {
  background-color: #eee !important;
}

.fr-badge.fr-badge--info-custom {
  background-color: var(--artwork-decorative-yellow-tournesol) !important;
  text-transform: none;
  font-weight: normal;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Field separator */
.fr-fieldset__element--with-separator {
  border-bottom: 1px solid var(--border-default-grey, #ddd);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.field-badge-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* Dropdown menu for action buttons */
.fr-dropdown {
  position: relative;
  display: inline-block;
}

.fr-dropdown__menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1000;
  min-width: 180px;
  background-color: var(--background-default-grey, #fff);
  box-shadow: 0 2px 6px rgba(0, 0, 18, 0.16);
  border: 1px solid var(--border-default-grey, #ddd);
  margin-top: 0.25rem;
}

.fr-dropdown__menu:not(.fr-collapse--expanded) {
  display: none;
}

.fr-dropdown__menu.fr-collapse--expanded {
  display: block;
}

.fr-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.fr-dropdown__link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-action-high-grey, #161616);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.fr-dropdown__link:hover {
  background-color: var(--background-default-grey-hover, #f6f6f6);
}

/* Modal dialog */
.fr-modal-dialog {
  border: none;
  border-radius: 4px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fr-modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.fr-modal-dialog__content {
  padding: 2rem;
}

.fr-modal-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fr-modal-dialog__header .fr-link--close {
  flex-shrink: 0;
}

.fr-modal-dialog--wide {
  max-width: 792px;
}

.fr-modal-dialog--wide .fr-modal-dialog__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 32px 64px;
}

.fr-modal-dialog--wide .fr-modal-dialog__header {
  justify-content: flex-end;
  margin-bottom: 0;
}

/* Drag handle */
[data-drag-handle] {
  cursor: grab;
}

/* Security badges - remove DSFR default icons */
.fr-badge--no-icon::before,
.fr-badge--no-icon::after {
  content: none !important;
  display: none !important;
}

/* Security badge colors and layout */
.fr-badge--security-safe {
  background-color: #B8FEC9 !important;
  color: #18753C !important;
}

.fr-badge--security-unsafe {
  background-color: #FFE9E9 !important;
  color: #CE0500 !important;
}

.fr-badge--security-scanning {
  background-color: #E8EDFF !important;
  color: #0063CB !important;
}

/* Environment banner for non-production */
.environment-banner {
  background-color: var(--yellow-tournesol-975-75, #fef4cd);
}

.environment-banner .fr-notice__body {
  padding: 8px 0;
}

.fr-notice--compact {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.fr-notice--compact .fr-notice__body {
  padding-left: 0.75rem;
}

.fr-notice__title {
  font-weight: 400;
}

.environment-banner__text {
  color: var(--grey-50-1000, #161616);
  text-align: center;
  margin: 0;
  font-weight: 700;
}

/* Lots detail table */
.lots-detail-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border: 1px solid var(--border-default-grey, #dddddd);
}

.lots-detail-table th,
.lots-detail-table td {
  border-bottom: 1px solid var(--border-default-grey, #dddddd);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.lots-detail-table tr:last-child td {
  border-bottom: none;
}

.lots-detail-table th {
  background-color: var(--background-alt-grey, #f6f6f6);
  font-weight: 700;
}


/* Dashboard summary tiles */
.fr-dashboard-tile {
  background-color: var(--grey-1000-50, #fff);
  border: 1px solid var(--grey-925-125, #e5e5e5);
  padding: 1.5rem;
  text-align: center;
  border-bottom-width: 4px;
}

.fr-dashboard-tile--blue {
  border-bottom-color: var(--blue-france-sun-113-625, #000091);
}

.fr-dashboard-tile--green {
  border-bottom-color: var(--success-main-525, #18753c);
}

/* Market scope tags (type badges on each field) */
.fr-card__title--with-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fr-card__title--with-badges .fr-card__title-text {
  flex: 1;
  min-width: 0;
}

.fr-card__title--with-badges .fr-card__title-badges {
  flex-shrink: 0;
  white-space: nowrap;
  padding-left: 1rem;
  font-weight: normal;
}

.market-scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

/* Market type badges */
.market-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  background-color: #F6F6F6;
}

.market-scope-tag {
  font-size: 0.75rem;
}

.market-type-badge img,
.market-type-icon {
  flex-shrink: 0;
}

.fr-tags-group--market-types {
  gap: 8px;
  row-gap: 12px;
}

/* Collapsible list toggle button */
.collapsible-list__toggle {
  background: none;
  border: none;
  border-bottom: 1px solid var(--blue-france-sun-113-625);
  padding: 0.25rem 0;
  cursor: pointer;
  color: var(--blue-france-sun-113-625);
  font-size: 0.875rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  width: auto;
}

.collapsible-list__toggle--inline {
  margin-top: 0;
}

.collapsible-list__toggle-wrapper {
  width: 100%;
  display: flex;
  margin-top: 0.5rem;
  justify-content: center;
}

.collapsible-list__toggle-wrapper--left {
  justify-content: flex-start;
}

.collapsible-rows__toggle-cell {
  padding: 0.5rem 1rem;
  text-align: center;
}

.application-mode-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.application-mode-choice {
  border: 1px solid var(--border-default-grey);
}

.application-mode-choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.application-mode-choice__label {
  display: flex;
  align-items: stretch;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.application-mode-choice__text {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.application-mode-choice__text::before {
  content: "";
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-action-high-blue-france);
  background-color: var(--background-default-grey);
}

.application-mode-choice__input:checked + .application-mode-choice__label .application-mode-choice__text::before {
  border-width: 0.4375rem;
}

.application-mode-choice__text-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.application-mode-choice__title {
  font-weight: 700;
}

.application-mode-choice__input:focus-visible + .application-mode-choice__label {
  outline: 2px solid var(--border-action-high-blue-france);
  outline-offset: -2px;
}

.application-mode-choice__hint {
  color: var(--text-mention-grey);
  font-size: 0.875rem;
}

.application-mode-choice__icon {
  flex-shrink: 0;
  width: 6rem;
  display: flex;
  padding: 1rem;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  border-left: 1px solid var(--border-default-grey);
}

.application-mode-choice__icon-img {
  height: 2.75rem;
  width: auto;
}

.application-mode-choice__input:disabled + .application-mode-choice__label {
  cursor: not-allowed;
  color: var(--text-disabled-grey);
}

.application-mode-choice__input:disabled + .application-mode-choice__label .application-mode-choice__text::before {
  border-color: var(--border-disabled-grey);
}

.application-mode-choice__input:disabled + .application-mode-choice__label .application-mode-choice__icon {
  color: var(--text-disabled-grey);
}

.application-mode-callout {
  background-color: var(--background-alt-blue-france);
  padding: 32px 48px 32px 44px;
  margin-bottom: 2rem;
}

.application-mode-callout .fr-callout__title {
  margin: 0 0 12px;
}

.application-mode-callout .fr-callout__text {
  margin: 0;
}

.grouping-legal-type-stepper {
  display: flex;
  gap: 8px;
}

.grouping-legal-type-stepper__step {
  flex: 1;
  height: 4px;
  background-color: var(--border-default-grey);
}

.grouping-legal-type-stepper__step--done {
  background-color: var(--background-action-high-blue-france);
}

.grouping-legal-type-actions {
  display: flex;
  justify-content: space-between;
}

.grouping-legal-type-actions .fr-btn[aria-disabled="true"] {
  background-color: var(--background-disabled-grey);
  color: var(--text-disabled-grey);
  pointer-events: none;
  cursor: not-allowed;
}

.grouping-member-form {
  background-color: var(--background-alt-blue-france);
  border-left: 4px solid var(--border-plain-blue-france);
  padding: 32px 40px;
}

#grouping_members_table .fr-table,
#grouping_members_table .fr-table__wrapper,
#grouping_members_table .fr-table__container,
#grouping_members_table .fr-table__content {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  border: none !important;
}

#grouping_members_table table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border: 1px solid var(--light-decisions-border-border-default-grey, #ddd) !important;
}

#grouping_members_table th,
#grouping_members_table td {
  border: none !important;
  background-image: none !important;
  border-bottom: 1px solid var(--light-decisions-border-border-default-grey, #ddd) !important;
}

#grouping_members_table thead,
#grouping_members_table tbody,
#grouping_members_table tbody::after,
#grouping_members_table thead::after {
  background-image: none !important;
}

#grouping_members_table tbody tr {
  background-color: var(--background-default-grey, #fff) !important;
}

/* =============================================
   Lot Selection Mode
   ============================================= */

.lot-selection-rc-notice {
  display: flex;
  align-items: stretch;
  background-color: var(--background-alt-blue-france, #f5f5fe);
}

.lot-selection-rc-notice__icon {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding: 1rem 0.5rem;
  background-color: var(--background-flat-info, #0063cb);
  color: var(--text-inverted-grey, #fff);
}

.lot-selection-rc-notice__content {
  padding: 1rem;
}

.lot-selection-rc-notice__title {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.75rem;
  margin: 0 0 0.25rem;
  color: var(--text-title-grey, #161616);
}

.lot-selection-rc-notice__text {
  margin: 0;
  font-size: 1rem;
  color: var(--text-default-grey, #3a3a3a);
}

.lot-selection-mode-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-default-grey, #3a3a3a);
}

.lot-selection-mode-bulk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.lot-selection-mode-bulk__select {
  appearance: none;
  background-color: var(--background-default-grey, #fff);
  border: 1px solid var(--border-default-grey, #ddd);
  color: var(--text-action-high-blue-france, #000091);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 1.75rem 0.25rem 0.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23000091'%3E%3Cpath d='M12 15.5l-6-6 1.4-1.4L12 12.7l4.6-4.6L18 9.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.lot-mode-choices {
  display: inline-flex;
  border: 1px solid var(--border-default-grey);
  border-radius: 0.25rem;
}

.lot-mode-choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.lot-mode-choice__label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: -1px;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5rem;
  white-space: nowrap;
  color: var(--text-action-high-grey);
}

.lot-mode-choice__input:checked + .lot-mode-choice__label {
  border-color: var(--border-action-high-blue-france, #000091);
  color: var(--text-action-high-blue-france, #000091);
}

.lot-mode-choice__input:focus-visible + .lot-mode-choice__label {
  outline: 2px solid var(--border-action-high-blue-france);
  outline-offset: -2px;
}

.lot-selection-mode-section__header {
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lot-selection-mode-group__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lot-selection-mode-group__title-text {
  margin: 0;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 2rem;
  color: var(--text-title-grey, #000);
}

.lot-selection-mode-group__badge .market-type-badge {
  border-radius: 1rem;
  padding: 0.375rem 0.75rem;
  align-items: center;
}

.lot-selection-mode-group__badge .market-type-badge img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.lot-selection-mode-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--background-default-grey, #fff);
  border: 1px solid var(--border-default-grey, #ddd);
}

.lot-selection-mode-table th,
.lot-selection-mode-table td {
  border-bottom: 1px solid var(--border-default-grey, #ddd);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  vertical-align: middle;
}

.lot-selection-mode-table th {
  font-weight: 700;
  color: var(--text-default-grey, #3a3a3a);
  background-color: var(--background-alt-grey, #f6f6f6);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.lot-selection-mode-table td:last-child {
  text-align: right;
}

/* =============================================
   Buyer lot config components
   ============================================= */

.buyer-market-info-sidebar {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buyer-market-info-sidebar__row {
  display: flex;
  gap: 8px;
}

.buyer-market-info-sidebar__term,
.buyer-market-info-sidebar__description {
  margin: 0;
  line-height: 1.5;
}

.buyer-lot-config-sidebar-card {
  padding: 20px;
}

.buyer-lot-config-sidebar-card__title {
  margin-bottom: 0.5rem;
}

.buyer-lot-config-sidebar-card__separator {
  border: none;
  border-top: 1px solid var(--border-default-grey);
  margin: 0;
}

.buyer-lot-config-how-it-works-list {
  margin: 0;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buyer-lot-config-lot-limit-input {
  width: 250px;
}

.buyer-lot-config-submit-button {
  width: 100%;
  justify-content: center;
}

.buyer-lot-type-picker__checkbox {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--blue-france-sun-113-625);
  flex-shrink: 0;
}

.buyer-lot-type-badge--struck-through {
  text-decoration: line-through;
}

.buyer-lot-type-picker-panel {
  display: none;
  border: 1px solid var(--border-default-grey);
  padding: 2.5rem;
  margin-top: 2rem;
  background-color: #F5F5FE;
}

.buyer-lot-type-picker-panel__options {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.buyer-lot-type-picker-panel__option {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-default-grey);
  overflow: hidden;
  flex: 1;
  min-width: 160px;
}

.buyer-lot-type-picker-panel__option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 12px 16px;
  cursor: pointer;
  background-color: #ffffff;
  flex: 1;
}

.buyer-lot-type-picker-panel__option-radio {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--blue-france-sun-113-625);
  flex-shrink: 0;
}

.buyer-lot-type-picker-panel__option-label-text {
  white-space: nowrap;
}

.buyer-lot-type-picker-panel__option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  padding: 16px;
}

.buyer-lot-type-picker-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.buyer-lot-type-picker-panel__cancel-button {
  background-color: #ffffff;
}

.confirmation-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
