/* Profile increase-credit panel — Maui ProfilePage parity */

.dz-profile__credit {
  transition: font-size 250ms cubic-bezier(0.33, 1, 0.68, 1);
}

.dz-profile__credit.is-compact {
  font-size: 12px;
}

.dz-profile__credit.is-pulse {
  animation: dz-credit-pulse 370ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dz-credit-pulse {
  0% { transform: scale(1); }
  32% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.dz-profile__credit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Always centered — stretch/RTL was growing from the right edge */
  align-self: center;
  box-sizing: border-box;
  width: 150px;
  max-width: 100%;
  margin-top: 2px;
  /* Height locked — only width expands */
  padding: 7px 16px;
  min-height: 0;
  line-height: 1.25;
  border: none;
  border-radius: 8px;
  background: var(--dz-primary, #350066);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  transition:
    width 250ms cubic-bezier(0.33, 1, 0.68, 1),
    font-size 250ms cubic-bezier(0.33, 1, 0.68, 1),
    background-color 250ms ease;
}

.dz-profile__credit-btn:disabled {
  opacity: 1; /* stay solid while expanded/open */
  cursor: default;
}

.dz-profile__credit-btn.is-expanded {
  /* Stay centered; width % grows equally both sides */
  align-self: center;
  width: 100%;
  font-size: 18px; /* one step up from 16 — not 20 */
  padding: 7px 16px;
}

/* Password panel: fade + slide up (no scale/spring jump) */
.dz-profile__credit-btn.is-fade-up {
  animation: dz-credit-btn-fade-up 250ms cubic-bezier(0.32, 0, 0.67, 0) both;
  pointer-events: none;
}

@keyframes dz-credit-btn-fade-up {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-14px); }
}

/* Password return: fade + slide down into place */
.dz-profile__credit-btn.is-fade-down-in {
  animation: dz-credit-btn-fade-down-in 250ms cubic-bezier(0.33, 1, 0.68, 1) both;
  pointer-events: none;
}

@keyframes dz-credit-btn-fade-down-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
  .dz-profile__credit-btn {
    background: var(--dz-secondary-dark, #9f58e1);
  }
}

/* ---- Credit form ---- */
.dz-credit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 12px;
  box-sizing: border-box;
}

.dz-credit.is-enter {
  animation: dz-credit-in 350ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.dz-credit.is-leaving {
  animation: dz-credit-out 250ms cubic-bezier(0.32, 0, 0.67, 0) both;
  pointer-events: none;
}

@keyframes dz-credit-in {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dz-credit-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.9); }
}

