/* Dedicated account-email surface. The unique filename prevents stale global CSS
   from leaving the server-rendered binding dialog without its layout. */
.email-bind-modal,
.email-bind-modal * {
  box-sizing: border-box;
}

.email-bind-modal {
  position: fixed;
  inset: 0;
  z-index: 100025;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  color: #344b31;
  background:
    radial-gradient(circle at 50% 34%, rgba(232, 247, 202, 0.34), transparent 42%),
    rgba(12, 28, 16, 0.38);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s var(--ease-soft, ease),
    visibility 0.24s var(--ease-soft, ease);
}

.email-bind-modal[hidden] {
  display: none !important;
}

.email-bind-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.email-bind-dialog {
  position: relative;
  isolation: isolate;
  width: min(480px, calc(100vw - 36px));
  max-height: calc(100dvh - 40px);
  padding: 26px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(246, 255, 238, 0.82);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.24) 50%, rgba(232, 200, 122, 0.14)),
    rgba(244, 252, 239, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(52, 95, 45, 0.1),
    0 30px 86px rgba(23, 55, 26, 0.3);
  backdrop-filter: blur(28px) saturate(1.32);
  -webkit-backdrop-filter: blur(28px) saturate(1.32);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity 0.24s var(--ease-soft, ease),
    transform 0.34s var(--ease-soft, ease);
}

.email-bind-dialog::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  right: 0;
  top: -112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 200, 122, 0.18), transparent 70%);
  pointer-events: none;
}

.email-bind-modal.is-open .email-bind-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.email-bind-close,
.email-bind-modal .profile-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(140, 203, 106, 0.36);
  border-radius: 50%;
  color: rgba(49, 95, 43, 0.78);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-family: Arial, sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.22s var(--ease-soft, ease),
    background 0.22s var(--ease-soft, ease),
    transform 0.22s var(--ease-soft, ease);
}

.email-bind-close:hover,
.email-bind-modal .profile-close:hover {
  color: #8b6825;
  background: rgba(255, 250, 230, 0.76);
  transform: rotate(7deg);
}

.email-bind-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-right: 34px;
}

.email-bind-head > div {
  min-width: 0;
}

.email-bind-head img {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(140, 203, 106, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 12px 26px rgba(67, 116, 53, 0.16);
}

.email-bind-head .profile-kicker {
  margin: 0;
  color: #b48a24;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.email-bind-head h2 {
  margin: 4px 0 5px;
  color: #315f2b;
  font-family: "Genshin", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.3;
}

.email-bind-head p:last-child {
  margin: 0;
  color: rgba(47, 74, 43, 0.68);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.email-bind-form {
  min-width: 0;
  display: grid;
  gap: 13px;
}

.email-bind-form[hidden] {
  display: none !important;
}

.email-bind-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: rgba(47, 74, 43, 0.78);
  font-size: 12px;
  font-weight: 600;
}

.email-bind-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid rgba(140, 203, 106, 0.34);
  border-radius: 14px;
  outline: 0;
  color: #274a24;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(52, 95, 45, 0.04);
  font: inherit;
  font-weight: 400;
  transition:
    border-color 0.22s var(--ease-soft, ease),
    box-shadow 0.22s var(--ease-soft, ease),
    background 0.22s var(--ease-soft, ease);
}

.email-bind-form input:focus {
  border-color: rgba(112, 180, 83, 0.72);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(140, 203, 106, 0.14);
}

.email-bind-modal .profile-action {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(246, 255, 238, 0.76);
  border-radius: 999px;
  color: #315f2b;
  background:
    linear-gradient(135deg, rgba(151, 211, 116, 0.68), rgba(232, 200, 122, 0.42)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(53, 91, 45, 0.12),
    0 14px 30px -20px rgba(68, 124, 52, 0.58);
  font-family: "Genshin", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    transform 0.22s var(--ease-soft, ease),
    filter 0.22s var(--ease-soft, ease),
    box-shadow 0.22s var(--ease-soft, ease);
}

.email-bind-modal .profile-action:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 32px -19px rgba(68, 124, 52, 0.66);
}

.email-bind-modal .profile-action:disabled {
  cursor: wait;
  opacity: 0.64;
}

.email-code-destination {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(140, 203, 106, 0.2);
  border-radius: 13px;
  color: rgba(49, 95, 43, 0.82);
  background: rgba(232, 247, 202, 0.42);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.email-change-address,
.email-skip-button {
  appearance: none;
  border: 0;
  color: rgba(49, 95, 43, 0.76);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.email-change-address:hover,
.email-skip-button:hover {
  color: #8b6825;
}

.email-bind-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: #865d29;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.email-bind-status.is-success {
  color: #315f2b;
}

.email-skip-button {
  display: block;
  margin: 8px auto 0;
  padding: 7px 12px;
}

body.email-bind-open {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 560px) {
  .email-bind-modal {
    padding: 14px;
  }

  .email-bind-dialog {
    width: min(100%, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 22px 18px;
    border-radius: 24px;
  }

  .email-bind-head {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding-right: 30px;
  }

  .email-bind-head img {
    width: 58px;
    height: 58px;
  }

  .email-bind-head h2 {
    font-size: 22px;
  }

  .email-bind-close,
  .email-bind-modal .profile-close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .email-bind-modal,
  .email-bind-dialog,
  .email-bind-close,
  .email-bind-modal .profile-close,
  .email-bind-modal .profile-action {
    transition-duration: 0.01ms !important;
  }
}
