/* ==========================================================================
   AXIONMESK — Conversor BRL ⇄ USDT (visual)
   ========================================================================== */

.conv-page {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.conv-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .05);
  color: #A9B1BD;
  text-decoration: none;
  flex: 0 0 auto;
}

.conv-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px 40px;
}

/* --------------------------------------------------------------- cabeçalho */
.conv-head {
  margin: 4px 0 16px;
}

.conv-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #F5F7FA;
  margin: 0 0 4px;
}

.conv-head p {
  font-size: 13.5px;
  color: #8996AA;
  margin: 0;
}

/* ----------------------------------------------------------------- cotação */
.conv-rate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px;
  color: #A9B1BD;
}

.conv-rate.is-ok { border-color: rgba(56,107,255, .22); background: rgba(56,107,255, .06); }
.conv-rate.is-err { border-color: rgba(246, 70, 93, .28); background: rgba(246, 70, 93, .06); }

.conv-rate b { color: #386BFF; font-weight: 800; }

.conv-rate__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #386BFF;
  flex: 0 0 7px;
  animation: convPulse 1.8s ease-in-out infinite;
}

@keyframes convPulse {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* -------------------------------------------------------------------- card */
.conv-card {
  background: #14181E;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 20px;
  padding: 16px;
  position: relative;
}

/* -------------------------------------------------------------- linha/par */
.conv-row { padding: 4px 0; }

.conv-row__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8996AA;
}

.conv-balance {
  font-size: 11.5px;
  font-weight: 600;
  color: #8996AA;
  white-space: nowrap;
}

.conv-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #191D24;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  padding: 0 12px;
  height: 62px;
  transition: border-color .15s ease, background .15s ease;
}

.conv-input:focus-within {
  border-color: #386BFF;
  background: rgba(56,107,255, .04);
}

.conv-input input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: transparent !important;
  color: #F5F7FA !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
  outline: none !important;
  padding: 0 !important;
  font-variant-numeric: tabular-nums;
}

.conv-input input::placeholder { color: #3E4753; }

.conv-input input[readonly] { color: #8996AA !important; }

/* botão da moeda */
.conv-coin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05);
  color: #F5F7FA;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}

.conv-coin:active { transform: scale(.96); background: rgba(255, 255, 255, .1); }

.conv-coin__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(140deg, #34A853, #0F9D58);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 24px;
}

.conv-coin__icon--usdt {
  background: linear-gradient(140deg, #26A17B, #1E8A66);
  font-size: 13px;
}

.conv-coin__sym { letter-spacing: .01em; }

/* --------------------------------------------------------------- presets */
.conv-presets {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.conv-preset {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
  color: #98A0AC;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.conv-preset:active {
  background: rgba(56,107,255, .14);
  border-color: rgba(56,107,255, .4);
  color: #386BFF;
}

/* ---------------------------------------------------------------- inverter */
.conv-swap-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0;
  position: relative;
}

.conv-swap-wrap::before,
.conv-swap-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  width: calc(50% - 32px);
  background: rgba(255, 255, 255, .07);
}
.conv-swap-wrap::before { left: 0; }
.conv-swap-wrap::after  { right: 0; }

.conv-swap {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(56,107,255, .28);
  background: #1B1F27;
  color: #386BFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.conv-swap:active {
  background: rgba(56,107,255, .16);
  transform: scale(.93);
}

.conv-swap.is-spin svg {
  animation: convSpin .5s cubic-bezier(.22, 1, .36, 1);
}

@keyframes convSpin {
  from { transform: rotate(0deg)   scale(.8); }
  to   { transform: rotate(180deg) scale(1);  }
}

/* --------------------------------------------------------------- detalhes */
.conv-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.conv-detail__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #8996AA;
}

.conv-detail__row b {
  color: #C5CBD4;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.conv-detail__row--total {
  margin-top: 3px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, .08);
  font-size: 13.5px;
  color: #A9B1BD;
}

.conv-detail__row--total b {
  color: #386BFF;
  font-size: 16px;
  font-weight: 800;
}

/* ------------------------------------------------------------------- msg */
.conv-msg {
  display: none;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.45;
}

.conv-msg.is-err {
  display: block;
  background: rgba(246, 70, 93, .1);
  border: 1px solid rgba(246, 70, 93, .26);
  color: #FF8494;
}

.conv-msg.is-ok {
  display: block;
  background: rgba(22, 199, 132, .1);
  border: 1px solid rgba(22, 199, 132, .26);
  color: #3DDC97;
}

/* ----------------------------------------------------------------- botão */
.conv-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #5C86FF, #386BFF);
  color: #221900;
  font-size: 16.5px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.conv-submit:active:not(:disabled) { transform: scale(.98); }

.conv-submit:disabled {
  opacity: .38;
  cursor: not-allowed;
  background: #2A2F38;
  color: #8996AA;
}

/* --------------------------------------------------------------- histórico */
.conv-history {
  margin-top: 22px;
}

.conv-history h2 {
  font-size: 15px;
  font-weight: 800;
  color: #F5F7FA;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}

.conv-hist-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 7px;
  border-radius: 12px;
  background: #151920;
  border: 1px solid rgba(255, 255, 255, .055);
  font-size: 12.5px;
}

