:root {
  color-scheme: dark;
  --bg: #090d10;
  --panel: rgba(22, 26, 29, 0.84);
  --line: rgba(255, 255, 255, 0.13);
  --gold: #ffc82e;
  --gold-deep: #f0ae18;
  --text: #f8f8f6;
  --muted: #b9bdc2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.08), transparent 31rem),
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.05), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.preferences-page {
  position: relative;
  width: min(740px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
  overflow: hidden;
}

.preferences-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.54), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.54));
}

.waves {
  position: absolute;
  top: 30px;
  width: 400px;
  height: 430px;
  opacity: 0.58;
  pointer-events: none;
}

.waves-left {
  left: -385px;
  transform: rotate(180deg);
}

.waves-right {
  right: -385px;
}

.brand-header {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6vw, 3.35rem);
  line-height: 1;
}

.brand-header img {
  width: 32px;
  height: 32px;
}

.hero {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(3rem, 8vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero h1 span,
.unsubscribe-link {
  color: var(--gold);
}

.hero p {
  width: min(560px, 100%);
  margin: 0 auto;
  color: #c9ccd1;
  font-size: clamp(1.08rem, 2.6vw, 1.46rem);
  font-weight: 500;
  line-height: 1.35;
}

form,
.unsubscribe-link,
footer {
  position: relative;
  z-index: 1;
}

.panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(31, 35, 38, 0.9), rgba(13, 17, 20, 0.88));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.05);
}

.panel {
  padding: clamp(24px, 4vw, 34px) clamp(22px, 5vw, 36px);
}

.email-panel {
  margin-top: 24px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.heading-icon,
.preference-icon,
.notice span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
}

.heading-icon {
  width: 38px;
  height: 38px;
}

.heading-icon img {
  width: 25px;
  height: 25px;
}

h2 {
  margin: 0;
  font-size: clamp(1.28rem, 3vw, 1.55rem);
}

.panel-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

label:not(.preference-row) {
  display: block;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 58px;
  margin: 0 0 26px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(18, 21, 24, 0.68);
  color: var(--text);
  font: inherit;
  font-size: 1.18rem;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: 3px solid rgba(255, 200, 46, 0.25);
  border-color: rgba(255, 200, 46, 0.74);
}

.info-panel input:last-child {
  margin-bottom: 0;
}

.preference-row {
  display: grid;
  grid-template-columns: 66px 1fr 68px;
  gap: 22px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  cursor: pointer;
}

.preference-row:first-of-type {
  border-top: 0;
}

.preference-icon {
  width: 66px;
  height: 66px;
}

.preference-icon img {
  width: 38px;
  height: 38px;
}

.preference-copy strong,
.preference-copy small {
  display: block;
}

.preference-copy strong {
  margin-bottom: 6px;
  font-size: clamp(1.05rem, 2.3vw, 1.22rem);
}

.preference-copy small {
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.04rem);
  line-height: 1.35;
}

.preference-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle {
  position: relative;
  width: 64px;
  height: 36px;
  border-radius: 999px;
  background: #5d6268;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f9f7ef;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.26);
  transition: transform 160ms ease;
}

.preference-row input:checked + .toggle {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 8px 22px rgba(255, 200, 46, 0.25);
}

.preference-row input:checked + .toggle::after {
  transform: translateX(28px);
}

.notice {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 24px 0 28px;
  padding: 20px 24px;
}

.notice span {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 200, 46, 0.72);
  border-radius: 50%;
}

.notice img {
  width: 32px;
  height: 32px;
}

.notice p {
  margin: 0;
  color: #c9ccd0;
  font-size: 1.02rem;
  line-height: 1.4;
}

.gold-button {
  position: relative;
  width: 100%;
  min-height: 68px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  color: #090c0e;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 14px 30px rgba(255, 200, 46, 0.24);
  cursor: pointer;
  font: inherit;
  font-size: clamp(1.18rem, 2.8vw, 1.42rem);
  font-weight: 850;
}

.gold-button::after {
  content: "";
  position: absolute;
  inset: -35% auto -35% -45%;
  width: 30%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: shine 2.8s ease-in-out infinite;
}

.gold-button:disabled {
  cursor: wait;
  opacity: 0.74;
}

.status {
  min-height: 22px;
  margin: 14px 0 0;
  text-align: center;
  font-weight: 800;
}

.status[data-tone="success"] {
  color: #7fd58e;
}

.status[data-tone="error"] {
  color: #ff9393;
}

.unsubscribe-link {
  display: block;
  width: fit-content;
  margin: 22px auto 36px;
  text-align: center;
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 800;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: #9da1a7;
  font-size: 1.08rem;
}

footer span {
  color: var(--gold);
  font-size: 1.5rem;
}

@keyframes shine {
  0% {
    left: -45%;
  }

  45%,
  100% {
    left: 118%;
  }
}

@media (max-width: 640px) {
  .preferences-page {
    width: min(100% - 22px, 740px);
    padding-top: 22px;
  }

  .preference-row {
    grid-template-columns: 52px 1fr 58px;
    gap: 14px;
  }

  .preference-icon {
    width: 52px;
    height: 52px;
  }

  .preference-icon img {
    width: 31px;
    height: 31px;
  }

  .toggle {
    width: 56px;
    height: 32px;
  }

  .toggle::after {
    width: 24px;
    height: 24px;
  }

  .preference-row input:checked + .toggle::after {
    transform: translateX(24px);
  }

  .notice {
    align-items: flex-start;
    padding-inline: 18px;
  }
}
