/* RAEL CHEATS — sistema unificado de modais / popups */

:root {
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --modal-dur: 0.32s;
  --modal-dur-out: 0.22s;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 1200;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: clamp(12px, 4vw, 24px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: transparent;
  backdrop-filter: none;
  transition: opacity var(--modal-dur) ease, visibility var(--modal-dur) ease;
}

.modal:not(.hidden) {
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal.is-closing {
  opacity: 0;
  visibility: hidden;
  transition-duration: var(--modal-dur-out);
}

.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(225, 6, 0, 0.08), transparent 55%),
    rgba(3, 3, 5, 0.78);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  opacity: 0;
  transition: opacity var(--modal-dur) ease;
}

.modal.is-open::before {
  opacity: 1;
}

.modal.is-closing::before {
  opacity: 0;
  transition-duration: var(--modal-dur-out);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 94vw);
  max-height: min(92dvh, 920px);
  margin: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(165deg, rgba(34, 34, 38, 0.98) 0%, rgba(16, 16, 18, 0.99) 48%, rgba(10, 10, 12, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 0;
  display: grid;
  gap: 0;
  box-shadow:
    0 0 0 1px rgba(225, 6, 0, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 48px rgba(225, 6, 0, 0.04);
  transform: translateY(18px) scale(0.93);
  opacity: 0;
  flex: none;
  animation: none;
  transition:
    transform var(--modal-dur) var(--modal-ease),
    opacity calc(var(--modal-dur) * 0.85) ease,
    box-shadow 0.3s ease;
}

.modal.is-open .modal-card {
  transform: none;
  opacity: 1;
}

.modal.is-closing .modal-card {
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  transition-duration: var(--modal-dur-out);
}

.modal-glow {
  position: absolute;
  top: -42%;
  left: 50%;
  width: 130%;
  height: 65%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(225, 6, 0, 0.16) 0%, transparent 68%);
  pointer-events: none;
  opacity: 0.75;
}

.modal-accent {
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(225, 6, 0, 0.55) 18%,
    rgba(255, 90, 70, 0.95) 50%,
    rgba(225, 6, 0, 0.55) 82%,
    transparent
  );
  opacity: 0.92;
  pointer-events: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 0;
}

.modal-head-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.modal-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(225, 6, 0, 0.12);
  border: 1px solid rgba(225, 6, 0, 0.28);
  color: #ff7a6a;
  box-shadow: 0 0 26px rgba(225, 6, 0, 0.14);
  animation: modalIconPop 0.45s var(--modal-ease) 0.08s both;
}

.modal-icon:empty::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 30%, currentColor 2px, transparent 2.5px),
    linear-gradient(currentColor, currentColor) center 62%/2px 8px no-repeat;
}

.modal-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}

.modal-icon.is-danger {
  background: rgba(185, 28, 28, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ff8080;
  box-shadow: 0 0 30px rgba(185, 28, 28, 0.22);
}

.modal-icon.is-create {
  background: rgba(225, 6, 0, 0.18);
  border-color: rgba(255, 100, 80, 0.4);
  color: #ff9a8a;
  box-shadow: 0 0 32px rgba(225, 6, 0, 0.2);
}

.modal-icon.is-info {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #d4d4d4;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
}

.modal-icon.is-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.32);
  color: #6ee7a0;
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.15);
}

@keyframes modalIconPop {
  from {
    opacity: 0;
    transform: scale(0.72) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-title,
.modal-card > h3:first-child {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}

.modal-x,
.dlg-x {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #aaa;
  font-size: 0;
  line-height: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.modal-x svg,
.dlg-x svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  pointer-events: none;
}

.modal-x:hover,
.dlg-x:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.modal-x:active,
.dlg-x:active {
  transform: scale(0.94);
}

.modal-body {
  padding: 16px 22px;
  display: grid;
  gap: 12px;
  animation: modalBodyIn 0.38s var(--modal-ease) 0.06s both;
}

@keyframes modalBodyIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: #b4b4b4;
}

.modal-foot,
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 22px 22px;
  animation: modalBodyIn 0.4s var(--modal-ease) 0.1s both;
}

.modal-btn {
  min-width: 108px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  transition: transform 0.15s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.modal-btn:active {
  transform: scale(0.97);
}

.modal-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ececec;
}

