.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  max-width: 180px;
  overflow: hidden;
  color: var(--ink, #f5f6f8);
  border-color: rgba(255, 120, 135, .38);
  background: rgba(200, 16, 46, .08);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-button:hover,
.account-button:focus-visible {
  border-color: rgba(255, 120, 135, .78);
  background: rgba(200, 16, 46, .18);
}

.account-button.is-signed {
  color: #fff;
  border-color: rgba(255, 120, 135, .58);
  background: rgba(200, 16, 46, .2);
}

.account-button__icon {
  width: 19px;
  height: 19px;
  flex: none;
}

.account-avatar-token {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .34), transparent 31%),
    linear-gradient(145deg,
      hsl(var(--account-avatar-hue, 350) 76% 54%),
      hsl(var(--account-avatar-hue-alt, 8) 70% 31%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 8px 22px hsl(var(--account-avatar-hue, 350) 74% 34% / .28);
  font-family: Inter, sans-serif;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.035em;
  user-select: none;
}

.account-button__avatar {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, .2);
  font-size: .67rem;
}

.account-avatar-token[hidden] { display: none; }
.account-button [data-account-button-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-button.is-signed .account-button__icon { display: none; }

.account-dialog {
  width: min(94vw, 860px);
  max-height: min(90vh, 680px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--radius-l, 22px);
  color: var(--ink, #f5f6f8);
  background: #101217;
  box-shadow: 0 34px 110px rgba(0, 0, 0, .82), 0 0 0 1px rgba(200, 16, 46, .08);
  overflow: auto;
}

.account-dialog[open] {
  animation: account-dialog-arrive 360ms var(--motion-ease, cubic-bezier(.16, 1, .3, 1)) both;
}

.account-dialog::backdrop {
  background: rgba(4, 5, 8, .83);
  backdrop-filter: blur(10px) saturate(.7);
}

.account-dialog[open]::backdrop {
  animation: account-backdrop-arrive 260ms ease both;
}

@keyframes account-dialog-arrive {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes account-backdrop-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

.account-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(390px, 1.18fr);
  min-height: 570px;
  overflow: hidden;
}

.account-close {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 9, 13, .62);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s var(--motion-ease, cubic-bezier(.16, 1, .3, 1)), background .18s ease, border-color .18s ease;
}

.account-close:hover,
.account-close:focus-visible {
  border-color: rgba(255, 120, 135, .55);
  background: var(--accent, #c8102e);
  transform: rotate(4deg) scale(1.04);
  outline: none;
}

.account-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 30px 30px 28px;
  border-right: 1px solid rgba(255, 255, 255, .09);
  background:
    radial-gradient(circle at 15% 86%, rgba(255, 91, 112, .28), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(200, 16, 46, .32), transparent 32%),
    linear-gradient(145deg, #280811 0%, #16080e 52%, #0f1116 100%);
  isolation: isolate;
}

.account-showcase::before,
.account-showcase::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgba(255, 120, 135, .12);
  border-radius: 50%;
  /* Vòng tròn chỉ để trang trí. Không được chặn click/focus các ô nhập
     khi chúng vươn sang nửa biểu mẫu. */
  pointer-events: none;
}

.account-showcase::before {
  width: 320px;
  height: 320px;
  right: -184px;
  top: 98px;
}

.account-showcase::after {
  width: 180px;
  height: 180px;
  right: -84px;
  top: 168px;
}

.account-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  color: #fff;
  font: 750 .97rem/1 Inter, sans-serif;
  text-decoration: none;
  letter-spacing: -.015em;
}

.account-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, .45));
}

.account-brand strong { color: var(--accent-text, #ff7887); }

.account-showcase__copy { margin: auto 0; }

.account-kicker,
.account-eyebrow {
  margin: 0;
  color: var(--accent-text, #ff7887);
  font: 800 .7rem/1.2 Inter, sans-serif;
  letter-spacing: .15em;
}

.account-showcase__copy h3 {
  max-width: 310px;
  margin: 12px 0 14px;
  color: #fff;
  font: 850 clamp(1.65rem, 3.4vw, 2.35rem)/1.06 Inter, sans-serif;
  letter-spacing: -.045em;
}

.account-showcase__copy > p:last-child {
  max-width: 285px;
  margin: 0;
  color: #c9cbd1;
  font-size: .89rem;
  line-height: 1.58;
}

.account-devices {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, .68);
  font: 800 .61rem/1 Inter, sans-serif;
  letter-spacing: .1em;
}

.account-devices i {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 120, 135, .18), rgba(255, 120, 135, .85));
}

.account-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 58px 44px 40px;
  background:
    radial-gradient(circle at 102% 100%, rgba(200, 16, 46, .09), transparent 32%),
    linear-gradient(155deg, #191c22, #13151a 78%);
}

.account-head { margin-bottom: 14px; }

.account-head h2 {
  margin: 6px 0 0;
  color: #fff;
  font: 850 clamp(1.75rem, 4vw, 2.25rem)/1.08 Inter, sans-serif;
  letter-spacing: -.04em;
}

.account-lede {
  max-width: 430px;
  margin: 0 0 22px;
  color: var(--ink-dim, #c3c8d0);
  font-size: .94rem;
  line-height: 1.55;
}

.account-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 19px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 13px;
  background: #0d0f14;
}

.account-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: #8f96a1;
  background: transparent;
  font: 750 .9rem Inter, sans-serif;
  cursor: pointer;
  transition: color .18s ease, background .22s ease, box-shadow .28s var(--motion-ease, cubic-bezier(.16, 1, .3, 1));
}