.conv-hist-item__flow {
  font-weight: 800;
  color: #386BFF;
  font-size: 11.5px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.conv-hist-item__vals {
  color: #C5CBD4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-hist-item__date {
  color: #8996AA;
  font-size: 11px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- nota */
.conv-note {
  margin-top: 20px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #8996AA;
  text-align: center;
}

/* ----------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .conv-wrap { padding: 10px 14px 32px; }
  .conv-head h1 { font-size: 23px; }
  .conv-card { padding: 14px; border-radius: 18px; }
  .conv-input { height: 58px; }
  .conv-input input { font-size: 22px !important; }
  .conv-submit { min-height: 54px; font-size: 16px; }
}

@media (max-width: 380px) {
  .conv-wrap { padding: 8px 12px 28px; }
  .conv-input { height: 54px; }
  .conv-input input { font-size: 20px !important; }
  .conv-coin { height: 38px; padding: 0 10px; font-size: 13px; }
  .conv-coin__icon { width: 21px; height: 21px; flex-basis: 21px; }
  .conv-preset { min-height: 30px; padding: 0 11px; font-size: 12px; }
}

/* ------------------------------------------------------------ acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .conv-rate__dot,
  .conv-swap.is-spin svg { animation: none !important; }
  .conv-swap, .conv-submit, .conv-coin, .conv-preset { transition: none !important; }
}

/* ==========================================================================
   DESKTOP — layout centralizado com header em linha
   ========================================================================== */
@media (min-width: 901px) {
  .conv-page {
    padding-bottom: 0;
  }

  /* header do conversor no desktop */
  .conv-page .app-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(11, 13, 18, .92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }

  .conv-page .app-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: auto;
    min-height: 0;
  }

  .conv-page .app-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    text-decoration: none;
  }

  .conv-page .app-header .logo__text {
    font-size: 19px;
    font-weight: 800;
    color: #F5F7FA;
  }

  .conv-page .conv-back {
    width: auto;
    height: 40px;
    padding: 0 16px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #A9B1BD;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }

  .conv-page .conv-back::after {
    content: "Voltar à carteira";
  }

  .conv-page .conv-back:hover {
    background: rgba(56,107,255, .12);
    color: #386BFF;
  }

  /* container principal */
  .conv-page .conv-wrap {
    max-width: 520px;
    padding: 40px 24px 64px;
  }

  .conv-page .conv-head {
    margin-bottom: 22px;
  }

  .conv-page .conv-head h1 {
    font-size: 32px;
  }

  .conv-page .conv-head p {
    font-size: 14.5px;
  }

  /* card mais espaçado */
  .conv-page .conv-card {
    padding: 24px;
    border-radius: 22px;
  }

  .conv-page .conv-input {
    height: 68px;
  }

  .conv-page .conv-input input {
    font-size: 26px !important;
  }

  .conv-page .conv-preset {
    min-height: 36px;
    font-size: 13px;
    padding: 0 15px;
  }

  .conv-page .conv-preset:hover {
    background: rgba(56,107,255, .14);
    border-color: rgba(56,107,255, .4);
    color: #386BFF;
  }

  .conv-page .conv-submit {
    min-height: 58px;
    font-size: 17px;
  }

  .conv-page .conv-submit:hover:not(:disabled) {
    filter: brightness(1.06);
  }

  .conv-page .conv-swap:hover {
    background: rgba(56,107,255, .16);
    transform: scale(1.06);
  }

  .conv-page .conv-coin:hover {
    background: rgba(255, 255, 255, .1);
  }

  .conv-page .conv-rate {
    font-size: 13.5px;
    padding: 12px 15px;
  }

  .conv-page .conv-note {
    font-size: 12px;
    margin-top: 24px;
  }
}

/* ==========================================================================
   DESKTOP v2 — header de ponta a ponta, logo à esquerda
   ========================================================================== */
@media (min-width: 901px) {
  .conv-page .app-header {
    padding: 0 !important;
  }

  .conv-page .app-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* logo encostado à esquerda */
  .conv-page .app-header .logo {
    order: 1;
    margin-right: auto !important;
    padding: 0 !important;
    flex: 0 0 auto;
  }

  .conv-page .app-header .logo__mark {
    width: 30px !important;
    height: 30px !important;
    display: block !important;
    object-fit: contain;
  }

  .conv-page .app-header .logo__text {
    font-size: 19px !important;
    font-weight: 800 !important;
    color: #F5F7FA !important;
    letter-spacing: -.02em;
  }

  /* botão voltar à direita */
  .conv-page .conv-back {
    order: 2;
    margin-left: auto !important;
    width: auto !important;
    padding: 0 16px !important;
    gap: 7px !important;
    position: static !important;
  }

  /* conteúdo centralizado */
  .conv-page .conv-wrap {
    max-width: 520px;
    margin: 0 auto !important;
    padding: 44px 24px 72px !important;
  }

  /* card mais largo no desktop */
  .conv-page .conv-card {
    padding: 26px !important;
  }

  /* histórico na mesma largura */
  .conv-page .conv-history,
  .conv-page .conv-note,
  .conv-page .conv-head,
  .conv-page .conv-rate {
    max-width: 100%;
  }
}
