.rp-account-modal[hidden] { display: none !important; }
.rp-account-modal,
.rp-account-modal * { box-sizing: border-box; }

.rp-account-modal {
  position: fixed;
  z-index: 100100;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .22s ease;
}

.rp-account-modal.is-open { opacity: 1; }
.rp-account-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 8, .82);
  backdrop-filter: blur(12px) saturate(115%);
}

.rp-account-dialog {
  position: relative;
  width: min(100%, 560px);
  margin: auto;
  overflow: hidden;
  padding: 38px;
  border: 1px solid rgba(216, 180, 254, .2);
  border-radius: 28px;
  outline: none;
  color: #f7f4fa;
  background:
    radial-gradient(circle at 12% 0, rgba(168, 85, 247, .2), transparent 32%),
    linear-gradient(155deg, rgba(24, 17, 33, .99), rgba(9, 8, 14, .995));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .68), inset 0 1px rgba(255, 255, 255, .05);
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: opacity .24s ease, transform .32s cubic-bezier(.2, .8, .2, 1);
}

.rp-account-modal.is-open .rp-account-dialog { opacity: 1; transform: translateY(0) scale(1); }
.rp-account-dialog::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(217, 70, 239, .12);
  filter: blur(70px);
  pointer-events: none;
}

.rp-account-dialog__close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  color: #d4d0da;
  background: rgba(255, 255, 255, .04);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rp-account-dialog__close:hover { color: #fff; border-color: rgba(216, 180, 254, .35); background: rgba(168, 85, 247, .12); }
.rp-account-dialog__brand {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(216, 180, 254, .28);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #7e22ce, #c026d3);
  box-shadow: 0 12px 30px rgba(168, 85, 247, .28);
  font-size: 23px;
  font-weight: 900;
}

.rp-account-dialog__eyebrow { margin: 0 0 8px; color: #d8b4fe; font-size: 10px; font-weight: 850; letter-spacing: .19em; text-transform: uppercase; }
.rp-account-dialog h2 { margin: 0; font-size: clamp(28px, 5vw, 38px); font-weight: 850; line-height: 1.08; letter-spacing: -.035em; }
.rp-account-dialog__intro { margin: 12px 0 24px; color: rgba(228, 228, 231, .68); font-size: 14px; line-height: 1.65; }

.rp-account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 22px; padding: 5px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.rp-account-tabs button { min-height: 42px; border: 0; border-radius: 10px; color: #aaa5b2; background: transparent; font-weight: 750; cursor: pointer; }
.rp-account-tabs button[aria-selected="true"] { color: #fff; background: rgba(168, 85, 247, .18); box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .18); }

.rp-account-form { display: grid; gap: 15px; }
.rp-account-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rp-account-form label:not(.rp-account-check):not(.rp-account-hp) { display: grid; gap: 7px; color: #d8d5dd; font-size: 12px; font-weight: 700; }
.rp-account-form label small { color: #817b8a; font-size: 10px; font-weight: 500; }
.rp-account-form input[type="text"],
.rp-account-form input[type="email"],
.rp-account-form input[type="password"] {
  width: 100%;
  min-height: 47px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 12px;
  outline: 0;
  color: #fff;
  background: rgba(5, 5, 9, .55);
  font: inherit;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.rp-account-form input:focus { border-color: rgba(192, 132, 252, .68); background: rgba(12, 9, 18, .88); box-shadow: 0 0 0 3px rgba(168, 85, 247, .12); }
.rp-account-check { display: flex; align-items: flex-start; gap: 10px; color: #aaa5b2; font-size: 11px; line-height: 1.5; }
.rp-account-check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: #a855f7; }
.rp-account-check a, .rp-account-forgot { color: #d8b4fe; }
.rp-account-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.rp-account-form__message { min-height: 0; color: #d4d0da; font-size: 12px; line-height: 1.5; }
.rp-account-form__message:not(:empty) { min-height: 39px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(255, 255, 255, .035); }
.rp-account-form__message[data-type="error"] { border-color: rgba(248, 113, 113, .25); color: #fecaca; background: rgba(127, 29, 29, .14); }
.rp-account-form__message[data-type="success"] { border-color: rgba(52, 211, 153, .22); color: #a7f3d0; background: rgba(6, 78, 59, .14); }

.rp-account-submit {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(105deg, #7e22ce, #a21caf 55%, #c026d3);
  box-shadow: 0 13px 34px rgba(147, 51, 234, .28), inset 0 1px rgba(255, 255, 255, .16);
  font-weight: 800;
  cursor: pointer;
}

.rp-account-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 42px rgba(168, 85, 247, .38); }
.rp-account-submit:disabled { cursor: wait; opacity: .7; }
.rp-account-submit i { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: rp-account-spin .7s linear infinite; }
.rp-account-form.is-busy .rp-account-submit i { display: block; }
.rp-account-forgot { width: fit-content; margin: 0 auto; font-size: 12px; text-decoration: none; }
.rp-account-forgot:hover { text-decoration: underline; }

.rp-account-toast {
  position: fixed;
  z-index: 100110;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(430px, calc(100% - 44px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid rgba(192, 132, 252, .24);
  border-radius: 16px;
  color: #f4f0f7;
  background: rgba(17, 13, 24, .96);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .5);
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(15px);
  animation: rp-account-toast-in .4s cubic-bezier(.2, .8, .2, 1) both;
}

.rp-account-toast--success { border-color: rgba(52, 211, 153, .28); }
.rp-account-toast--error { border-color: rgba(248, 113, 113, .28); }
.rp-account-toast button { border: 0; color: #bdb8c4; background: transparent; font-size: 22px; cursor: pointer; }
.rp-account-toast.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
body.rp-account-modal-open { overflow: hidden !important; }

@keyframes rp-account-spin { to { transform: rotate(360deg); } }
@keyframes rp-account-toast-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 600px) {
  .rp-account-modal { align-items: end; padding: 0; }
  .rp-account-dialog { width: 100%; max-height: calc(100dvh - 18px); overflow-y: auto; padding: 30px 20px 24px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 24px 24px 0 0; }
  .rp-account-dialog__close { top: 14px; right: 14px; }
  .rp-account-form__row { grid-template-columns: 1fr; }
  .rp-account-toast { right: 14px; bottom: 14px; width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  .rp-account-modal,
  .rp-account-dialog,
  .rp-account-toast { transition: none; animation: none; }
  .rp-account-submit i { animation-duration: 1.4s; }
}
