.agreement-open {
  overflow: hidden;
}

.agreement-dialog {
  width: min(920px, calc(100vw - 24px));
  max-width: 920px;
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #eef4ff;
}

.agreement-dialog::backdrop {
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(12px);
}

.agreement-dialog-card {
  position: relative;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(91, 140, 255, .26);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 0%, rgba(91, 140, 255, .22), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(0, 209, 255, .13), transparent 30%),
    linear-gradient(145deg, rgba(8, 13, 30, .98), rgba(15, 23, 42, .96));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48), 0 0 40px rgba(91, 140, 255, .14);
}

.agreement-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .075);
  color: #e5e7eb;
  font-size: 22px;
  cursor: pointer;
}

.agreement-dialog-body {
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: clamp(18px, 3vw, 30px);
}

.agreement-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 209, 255, .28);
  border-radius: 999px;
  background: rgba(0, 209, 255, .08);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 900;
}

.agreement-dialog h2,
.agreement-document h1 {
  margin: 0;
  max-width: 820px;
  color: #fff;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.agreement-subtitle {
  margin: 8px 0 0;
  color: #c7d2fe;
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 850;
}

.agreement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.agreement-meta span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(91, 140, 255, .22);
  border-radius: 999px;
  background: rgba(91, 140, 255, .09);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 850;
}

.agreement-lead {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.agreement-lead p,
.agreement-section p {
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.72;
}

.agreement-dialog-content,
.agreement-document {
  display: grid;
  gap: 18px;
}

.agreement-dialog-content {
  margin-top: 22px;
}

.agreement-section {
  scroll-margin-top: 110px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
}

.agreement-section h2,
.agreement-section h3 {
  margin: 0 0 12px;
  color: #f8fbff;
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.18;
  letter-spacing: 0;
}

.agreement-section p + p {
  margin-top: 9px;
}

.agreement-bullet {
  position: relative;
  padding-left: 20px;
}

.agreement-bullet::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .7em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #67e8f9;
  box-shadow: 0 0 14px rgba(103, 232, 249, .45);
}

.agreement-dialog-actions {
  position: sticky;
  bottom: -30px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 22px -30px -30px;
  padding: 14px 30px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 13, 30, .94);
  backdrop-filter: blur(12px);
}

.agreement-page-body {
  min-height: 100vh;
}

.agreement-page-shell {
  min-height: 100vh;
}

.agreement-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  padding-top: 124px;
  padding-bottom: 56px;
}

.agreement-toc {
  position: sticky;
  top: 104px;
}

.agreement-toc-inner {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 126px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(91, 140, 255, .22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(91, 140, 255, .16), transparent 38%),
    rgba(5, 9, 22, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 20px 60px rgba(0, 0, 0, .22);
}

.agreement-toc b {
  color: #fff;
  font-size: 17px;
}

.agreement-toc nav {
  display: grid;
  gap: 6px;
}

.agreement-toc a {
  display: block;
  padding: 9px 10px;
  border-radius: 12px;
  color: #c7d2fe;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}

.agreement-toc a:hover {
  background: rgba(91, 140, 255, .12);
  color: #fff;
}

.agreement-document {
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid rgba(91, 140, 255, .22);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 0%, rgba(91, 140, 255, .18), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .032));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .30), inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.user-agreement-link,
.profile-payment-agreement a {
  color: #93c5fd;
  text-decoration: none;
  border-bottom: 1px solid rgba(147, 197, 253, .48);
}

.user-agreement-link:hover,
.profile-payment-agreement a:hover {
  color: #e0f2fe;
  border-bottom-color: rgba(224, 242, 254, .8);
}

.profile-payment-agreement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: min(620px, 100%);
  padding: 12px 14px;
  border: 1px solid rgba(91, 140, 255, .22);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.profile-payment-agreement input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #5b8cff;
  cursor: pointer;
}

.profile-payment-agreement label {
  cursor: pointer;
}

@media (max-width: 900px) {
  .agreement-layout {
    grid-template-columns: 1fr;
    padding-top: 106px;
  }

  .agreement-toc {
    position: static;
  }

  .agreement-toc-inner {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .agreement-dialog {
    width: min(100vw - 12px, 100%);
    max-height: calc(100vh - 12px);
  }

  .agreement-dialog-card,
  .agreement-document,
  .agreement-toc-inner {
    border-radius: 18px;
  }

  .agreement-dialog-body {
    max-height: calc(100vh - 12px);
    padding: 16px;
  }

  .agreement-section {
    padding: 14px;
    border-radius: 16px;
  }

  .agreement-dialog-actions {
    margin: 18px -16px -16px;
    padding: 12px 16px;
    flex-direction: column;
  }

  .agreement-dialog-actions .btn {
    width: 100%;
  }
}
