/*
 * UAE section type `form-calculator` (S4, 2026-11-07): live `.section_form-calculator`, the
 * trading calculator on /trading-calculators and its margin, pip and swap pages. DS
 * TradingCalculator (results in AED via `displayCurrency`, shared c7f826e7). Linked on UAE
 * pages only (JURISDICTION_SETTINGS.ae.stylesheets); every rule is scoped to the slot.
 *
 * Live (measured 2026-11-07, all four pages, EN + AR, 1440/1024/768/390; probe
 * tmp/s4-scratch/form-probe.cjs, used fonts tmp/s4-scratch/measure.cjs):
 * - band padding 112 (>=992) / 80 (768-991) / 56 (phones); 1328px container, 24px sides
 *   (16px on phones).
 * - card: rgb(246,247,248), radius 24, padding 32/40 (32/20 on phones); from 992 two equal
 *   columns 64px apart, each vertically centred; below 992 one column, 15px between the form
 *   and the results (Webflow's w-form margin).
 * - "Calculator" / "Results": 32/40 800 (24/32 below 992; Results keeps a 40px line).
 * - fields: 56px boxes, white, 1px rgba(0,0,0,.08), radius 8; the label is a 16/24 placeholder
 *   in rgba(0,0,0,.6), 12px from the start edge, centred; it moves to the top (12px) once the
 *   field has a value or focus. 32px under the heading, 16px between fields.
 * - info rows ("Contract size = -"): 12/16 (10/16 on phones) rgba(0,0,0,.48), value 700, 20px
 *   in from both edges, 5px under the field, 5px apart, pip/point at the end edge.
 * - buttons: 54px, radius 96, 16/24 800, side by side 16px apart (8px on phones); Calculate
 *   coral, Reset 1px black outline.
 * - results: white panel, radius 24, padding 24 (16 on phones); boxes 70px, padding 8/16, 1px
 *   rgba(0,0,0,.08), radius 8, transparent; label 12/24 rgb(24,28,37); value 16/20 700
 *   (19.2px on phones); 20px under the heading, 16px apart; below 992 every box full width.
 *   Swap info rows 12/24.
 * - Arabic: same boxes mirrored; used fonts Noto Sans Arabic (frame.css), as live.
 */
[data-raven-slot$=":form-calculator"] .tcalc-section {
  background: transparent;
}
[data-raven-slot$=":form-calculator"] .tcalc-container {
  max-width: 1328px;
  padding: 56px 16px;
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-container {
    padding: 80px 24px;
  }
}
@media (min-width: 992px) {
  [data-raven-slot$=":form-calculator"] .tcalc-container {
    padding: 112px 24px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-card {
  background: rgb(246, 247, 248);
  border-radius: 24px;
  padding: 32px 20px;
  gap: 15px;
  align-items: stretch;
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-card {
    padding: 32px 40px;
  }
}
/* From 992 live centres the form column against the row and keeps the results panel at the
   top (hub: results taller, form centred; margin/pip/swap: both start at the top). */
@media (min-width: 992px) {
  [data-raven-slot$=":form-calculator"] .tcalc-card {
    gap: 64px;
    align-items: start;
  }
  [data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) {
    align-self: center;
  }
}

/* Left column */
[data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) {
  gap: 16px;
}
[data-raven-slot$=":form-calculator"] .tcalc-panelTitle {
  font-size: 24px;
  line-height: 32px;
  font-weight: 800;
  color: rgb(24, 28, 37);
}
[data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) > .tcalc-panelTitle {
  margin-bottom: 16px;
}
@media (min-width: 992px) {
  [data-raven-slot$=":form-calculator"] .tcalc-panelTitle {
    font-size: 32px;
    line-height: 40px;
  }
}

/* Fields: live's floating-label inputs */
[data-raven-slot$=":form-calculator"] :is(.sf-wrapper, .tf-wrapper) {
  position: relative;
  box-sizing: border-box;
  height: 56px;
  min-height: 56px;
  padding: 0 11.2px;
  gap: 0;
  justify-content: flex-end;
  isolation: isolate;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: none;
  /* The wrapper carries a global `.outline` utility class (a dark 1px outline); live has none. */
  outline: none;
}
/* Live paints the white field on the input, a layer beside the label (the label itself sits on
   the grey card); a pseudo layer does the same here, so the label's backdrop matches live's. */
[data-raven-slot$=":form-calculator"] :is(.sf-wrapper, .tf-wrapper)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 7px;
  background: rgb(255, 255, 255);
  pointer-events: none;
}
[data-raven-slot$=":form-calculator"] :is(.sf-label, .tf-label) {
  position: absolute;
  inset-inline-start: 12px;
  top: 15px;
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease;
}
/* Live's label moves up only once the field has a value (not on focus). */
[data-raven-slot$=":form-calculator"] :is(.sf-wrapper, .tf-wrapper):has(input:not([value=""])) :is(.sf-label, .tf-label) {
  top: 7px;
  font-size: 12px;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.72);
}
/* Live draws the required mark with ::after (#C40000, 3px after the label), so it is not
   part of the label's text. */
[data-raven-slot$=":form-calculator"] .tcalc-required {
  display: none;
}
[data-raven-slot$=":form-calculator"] :is(.sf-label, .tf-label)::after {
  content: "*";
  /* The DS keeps a space before its (hidden) mark; with it this lands ~3px after the label. */
  margin-inline-start: -1px;
  color: rgb(196, 0, 0);
}
[data-raven-slot$=":form-calculator"] :is(.sf-row, .tf-row) {
  padding-bottom: 7px;
}
[data-raven-slot$=":form-calculator"] :is(.sf-input, .tf-input) {
  font-size: 16px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.72);
}
/* Live's inputs carry their field name as placeholder too ("Symbols", "Volume in Lots",
   "Asset price"; Stage A B2-005); the floating label already shows it, so it stays unseen. */