.account-tabs button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #c8102e), var(--accent-deep, #a20d26));
  box-shadow: 0 8px 24px rgba(200, 16, 46, .25);
}

.account-tabs button:focus-visible {
  outline: 2px solid var(--accent-text, #ff7887);
  outline-offset: 2px;
}

.account-form { display: grid; gap: 15px; }
.account-form:not([hidden]),
.account-signed:not([hidden]) {
  animation: account-panel-arrive 260ms var(--motion-ease, cubic-bezier(.16, 1, .3, 1)) both;
}
@keyframes account-panel-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.account-form[hidden],
.account-signed[hidden] { display: none !important; }

.account-form label {
  display: grid;
  gap: 7px;
  color: #d8dce3;
  font: 650 .84rem Inter, sans-serif;
}

.account-form input {
  width: 100%;
  min-height: 49px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  padding: 0 14px;
  color: #fff;
  background: rgba(8, 10, 14, .8);
  font: 500 1rem Inter, sans-serif;
  outline: none;
  transition: border-color .18s ease, box-shadow .26s var(--motion-ease, cubic-bezier(.16, 1, .3, 1)), background .18s ease;
}

.account-form input:hover { border-color: rgba(255, 255, 255, .26); }

.account-form input:focus {
  border-color: var(--accent-text, #ff7887);
  background: #0b0d11;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .18);
}

.account-submit {
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #c8102e), var(--accent-deep, #a20d26));
  box-shadow: 0 10px 28px rgba(200, 16, 46, .24);
  font: 800 .95rem Inter, sans-serif;
  cursor: pointer;
  transition: filter .18s ease, transform .2s var(--motion-ease, cubic-bezier(.16, 1, .3, 1)), box-shadow .28s var(--motion-ease, cubic-bezier(.16, 1, .3, 1));
}

.account-submit:hover,
.account-submit:focus-visible {
  filter: brightness(1.13);
  transform: translateY(-1px);
  box-shadow: 0 13px 32px rgba(200, 16, 46, .32);
  outline: none;
}

.account-submit:disabled { opacity: .58; cursor: wait; transform: none; }

.account-submit--secondary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #323740, #23272f);
  box-shadow: none;
}

.account-note {
  margin: 0;
  color: #949ba6;
  font-size: .81rem;
  line-height: 1.5;
}

.account-note strong { color: #c9ced6; }

.account-status {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(49, 196, 109, .13);
  border-radius: 10px;
  color: #c9f7dc;
  background: rgba(37, 173, 93, .1);
  font-size: .84rem;
  line-height: 1.4;
}

.account-status.is-error {
  border-color: rgba(226, 67, 67, .18);
  color: #ffd1d1;
  background: rgba(226, 67, 67, .13);
}

.account-signed { text-align: center; }
.account-signed > p { color: #c7ccd5; }

.account-signed__hello {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.55;
}

.account-signed__hello strong { color: #fff; font-size: 1.3rem; }

.account-avatar {
  width: 74px;
  height: 74px;
  margin: 4px auto 16px;
  border: 2px solid rgba(255, 120, 135, .48);
  font-size: 1.35rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 14px 36px hsl(var(--account-avatar-hue, 350) 74% 34% / .3),
    0 0 0 6px rgba(255, 255, 255, .025);
}

.account-link {
  margin-top: 14px;
  border: 0;
  color: #bfc4cc;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

body.tv-page .account-dialog { width: min(82vw, 980px); max-height: 82vh; border-radius: 28px; font-size: 1.12rem; }
body.tv-page .account-card { grid-template-columns: minmax(320px, .9fr) minmax(460px, 1.1fr); min-height: 630px; }
body.tv-page .account-showcase { padding: 42px; }
body.tv-page .account-panel { padding: 68px 54px 48px; }
body.tv-page .account-form input,
body.tv-page .account-submit { min-height: 62px; font-size: 1.08rem; }
body.tv-page .account-close { width: 54px; height: 54px; }
body.tv-page .account-tabs button { min-height: 54px; font-size: 1rem; }
body.tv-page .account-button__avatar { width: 32px; height: 32px; font-size: .78rem; }

@media (max-width: 720px) {
  .account-button { max-width: 122px; padding-inline: 10px; }
  .account-button__icon { width: 18px; height: 18px; }
  .account-button__avatar { width: 23px; height: 23px; font-size: .62rem; }
  .account-dialog { width: calc(100vw - 22px); max-height: calc(100dvh - 26px); border-radius: 18px; }
  .account-card { display: block; min-height: 0; }
  .account-showcase { display: block; padding: 20px 58px 17px 20px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .09); }
  .account-brand img { width: 34px; height: 34px; }
  .account-showcase__copy { margin-top: 18px; }
  .account-showcase__copy h3 { margin: 7px 0 0; font-size: 1.45rem; }
  .account-showcase__copy > p:last-child,
  .account-devices { display: none; }
  .account-panel { padding: 26px 20px 24px; }
  .account-head h2 { font-size: 1.7rem; }
  .account-lede { margin-bottom: 18px; font-size: .88rem; }
  .account-close { top: 14px; right: 14px; width: 38px; height: 38px; }
}

@media (max-height: 690px) and (min-width: 721px) {
  .account-dialog { max-height: 94vh; }
  .account-card { min-height: 520px; }
  .account-panel { padding-block: 38px 30px; }
  .account-showcase__copy h3 { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .account-dialog::backdrop { backdrop-filter: none; }
  .account-dialog[open],
  .account-dialog[open]::backdrop,
  .account-form:not([hidden]),
  .account-signed:not([hidden]) { animation: none; }
  .account-close,
  .account-tabs button,
  .account-form input,
  .account-submit { transition: none; }
}
