/* ============================================================
   EXCHANGE PAGE  /exchange-*/
/* ============================================================ */

/* ── Page wrapper ─────────────────────────────────────────── */
.exchange-page {
  background: #fff;
  min-height: calc(100vh - 126px);
  padding: 40px 0 80px;
}

.exchange-page .container {
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 100px;
}

/* ── Progress bar ─────────────────────────────────────────── */
.exch-stepbar {
  display: flex;
  gap: 8px;
  height: 6px;
  margin-bottom: 59px;
}

.exch-stepbar__item {
  flex: 1;
  height: 100%;
  border-radius: 999px;
  background: #f6f7fb;
}

.exch-stepbar__item--active {
  background: #caff43;
}

/* ── Intro heading ────────────────────────────────────────── */
.exch-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 56px;
}

.exch-intro__title {
  font-size: 82px;
  font-weight: 600;
  line-height: 1.024;
  letter-spacing: -3.28px;
  color: #090c20;
  margin: 0;
  font-family: var(--font-family);
}

.exch-intro__desc {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: #050816;
  max-width: 622px;
  margin: 0;
}

/* ── Reset plugin container chrome ───────────────────────── */
.exchange-page .ajax_post_bids,
.exchange-page .exch_ajax_wrap,
.exchange-page .xchange_div,
.exchange-page .xchange_div_ins {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* ── Hide plugin notice banner (Регламент...) ─────────────── */
.exchange-page .notice_message { display: none !important; }

/* ── Two-column flex layout on the wrap ──────────────────── */
.exchange-page .exch_ajax_wrap {
  display: flex !important;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

.exchange-page .exch_ajax_wrap_abs {
  position: absolute !important;
  pointer-events: none;
}

.exchange-page #exch_html {
  flex: 1 1 0;
  min-width: 0;
}

.exchange-page .xchange_div,
.exchange-page .xchange_div_ins {
  height: 100%;
  width: 100% !important;
}

/* ── Left card ────────────────────────────────────────────── */
.exch-left-card {
  background: #f6f7fb;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 552px;
}

/* Give + Get side by side */
.exch-left-card .xchange_div_cols {
  display: flex !important;
  gap: 32px;
  background: none !important;
  padding: 0 !important;
  border: none !important;
  margin: 0 !important;
}

.exch-left-card .xchange_div_col_give,
.exch-left-card .xchange_div_col_get {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Column title */
.exch-left-card .xchange_data_title,
.exch-left-card .xchange_data_title_ins {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.exch-left-card .xchange_data_title_ins span {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #090c20;
}

/* Reset plugin data wrappers */
.exchange-page .xchange_data_div,
.exchange-page .xchange_data_ins {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

/* ── Currency picker container (built in PHP template) ────── */
.exch-picker {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  height: 56px;
  padding: 0 16px 0 24px;
  gap: 8px;
  width: 100%;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

/* Amount input side */
.exch-picker .xd-amount {
  flex: 1 1 0;
  min-width: 0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.exch-picker .xd-amount .xchange_sum_line {
  display: flex;
  align-items: center;
  height: 100%;
}

.exch-picker .xd-amount .xchange_sum_label {
  display: none;
}

.exch-picker .xd-amount .clear { display: none !important; }

.exch-picker .xd-amount input[type="text"] {
  font-size: 24px !important;
  font-weight: 500 !important;
  color: #050816 !important;
  background: none !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  letter-spacing: -0.24px;
  box-shadow: none !important;
}

/* Currency select side */
.exch-picker .xd-select {
  flex-shrink: 0;
  position: relative;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.exch-picker .xd-select .xchange_select {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

/* native select hidden — replaced by .ep-trigger */
.exch-picker .xd-select select.js_my_sel {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ── Rate line (below get picker) ────────────────────────── */
.exch-rate-line {
  font-size: 13px;
  font-weight: 500;
  color: #667085;
  line-height: 18px;
  padding: 2px 4px;
  margin-top: 14px;
  background: none !important;
  border: none !important;
}

.exch-rate-line .xchange_info_line {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px;
  font-weight: 500;
  color: #667085;
  display: flex;
  justify-content: space-between;
}

.exch-rate-line .js_course_html {
  font-weight: 600;
  color: #050816;
}

/* ── Reserve / availability line (below give picker) ─────── */
.exch-reserve-line {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 500;
  color: #667085;
  line-height: 18px;
  padding: 2px 4px;
  background: none !important;
  border: none !important;
  display: flex;
  justify-content: space-between;
}

.exch-reserve-line__label {
  color: #667085;
}

.exch-reserve-line .js_reserve_html {
  color: #050816;
  font-weight: 600;
}

/* ── Commission (shown by plugin when active) ────────────── */
.exchange-page .exch-com-wrap {
  font-size: 13px;
  color: #667085;
  padding: 4px 8px;
}

.exchange-page .exch-com-wrap .xchange_sum_line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exchange-page .exch-com-wrap .xchange_sum_label {
  font-size: 13px;
  color: #667085;
  white-space: nowrap;
}

/* ── Custom currency trigger ──────────────────────────────── */
.ep-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f7fb;
  border: none;
  border-radius: 20px;
  padding: 8px 12px 8px 8px;
  cursor: pointer;
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: #050816;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}

.ep-trigger:hover { background: #edeef4; }

.ep-trigger__ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ep-trigger__chev {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.ep-trigger .ep-trigger__chev {
   transform: rotate(-90deg); 
}

.ep-trigger.open .ep-trigger__chev { transform: rotate(0deg); }

/* ── Dropdown panel ───────────────────────────────────────── */
.ep-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(5, 8, 22, 0.12), 0 2px 8px rgba(5, 8, 22, 0.06);
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.ep-panel.ep-panel--open { display: flex; }

/* ── Search ───────────────────────────────────────────────── */
.ep-search {
  width: 100%;
  height: 52px;
  border: 1px solid #f1f4f8;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #050816;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  font-family: var(--font-family, 'Inter', sans-serif);
}

.ep-search::placeholder { color: #a0aab8; font-weight: 500; }
.ep-search:focus { border-color: #caff43; }

/* ── Category tabs ────────────────────────────────────────── */
.ep-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ep-tab {
  background: #f6f7fb;
  border: none;
  border-radius: 99px;
  padding: 8px 12px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #050816;
  cursor: pointer;
  line-height: 18px;
  font-family: var(--font-family, 'Inter', sans-serif);
  white-space: nowrap;
  transition: background 0.15s;
}

.ep-tab--active { background: #caff43; }

/* ── Scrollable list ──────────────────────────────────────── */
.ep-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.ep-list::-webkit-scrollbar { width: 4px; }
.ep-list::-webkit-scrollbar-track { background: transparent; }
.ep-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

/* ── Category group ───────────────────────────────────────── */
.ep-group + .ep-group { margin-top: 4px; }

.ep-group__title {
  position: sticky;
  top: 0;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: #050816;
  padding: 8px 8px 4px;
  z-index: 1;
  line-height: 20px;
}

/* ── Currency items ───────────────────────────────────────── */
.ep-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  box-sizing: border-box;
}

.ep-item:hover,
.ep-item--active { background: #f6f7fb; }

.ep-item--empty {
  color: #667085;
  font-size: 14px;
  cursor: default;
  justify-content: center;
  height: 44px;
}

.ep-item__ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ep-item__code {
  font-size: 16px;
  font-weight: 600;
  color: #050816;
  white-space: nowrap;
  flex-shrink: 0;
}

.ep-item__name {
  font-size: 16px;
  font-weight: 400;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Right panel (injected by JS) ─────────────────────────── */
.exch-right-panel {
  width: 504px;
  flex-shrink: 0;
  background: #050816;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

.exch-right__top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exch-right__label {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
  margin: 0;
}

.exch-right__amount {
  font-size: 36px;
  font-weight: 600;
  line-height: 44px;
  letter-spacing: -0.72px;
  color: #caff43;
  font-family: 'Inter Tight', var(--font-family);
  word-break: break-all;
}

.exch-right__info-box {
  background: #0d1021;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exch-right__info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
  flex-wrap: wrap;
}

.exch-right__info-label {
  color: rgba(255, 255, 255, 0.5);
}

.exch-right__info-val {
  color: #fff;
}

.exch-right__info-val.accent {
  color: #caff43;
}

.exch-right__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0;
}

/* ── Right panel bottom (captcha + submit + disclaimer) ───── */
.exch-right__bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Captcha */
.exch-right-panel .captcha_div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  border: none !important;
}

.exch-right-panel .captcha_title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  padding: 0;
}

.exch-right-panel .captcha_body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exch-right-panel .captcha_divimg img {
  border-radius: 4px;
  height: 36px;
  width: auto;
}

.exch-right-panel .captcha_sym,
.exch-right-panel .captcha_body > .captcha_divznak {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-weight: 500;
}

.exch-right-panel .captcha_divpole {
  width: 72px !important;
  height: 40px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  color: #fff !important;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  outline: none;
}

.exch-right-panel .captcha_reload {
  opacity: 0.5;
  font-size: 12px;
  color: #fff;
  text-decoration: none;
}

.exch-right-panel .captcha_reload:hover {
  opacity: 1;
}

/* Submit button */
.exch-right-panel .xchange_submit_div {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.exch-right-panel .xchange_submit {
  width: 100% !important;
  height: 56px !important;
  background: #fff !important;
  color: #050816 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: opacity 0.2s;
  display: block !important;
  box-shadow: none !important;
}

.exch-right-panel .xchange_submit:hover {
  opacity: 0.9;
}

/* Result / status message */
.exch-right-panel .ajax_post_bids_res {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.exch-right-panel .ajax_post_bids_res .resulttrue {
  color: #caff43;
}

.exch-right-panel .ajax_post_bids_res .resultfalse {
  color: #ff6b6b;
}

/* Checkbox / disclaimer */
.exch-right-panel .xchange_checkdata_div {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  line-height: 16px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.exch-right-panel .xchange_checkdata_div label {
  color: rgba(255, 255, 255, 1);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  flex-wrap: wrap;
}

.exch-right-panel .xchange_checkdata_div input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #caff43;
}

/* ── Hide plugin elements we don't need ──────────────────── */
.exchange-page .xchange_data_ins > .clear { display: none !important; }
.exchange-page .exch-picker .req { display: none !important; }

/* ── Error styling ────────────────────────────────────────── */
.exchange-page .js_wrap_error.error {
  position: relative;
}
.exchange-page .js_error {
  font-size: 12px;
  color: #ff4444;
  position: absolute;
  bottom: -7px;
  right: 14px;
  background: #fff;
  display: none;
  padding: 0 5px;
}
.exchange-page .js_wrap_error.error .js_error{
display: block;
}
/* Amount picker: red underline when input has a validation error */
.exch-picker.has-error,
.exch-picker:has(.js_wrap_error.error) {
  border-bottom: 2px solid #ff4444;
  border-radius: 8px 8px 0 0;
}

/* ── Form fields 2-column grid ───────────────────────────── */
.exch-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  width: 100%;
}

/* ── Fields from [give_field] / [get_field] (xchange_curs_line) ── */
.exch-fields-grid .xchange_curs_line {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.exch-fields-grid .xchange_curs_line_ins {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.exch-fields-grid .xchange_curs_label {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}

.exch-fields-grid .xchange_curs_label label {
  font-size: 16px;
  font-weight: 600;
  color: #090c20;
  line-height: 20px;
  display: block;
}

.exch-fields-grid .xchange_curs_label .req { display: none; }
.exch-fields-grid .xchange_label::after { content: ''; }

.exch-fields-grid .xchange_curs_input {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
}

.exch-fields-grid .xchange_curs_input input[type="text"],
.exch-fields-grid .xchange_curs_input input[type="email"],
.exch-fields-grid .xchange_curs_input input[type="tel"] {
  width: 100% !important;
  height: 56px !important;
  background: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 16px 0 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #050816 !important;
  outline: none !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  font-family: var(--font-family, 'Inter', sans-serif) !important;
}

.exch-fields-grid .xchange_curs_input input:focus {
  box-shadow: 0 0 0 2px #caff43 !important;
}

.exch-fields-grid .js_wrap_error.error input {
  box-shadow: none !important;
}

/* ── Personal data block from [direction_field] (xchange_pers) ── */
/* Transparent wrappers — pers_line elements flow directly into the main grid */
.exch-fields-grid .xchange_pers,
.exch-fields-grid .xchange_pers_ins,
.exch-fields-grid .xchange_pers_div,
.exch-fields-grid .xchange_pers_div_ins {
  display: contents;
}

.exch-fields-grid .xchange_pers_title { display: none !important; }

.exch-fields-grid .xchange_pers_line {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.exch-fields-grid .xchange_pers_line_ins {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.exch-fields-grid .xchange_pers_label,
.exch-fields-grid .xchange_pers_label_ins {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}

.exch-fields-grid .xchange_pers_label label {
  font-size: 16px;
  font-weight: 600;
  color: #090c20;
  line-height: 20px;
  display: block;
}

.exch-fields-grid .xchange_pers_label .req { display: none; }
.exch-fields-grid .xchange_label::after { content: ''; }

.exch-fields-grid .xchange_pers_input {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
}

.exch-fields-grid .xchange_pers_input input[type="text"],
.exch-fields-grid .xchange_pers_input input[type="email"],
.exch-fields-grid .xchange_pers_input input[type="tel"] {
  width: 100% !important;
  height: 56px !important;
  background: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 16px 0 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #050816 !important;
  outline: none !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  font-family: var(--font-family, 'Inter', sans-serif) !important;
}

.exch-fields-grid .xchange_pers_input input:focus {
  box-shadow: 0 0 0 2px #caff43 !important;
}

.exch-fields-grid .xchange_pers_input .js_wrap_error.error input {
  box-shadow: none !important;
}

/* ── Warning wrap (from [filters]) ──────────────────────────*/
.exch-warning-wrap {
  /* Contains the plugin's .warning_message; JS transforms it to .exch-warning */
}

/* ── Important / warning block (built by JS) ─────────────── */
.exch-warning {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.exch-warning__header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #090c20;
  line-height: 24px;
}

.exch-warning__body {
  background: #f6f7fb;
  border-radius: 8px;
  padding: 24px;
}

.exch-warning__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exch-warning__title {
  font-size: 16px;
  font-weight: 600;
  color: #050816;
  line-height: 24px;
}

.exch-warning__text {
  font-size: 16px;
  font-weight: 400;
  color: #667085;
  line-height: 20px;
}

/* hide the original plugin warning block */
.exchange-page .warning_message,
.exchange-page .warning_message.exch-warning-hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .exchange-page .container { padding: 0 40px; }
  .exch-intro__title { font-size: 56px; letter-spacing: -2px; }
  .exch-right-panel { width: 380px; }
}

@media (max-width: 900px) {
  .exchange-page .container { padding: 0 20px; }

  .exchange-page .exch_ajax_wrap {
    flex-direction: column !important;
  }

  .exch-right-panel {
    width: 100%;
    min-height: auto;
  }

  .exch-intro__title { font-size: 40px; letter-spacing: -1.5px; }

  .exch-left-card .xchange_div_cols {
    flex-direction: column;
  }

  .ep-trigger { font-size: 13px; padding: 6px 10px 6px 6px; }

  .exch-fields-grid {
    grid-template-columns: 1fr;
  }

  .exch-fields-grid .xchange_pers_div_ins {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .exchange-page { padding: 24px 0 40px; }
  .exchange-page .container { padding: 0 16px; }
  .exch-stepbar { margin-bottom: 32px; }
  .exch-intro { margin-bottom: 32px; }
  .exch-intro__title { font-size: 32px; letter-spacing: -1px; }
  .exch-intro__desc { font-size: 16px; }
  .exch-left-card { padding: 20px; border-radius: 16px; }
  .exch-right-panel { padding: 20px; border-radius: 16px; }
  .exch-right__amount { font-size: 28px; }
  .exch-picker { padding: 0 12px 0 16px; }
  .exch-picker .xd-amount input[type="text"] { font-size: 20px !important; }
}

