/* AQUILA_FINANCE_F12C_R1_8_INLINE_FORM */

/*
 * Register is hidden only while the full Landed Cost create form is active.
 */
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-register-hidden="1"] {
  display: none !important;
}

/*
 * Dedicated full-form host.
 */
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"] {
  width: 100%;
  min-width: 0;
  margin: 14px 0 0;
}

[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"][hidden] {
  display: none !important;
}

/*
 * Convert the existing R1.4 create popup into normal page flow.
 *
 * Its original API/event handlers remain attached because the same DOM node
 * is moved rather than rebuilt.
 */
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
[data-aquila-landed-cost-modal][data-f12c-r18-inline-create="1"] {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;

  display: block !important;

  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;

  margin: 0 !important;
  padding: 0 !important;

  overflow: visible !important;

  background: transparent !important;

  box-shadow: none !important;
  backdrop-filter: none !important;
}

[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
[data-f12c-r18-inline-dialog="1"] {
  position: static !important;
  inset: auto !important;

  display: block !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  max-height: none !important;

  margin: 0 !important;

  overflow: visible !important;

  border: 1px solid #dce4ec !important;
  border-radius: 12px !important;

  background: #ffffff !important;

  box-shadow: none !important;
}

/*
 * Any backdrop element that came with the old popup has no purpose inside
 * the dedicated Accounting page.
 */
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
.f12c-backdrop,
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
[class*="backdrop"] {
  position: static !important;

  background: transparent !important;
  backdrop-filter: none !important;
}

/*
 * Allow form fields to use the full dedicated workspace width naturally.
 */
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
form {
  width: 100%;
  max-width: none;
}

[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
input,
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
select,
[data-aquila-landed-cost-page="1"]
[data-f12c-r18-inline-form-host="1"]
textarea {
  max-width: 100%;
}

/*
 * Desktop / laptop:
 * keep the form spacious but visually contained.
 */
@media (min-width: 1280px) {
  [data-aquila-landed-cost-page="1"]
  [data-f12c-r18-inline-form-host="1"] {
    padding-bottom: 12px;
  }
}

/*
 * Tablet.
 */
@media (max-width: 768px) {
  [data-aquila-landed-cost-page="1"]
  [data-f12c-r18-inline-form-host="1"]
  [data-f12c-r18-inline-dialog="1"] {
    border-radius: 10px !important;
  }
}

/*
 * Mobile.
 */
@media (max-width: 430px) {
  [data-aquila-landed-cost-page="1"]
  [data-f12c-r18-inline-form-host="1"] {
    margin-top: 10px;
  }

  [data-aquila-landed-cost-page="1"]
  [data-f12c-r18-inline-form-host="1"]
  [data-f12c-r18-inline-dialog="1"] {
    border-radius: 9px !important;
  }
}