.modal-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.modal-btn--primary {
  background: linear-gradient(135deg, #e10600 0%, #b80500 100%);
  border: 1px solid rgba(255, 120, 100, 0.25);
  color: #fff;
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.32);
}

.modal-btn--primary:hover {
  background: linear-gradient(135deg, #f01810 0%, #c80600 100%);
  box-shadow: 0 12px 32px rgba(225, 6, 0, 0.4);
}

.modal-btn--danger {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fff;
  box-shadow: 0 10px 30px rgba(185, 28, 28, 0.38);
}

.modal-btn--danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 12px 34px rgba(220, 38, 38, 0.45);
}

/* Dialog genérico */
.dlg-card {
  width: min(420px, 94vw);
}

.dlg-card.is-danger .modal-glow {
  background: radial-gradient(ellipse at center, rgba(185, 28, 28, 0.22) 0%, transparent 68%);
}

.dlg-card.is-danger .modal-accent {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(220, 38, 38, 0.5) 18%,
    rgba(248, 113, 113, 0.95) 50%,
    rgba(220, 38, 38, 0.5) 82%,
    transparent
  );
}

.dlg-fields {
  display: grid;
  gap: 12px;
}

.dlg-fields label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: #cfcfcf;
}

.dlg-fields input,
.dlg-fields select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 11px 14px;
  color: #fff;
  color-scheme: dark;
  font-size: 14px;
  line-height: 1.35;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dlg-fields select {
  min-height: 44px;
  height: auto;
  padding-right: 36px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}

.dlg-select {
  position: relative;
  width: 100%;
}

.dlg-select-btn {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
}

.dlg-select-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: .7;
}

.dlg-select.is-open .dlg-select-btn,
.dlg-select-btn:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
  background: rgba(0, 0, 0, 0.45);
}

.dlg-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #161616;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.dlg-select.is-open .dlg-select-menu {
  display: grid;
}

.dlg-select-opt {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: #161616;
  color: #eee;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.dlg-select-btn.is-placeholder {
  color: #8a8a8a;
}

.dlg-select-opt:hover,
.dlg-select-opt.is-on {
  background: rgba(225, 6, 0, 0.16);
  color: #fff;
}

.dlg-fields input:focus,
.dlg-fields select:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
  background: rgba(0, 0, 0, 0.45);
}

.dlg-fields input[type="date"] {
  min-height: 44px;
}

.dlg-fields label.is-off input[type="date"] {
  opacity: 0.4;
  pointer-events: none;
}

.dlg-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ddd;
}

.dlg-check input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: #e10600;
  border-radius: 4px;
}

.dlg-actions .modal-btn,
.dlg-actions .btn-dark,
.dlg-actions .btn-orange {
  width: auto;
}

.dlg-card.is-create .modal-foot,
.dlg-card.is-create .dlg-actions {
  display: block;
}

.dlg-card.is-create #dlgOk {
  width: 100%;
  min-width: 0;
  padding: 14px 18px;
  font-weight: 700;
}

.dlg-actions.is-solo,
.modal-foot.is-solo {
  display: block;
}

.dlg-actions.is-solo #dlgOk,
.modal-foot.is-solo .modal-btn {
  width: 100%;
  min-width: 0;
}

/* Gerar keys */
.modal-card.gen-keys-card {
  width: min(460px, 94vw);
  overflow: visible;
}

.gen-keys-card .modal-body,
.gen-keys-card .gen-keys-body-wrap {
  padding: 16px 22px;
  display: grid;
  gap: 14px;
  overflow: visible;
}

.gen-keys-app-hint {
  margin: 0;
  font-size: 13px;
  color: #9a9a9a;
}

.gen-keys-app-hint strong {
  color: #fff;
  font-weight: 700;
}

.gen-keys-app-hint-sub {
  opacity: 0.75;
}

.gen-keys-body {
  display: grid;
  gap: 14px;
}

.gen-keys-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.gen-keys-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cfcfcf;
}

.gen-keys-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.gen-keys-input:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}

.gen-keys-mask {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
}

select.gen-keys-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  accent-color: #e10600;
}

.gen-keys-select.dlg-select {
  width: 100%;
  z-index: 30;
}

.gen-keys-select.is-open {
  z-index: 80;
}

