:root {
  color-scheme: light;
  --ink: #20211f;
  --muted: #777972;
  --line: #e5e6e2;
  --paper: #ffffff;
  --canvas: #f7f7f5;
  --accent: #20211f;
  --error: #ba3935;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button, input { font: inherit; }

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.unsubscribe-card {
  width: min(100%, 400px);
  padding: 34px 32px 27px;
  border: 1px solid #e9eae6;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(34, 35, 31, .045);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #555750;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .035em;
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #dedfd9;
  border-radius: 6px;
  color: #50524b;
  font-family: Georgia, serif;
  font-size: 12px;
}

.brand-divider { color: #c1c2bc; font-weight: 400; }

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: .01em;
}

.subtitle {
  margin: 8px 0 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

#unsubscribe-form label {
  display: block;
  margin-bottom: 8px;
  color: #454740;
  font-size: 12px;
  font-weight: 600;
}

#email-address {
  display: block;
  width: 100%;
  height: 45px;
  padding: 0 12px;
  border: 1px solid #d9dad5;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#email-address::placeholder { color: #b0b1ab; }
#email-address:hover { border-color: #b8b9b3; }
#email-address:focus { border-color: #60615c; box-shadow: 0 0 0 3px rgba(32, 33, 31, .08); }
#email-address[aria-invalid="true"] { border-color: var(--error); }
#email-address[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(186, 57, 53, .1); }

.error-message {
  margin: 7px 0 0;
  color: var(--error);
  font-size: 11px;
  line-height: 1.5;
}

.error-message[hidden] { display: none; }

#submit-button, #dialog-close {
  display: inline-flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

#submit-button { margin-top: 21px; }
#submit-button[aria-busy="true"] { cursor: wait; opacity: .82; }
#submit-button[aria-busy="true"]::after {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: button-spin .7s linear infinite;
}
#submit-button:disabled { cursor: wait; }
#submit-button:hover, #dialog-close:hover { background: #3b3c39; }
#submit-button:active, #dialog-close:active { transform: translateY(1px); }
#submit-button:focus-visible, #dialog-close:focus-visible { outline: 3px solid #b9bab3; outline-offset: 3px; }

.footer-note {
  margin: 20px 0 0;
  padding-top: 17px;
  border-top: 1px solid #eeeeeb;
  color: #969891;
  font-size: 10px;
  line-height: 1.6;
}

.confirmation-dialog {
  width: min(calc(100% - 32px), 360px);
  max-width: 360px;
  padding: 27px 27px 24px;
  border: 1px solid rgba(32, 33, 31, .08);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 16, 14, .2);
}

.confirmation-dialog[open] { animation: dialog-in .16s ease-out; }
.confirmation-dialog::backdrop { background: rgba(24, 25, 22, .32); backdrop-filter: blur(2px); }

.dialog-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 17px;
  place-items: center;
  border: 1px solid #e6e7e2;
  border-radius: 50%;
  color: #565852;
  background: #f8f8f6;
}
.dialog-icon svg { width: 20px; height: 20px; }
.confirmation-dialog h2 { margin: 0 0 9px; font-size: 16px; font-weight: 650; }
.confirmation-dialog p { margin: 0; color: #696b64; font-size: 12px; line-height: 1.75; }
#dialog-close { margin-top: 21px; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(5px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .page-shell { padding: 18px; }
  .unsubscribe-card { padding: 29px 22px 23px; }
  .brand-row { margin-bottom: 24px; }
  h1 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