.dz-credit__label {
  margin: 0;
  font-size: 14px;
  /* Explicit right — text-align:end is LEFT under dir=rtl */
  text-align: right;
  color: var(--dz-gray-600, #404040);
}

.dz-credit__label--muted {
  font-size: 12px;
  text-align: center;
  color: var(--dz-gray-400, #919191);
}

.dz-credit__label--gateway {
  margin-top: 10px;
  text-align: right;
  opacity: 0.4;
  transition: opacity 150ms ease;
}

.dz-credit__label--gateway.is-on {
  opacity: 1;
}

.dz-credit__amount {
  display: flex;
  direction: ltr; /* ریال left · input right (Maui Grid col0/col1) */
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 72%;
  max-width: 320px;
  margin: 4px auto;
  padding: 8px 12px;
  border: 1px solid #b0b0b0;
  border-radius: 10px;
  background: transparent;
  box-sizing: border-box;
}

.dz-credit__rial {
  font-size: 14px;
  opacity: 0.6;
  color: var(--dz-primary-dark, #5d189f);
  white-space: nowrap;
}

.dz-credit__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-size: 16px;
  font-family: inherit;
  color: inherit;
  direction: ltr;
}

.dz-credit__input::placeholder {
  color: var(--dz-gray-400, #919191);
  font-size: 13px;
  direction: rtl;
}

.dz-credit__quick {
  display: flex;
  direction: rtl; /* 100,000 right · 1,000,000 left */
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0;
}

.dz-credit__chip {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  background: #e8e8e8;
  color: var(--dz-primary-dark, #5d189f);
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease, transform 60ms ease;
}

.dz-credit__chip.is-on {
  opacity: 1;
  background: #e0d4f0;
  color: var(--dz-primary-dark, #5d189f);
}

.dz-credit__chip.is-press {
  transform: scale(0.92);
}

.dz-credit__gateways {
  display: flex;
  direction: ltr; /* Maui grid: Saman left, Mellat right */
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  height: 41px;
  margin: 4px 0;
}

.dz-credit__gw {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  min-width: 96px;
  border: 1px solid #b0b0b0;
  border-radius: 8px;
  background: transparent;
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 100ms ease, border-color 100ms ease, transform 150ms ease;
}

.dz-credit__gw:disabled {
  cursor: default;
}

.dz-credit__gw.is-ready {
  opacity: 1;
}

.dz-credit__gw.is-on {
  opacity: 1;
  border-color: var(--dz-primary-dark, #5d189f);
}

.dz-credit__gw.is-dim {
  opacity: 0.3;
  border-color: #b0b0b0;
}

.dz-credit__gw.is-pop {
  animation: dz-gw-pop 350ms ease;
}

@keyframes dz-gw-pop {
  0% { transform: scale(1); }
  45% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

.dz-credit__gw img {
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}

.dz-credit__pay-wrap {
  position: relative;
  width: 200px;
  margin: 10px auto 0;
}

.dz-credit__pay {
  width: 200px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #b0b0b0;
  opacity: 0.5;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease, transform 120ms ease;
}

.dz-credit__pay.is-ready {
  background: #5d189f;
  opacity: 1;
}

.dz-credit__pay.is-ready.is-bounce {
  animation: dz-pay-bounce 370ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dz-pay-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

.dz-credit__pay.is-loading {
  background: #8b5cf6;
  opacity: 1;
  color: transparent;
  pointer-events: none;
}

.dz-credit__pay-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dz-spin 0.7s linear infinite;
  pointer-events: none;
  display: none;
}

.dz-credit__pay.is-loading + .dz-credit__pay-spin,
.dz-credit__pay-wrap.is-loading .dz-credit__pay-spin {
  display: block;
}

.dz-credit__back {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--dz-gray-600, #404040);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.dz-credit__back .dz-ico {
  font-size: 12px;
  color: var(--dz-primary, #350066);
}

/* ---- Success / failure feedback ---- */
.dz-credit-fb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px 16px;
  min-height: 220px;
  text-align: center;
}

.dz-credit-fb.is-enter {
  animation: dz-credit-fb-in 300ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.dz-credit-fb.is-leaving {
  animation: dz-credit-out 250ms cubic-bezier(0.32, 0, 0.67, 0) both;
  pointer-events: none;
}

@keyframes dz-credit-fb-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.dz-credit-fb__lottie {
  width: 125px;
  height: 125px;
}

.dz-credit-fb__msg {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dz-primary, #350066);
  max-width: 100%;
  line-height: 1.45;
}

/* Success copy stays on one line */
.dz-credit-fb:not(.is-fail) .dz-credit-fb__msg {
  white-space: nowrap;
  max-width: none;
}

.dz-credit-fb.is-fail .dz-credit-fb__msg {
  color: #9e0b0f;
  max-width: 28ch;
}

.dz-credit-fb__bar {
  width: 120px;
  height: 8px;
  margin-top: 20px;
  border-radius: 5px;
  background: color-mix(in srgb, #8a2be2 18%, transparent);
  overflow: hidden;
}

.dz-credit-fb__bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #8a2be2;
  border-radius: 5px;
  animation: dz-credit-bar 2s linear forwards;
}

.dz-credit-fb.is-fail .dz-credit-fb__bar {
  background: color-mix(in srgb, #9e0b0f 18%, transparent);
}

.dz-credit-fb.is-fail .dz-credit-fb__bar > span {
  background: #9e0b0f;
}

@keyframes dz-credit-bar {
  from { width: 0; }
  to { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  .dz-credit__label {
    color: var(--dz-gray-300, #acacac);
  }

  .dz-credit__label--muted {
    color: var(--dz-gray-300, #acacac);
  }

  .dz-credit__rial {
    color: var(--dz-secondary-dark-text, #ed24ff);
  }

  .dz-credit__chip {
    background: #404040;
    color: #fff;
  }

  .dz-credit__chip.is-on {
    background: #1c1c1c;
    color: var(--dz-secondary-dark-text, #ed24ff);
  }

  .dz-credit__gw.is-on {
    border-color: var(--dz-secondary-dark-text, #ed24ff);
  }

  .dz-credit__back {
    color: var(--dz-gray-300, #acacac);
  }

  .dz-credit__back .dz-ico {
    color: var(--dz-gray-300, #acacac);
  }

  .dz-credit-fb__msg {
    color: var(--dz-secondary-dark-text, #ed24ff);
  }

  .dz-credit-fb.is-fail .dz-credit-fb__msg {
    color: #ed1c24;
  }

  .dz-credit-fb.is-fail .dz-credit-fb__bar {
    background: color-mix(in srgb, #ed1c24 18%, transparent);
  }

  .dz-credit-fb.is-fail .dz-credit-fb__bar > span {
    background: #ed1c24;
  }
}