.gen-keys-select .dlg-select-btn {
  min-height: 44px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.1);
}

.gen-keys-select .dlg-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  max-height: min(280px, 50vh);
  overflow-y: auto;
  background: #161616;
  border-color: rgba(255, 255, 255, 0.1);
  z-index: 90;
}

.gen-keys-select .dlg-select-opt {
  background: #161616;
}

.gen-keys-select .dlg-select-opt:hover,
.gen-keys-select .dlg-select-opt.is-on {
  background: rgba(225, 6, 0, 0.16);
  color: #fff;
}

.gen-keys-body,
.gen-keys-expiry,
.gen-keys-field {
  overflow: visible;
}

.gen-keys-expiry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gen-keys-hint {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #aaa;
  font-size: 11px;
  font-style: normal;
  cursor: help;
}

.gen-keys-hint em {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  line-height: 1.45;
  color: #bbb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.gen-keys-hint:hover em,
.gen-keys-hint:focus-visible em {
  opacity: 1;
}

.gen-keys-msg {
  margin: 0;
  font-size: 13px;
  color: #ff8a8a;
}

.gen-keys-msg.is-ok {
  color: var(--ok, #4ade80);
}

.gen-keys-submit {
  margin: 0 22px 22px;
  width: calc(100% - 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.3);
}

.gen-keys-submit svg {
  width: 16px;
  height: 16px;
}

/* Pix */
.pix-modal-card {
  width: min(440px, 94vw);
}

.pix-modal-card .modal-body {
  text-align: center;
}

.pix-modal-card .modal-msg,
.pix-modal-card > .muted:first-of-type,
.pix-modal-card .modal-body > .muted {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange, #e10600);
  letter-spacing: -0.02em;
}

.pix-qr-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 8px auto;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Comprar */
.buy-modal-card .modal-body {
  gap: 10px;
}

.buy-plans {
  display: grid;
  gap: 8px;
}

.buy-plans button {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 13px 14px;
  color: #fff;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.buy-plans button:hover {
  border-color: rgba(225, 6, 0, 0.35);
  background: rgba(225, 6, 0, 0.08);
}

.buy-plans button:active {
  transform: scale(0.99);
}

/* Key result */
.key-result-card .key-code {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.18em;
  font-size: 1.35rem;
  text-align: center;
  padding: 16px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 0 0 24px rgba(225, 6, 0, 0.06);
}

.key-result-card .kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #aaa;
}

.key-result-card .kv strong {
  color: #fff;
}

.key-result-card .key-copied-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12px;
  color: #86efac;
}

.key-result-card .key-code.is-multi {
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  white-space: pre-wrap;
  line-height: 1.55;
  text-align: left;
}

/* Promo */
.promo-card.modal-card {
  width: min(480px, 94vw);
  text-align: center;
}

.promo-card .modal-body {
  padding-top: 8px;
}

.promo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #bbb;
  font-size: 0;
  line-height: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.promo-close svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  pointer-events: none;
}

.promo-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.promo-ico {
  color: var(--orange, #e10600);
  margin: 0 auto 12px;
  animation: modalIconPop 0.45s var(--modal-ease) 0.08s both;
}

.promo-ico svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 18px rgba(225, 6, 0, 0.35));
}

.promo-card h3 {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.promo-card h3 span {
  color: var(--orange, #e10600);
}

.promo-card p {
  color: #9a9a9a;
  font-size: 14px;
  line-height: 1.5;
}

.promo-ask {
  color: #eee !important;
  margin: 18px 0 10px;
}

.promo-ask b {
  color: var(--orange, #e10600);
  font-weight: 700;
}

.promo-card input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 14px;
  color: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.promo-card input:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}

.promo-card .btn-orange,
.promo-card .modal-btn--primary {
  width: 100%;
  text-transform: none;
}

@media (max-width: 560px) {
  .gen-keys-expiry {
    grid-template-columns: 1fr;
  }

  .modal-foot,
  .dlg-actions {
    flex-direction: column-reverse;
  }

  .modal-foot .modal-btn,
  .dlg-actions .modal-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal::before,
  .modal-card,
  .modal-icon,
  .modal-body,
  .modal-foot,
  .dlg-actions,
  .promo-ico {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