[data-raven-slot$=":form-calculator"] :is(.sf-input, .tf-input)::placeholder {
  color: transparent;
}
[data-raven-slot$=":form-calculator"] .tcalc-field {
  gap: 4px;
}

/* Info rows under the symbol field */
[data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) > .tcalc-infoGrid {
  margin-top: -11px;
  padding: 0 20px;
  gap: 5px 16px;
}
[data-raven-slot$=":form-calculator"] .tcalc-infoRow {
  font-size: 10px;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.48);
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-infoRow {
    font-size: 12px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-infoLabel {
  color: rgba(0, 0, 0, 0.48);
}
[data-raven-slot$=":form-calculator"] .tcalc-infoValue {
  color: rgba(0, 0, 0, 0.48);
  font-weight: 700;
}
[data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) > .tcalc-infoGrid .tcalc-infoRow:nth-child(even) {
  text-align: end;
}

/* Buttons: side by side at every width, as live */
[data-raven-slot$=":form-calculator"] .tcalc-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
  width: 100% !important;
  font-size: 16px;
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-actions {
    gap: 16px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-actions > button {
  width: 100% !important;
  height: 54px;
  margin: 0 !important;
  border-radius: 96px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 800;
}
[data-raven-slot$=":form-calculator"] .tcalc-actions > button:first-child {
  border: 1px solid rgb(0, 0, 0);
  color: rgb(0, 0, 0);
}

/* Results */
[data-raven-slot$=":form-calculator"] .tcalc-column--results {
  background: rgb(255, 255, 255);
  border-radius: 24px;
  padding: 16px;
  gap: 16px;
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-column--results {
    padding: 24px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-column--results > .tcalc-panelTitle {
  line-height: 40px;
  margin-bottom: 4px;
}
[data-raven-slot$=":form-calculator"] .tcalc-resultRow {
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 992px) {
  [data-raven-slot$=":form-calculator"] .tcalc-resultRow {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-resultBox {
  box-sizing: border-box;
  min-height: 70px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: none;
}
[data-raven-slot$=":form-calculator"] .tcalc-resultLabel {
  margin: 0;
  font-size: 12px;
  line-height: 24px;
  color: rgb(24, 28, 37);
}
[data-raven-slot$=":form-calculator"] .tcalc-resultValue {
  font-size: 19.2px;
  line-height: 20px;
  font-weight: 700;
  color: rgb(24, 28, 37);
}
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-resultValue {
    font-size: 16px;
  }
}
[data-raven-slot$=":form-calculator"] .tcalc-column--results .tcalc-infoGrid {
  gap: 0 8px;
}
[data-raven-slot$=":form-calculator"] .tcalc-column--results .tcalc-infoRow {
  line-height: 24px;
  font-size: 10px;
}
/* Swap rate / type rows: 10px on phones, 12px from 768 (checker s4 minor 6). */
@media (min-width: 768px) {
  [data-raven-slot$=":form-calculator"] .tcalc-column--results .tcalc-infoRow {
    font-size: 12px;
  }
}
/* Swap type / three-day / weekend rows: one 24px line each, 20px under the rate rows. */
[data-raven-slot$=":form-calculator"] .tcalc-column--results > .tcalc-infoRow {
  margin: -16px 0 0;
}
[data-raven-slot$=":form-calculator"] .tcalc-column--results > :is(.tcalc-resultRow, .tcalc-calcError) + .tcalc-infoRow {
  margin-top: 4px;
}
/* Live's columns are Webflow forms: 15px margin under each, and 40px of empty form chrome
   under the buttons (both count when live centres the columns). */
[data-raven-slot$=":form-calculator"] .tcalc-column {
  margin-bottom: 15px;
}
[data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) {
  padding-bottom: 40px;
}
@media (max-width: 991px) {
  [data-raven-slot$=":form-calculator"] .tcalc-column:not(.tcalc-column--results) {
    margin-bottom: 0;
  }
}
/* Each swap rate sits under its own box (DS aeLiveMarkup), 16px below it. */
[data-raven-slot$=":form-calculator"] .tcalc-resultStack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Arabic: live sets the field labels, info rows and buttons in "Inter, Arial", so their
   Arabic draws in Arial (used-font report, 2026-11-07); headings and result boxes stay
   Noto Sans Arabic. */
[dir="rtl"] [data-raven-slot$=":form-calculator"] :is(.sf-label, .tf-label, .sf-input, .tf-input, .tcalc-infoRow, .tcalc-actions > button) {
  --font-family-base: Inter, Arial, sans-serif;
  font-family: Inter, Arial, sans-serif;
}
/* Margin and pip panels (no swap rows): live keeps 16px more under the last box
   (194px panel at 1024 vs 178). */
[data-raven-slot$=":form-calculator"] .tcalc-column--results:not(:has(.tcalc-infoRow)) {
  padding-bottom: 40px;
}
@media (max-width: 767px) {
  [data-raven-slot$=":form-calculator"] .tcalc-column--results:not(:has(.tcalc-infoRow)) {
    padding-bottom: 32px;
  }
}
/* Live's DOM has Reset before Calculate (DS aeLiveMarkup does the same); live's grid still
   shows Calculate first (start side), Reset second. */
[data-raven-slot$=":form-calculator"] .tcalc-actions > button:first-child {
  order: 2;
}
