:root {
  --page-bg: #f4f0e8;
  --ink: #172126;
  --muted: #5d666f;
  --border: rgba(23, 33, 38, 0.1);
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: #fffdf8;
  --primary: #c65d2e;
  --primary-dark: #8f3713;
  --accent: #0d5d56;
  --shadow: 0 24px 70px rgba(44, 35, 24, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  min-width: 320px;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(198, 93, 46, 0.18), transparent 28rem),
    radial-gradient(circle at top right, rgba(13, 93, 86, 0.14), transparent 26rem),
    linear-gradient(180deg, #f8f4ec 0%, #efe7d9 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Avenir Next", "Inter", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(13, 93, 86, 0.22);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration-color: rgba(143, 55, 19, 0.28);
}

label {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-family: "Georgia", "Iowan Old Style", serif;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1rem;
}

section {
  position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font: inherit;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(198, 93, 46, 0.62);
  box-shadow: 0 0 0 4px rgba(198, 93, 46, 0.1);
  background: #fff;
}

input:focus::placeholder {
  color: transparent;
}

input[disabled] {
  opacity: 0.55;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

.phone-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
  max-width: 420px;
  margin-top: -10px;
}

.phone-prefix {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(247, 242, 233, 0.95);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.phone-prefix[disabled] {
  opacity: 1;
  color: var(--ink);
}

.phone-display {
  letter-spacing: 0.01em;
  width: 100%;
}

.manage-grid {
  align-items: start;
}

.manage-grid p {
  margin: 0;
}

.manage-grid .lists.full {
  margin-top: 0;
}

.manage-grid .phone-row {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}

.manage-grid .phone-row > label {
  margin: 0;
}

.manage-grid .phone-row .phone-field {
  max-width: none;
}

.manage-grid .subscriptions-heading {
  margin: 4px 0 0;
}

.manage-grid .subscriptions-heading h3 {
  margin: 0;
}

.manage-grid .actions-row {
  margin-top: 4px;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.small {
  font-size: 0.875em;
}

.error {
  color: #b63f11;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, #d57b49 100%);
  box-shadow: 0 16px 32px rgba(198, 93, 46, 0.24);
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(143, 55, 19, 0.26);
  color: #fff;
}

.button.button-outline {
  background: transparent;
  border: 1px solid rgba(13, 93, 86, 0.22);
  box-shadow: none;
  color: var(--accent);
}

.button.button-outline:hover {
  background: rgba(13, 93, 86, 0.08);
  color: var(--primary-dark);
  border-color: rgba(143, 55, 19, 0.18);
}

.container {
  width: min(100% - 32px, 760px);
  margin: 42px auto 18px;
}

body > .container.wrap:first-of-type {
  margin-top: max(28px, min(7vh, 56px));
}

.wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 42px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: linear-gradient(90deg, var(--accent), var(--primary), #e8b04b);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  margin-bottom: 30px;
}

.header .logo img {
  width: auto;
  max-width: 168px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card,
.panel-card,
.message-card,
.archive-card,
.home-hero,
.manage-form,
.unsub-form,
.data-form section,
.optin-form,
.subscription-form-card {
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  padding: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.home-hero {
  text-align: center;
  padding: 42px 32px;
}

.home-hero p {
  width: min(100%, 480px);
  margin: 0 auto 1.35rem;
  color: var(--muted);
}

.home-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.section {
  margin-bottom: 28px;
}

.row {
  margin-bottom: 18px;
}

.form p,
.manage-form p,
.unsub-form p {
  margin-bottom: 16px;
}

.form .nonce {
  display: none;
}

.form .captcha {
  margin-top: 30px;
}

.lists {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.manage-form .lists {
  margin-top: 0;
}

.lists li {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.manage-form .lists li:last-child {
  margin-bottom: 0;
}

.lists .description {
  margin: 8px 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.archive {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.archive li {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(23, 33, 38, 0.08);
}

.archive .date {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.archive-actions,
.home-options {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.feed {
  margin-right: 6px;
  vertical-align: middle;
}

.pagination {
  margin-top: 28px;
  text-align: center;
}

.pg-page {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
}

.pg-page.pg-selected {
  background: rgba(13, 93, 86, 0.12);
  font-weight: 700;
}

.login .submit {
  margin-top: 22px;
}

.login button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login button img {
  max-width: 24px;
  margin-right: 10px;
}

.login input[name=totp_code] {
  font-size: 2em;
  letter-spacing: 5px;
  text-align: center;
}

.setup-grid,
.manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setup-grid .full,
.manage-grid .full {
  grid-column: 1 / -1;
}

.message-card {
  text-align: center;
}

.message-text {
  color: var(--muted);
}

#btn-back {
  display: none;
}

footer.container {
  margin: 22px auto 34px;
  text-align: center;
  color: rgba(23, 33, 38, 0.48);
  font-size: 0.78rem;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  flex: 0 0 auto;
}

footer.container {
  margin-top: auto;
  padding-bottom: 24px;
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
}

@media screen and (max-width: 640px) {
  .wrap {
    padding: 30px 22px;
    border-radius: 22px;
  }

  .container {
    width: min(100% - 20px, 760px);
    margin-top: 22px;
  }

  .setup-grid,
  .manage-grid {
    grid-template-columns: 1fr;
  }

  .manage-grid .phone-row {
    grid-template-columns: 1fr;
    row-gap: 8px;
    align-items: start;
  }

  .phone-field {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .home-hero,
  .hero-card,
  .panel-card,
  .message-card,
  .archive-card,
  .manage-form,
  .unsub-form,
  .data-form section,
  .optin-form,
  .subscription-form-card {
    padding: 22px 18px;
  }
}
