/* ================================================================
   CoinMarketCal — Listmonk Public Pages
   Design tokens aligned with token-showcase-v2.html
   ================================================================ */

:root {
  --cmc-primary: #3d89ce;
  --cmc-primary-hover: #345485;
  --cmc-primary-dark: #2e6fa5;
  --cmc-title: #2d4a78;
  --cmc-text-main: #4a5060;
  --cmc-text-secondary: #636a75;
  --cmc-text-disabled: #a0a6b0;
  --cmc-border: #dfe1e5;
  --cmc-border-strong: #a8aeb8;
  --cmc-bg: #f4f5f8;
  --cmc-card-bg: #ffffff;
  --cmc-error: #c5291e;
  --cmc-positive: #1a6e28;
  --cmc-link: #16708f;
  --cmc-link-hover: #147090;
  --cmc-btn-text: #ffffff;
  --cmc-focus-ring: #3d89ce;
  --shadow-hero: 0 4px 20px rgba(45, 74, 120, 0.08);
  --shadow-card: 0 2px 8px rgba(45, 74, 120, 0.06);
  --shadow-card-hover: 0 4px 16px rgba(45, 74, 120, 0.10);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

body.dark {
  --cmc-primary: #3d89ce;
  --cmc-primary-hover: #5ba3e0;
  --cmc-primary-dark: #2d6da0;
  --cmc-title: #f0f2f4;
  --cmc-text-main: #dde0e4;
  --cmc-text-secondary: #9ba0a8;
  --cmc-text-disabled: #5c6370;
  --cmc-border: #405a75;
  --cmc-border-strong: #6585a5;
  --cmc-bg: #1a2537;
  --cmc-card-bg: #22364f;
  --cmc-error: #f87171;
  --cmc-positive: #4ade80;
  --cmc-link: #4abce6;
  --cmc-link-hover: #5cc8ef;
  --cmc-btn-text: #ffffff;
  --cmc-focus-ring: #5ba3e0;
  --shadow-hero: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.30);
}

html.dark-pending { background-color: #1a2537; }
html.dark-pending body { background-color: #1a2537; color: #dde0e4; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--cmc-bg);
  font-family: 'Lato', Arial, Helvetica, sans-serif;
  color: var(--cmc-text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
}

/* ================================================================
   HEADER
   ================================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cmc-link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 6px;
  transition: color 0.2s var(--ease-out-quart);
}
.back-link:hover { color: var(--cmc-link-hover); }
.back-link:focus-visible {
  outline: 2px solid var(--cmc-focus-ring);
  outline-offset: 2px;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cmc-text-secondary);
  cursor: pointer;
  transition: color 0.2s var(--ease-out-quart), background-color 0.2s var(--ease-out-quart);
}
.theme-toggle:hover {
  color: var(--cmc-link);
  background: var(--cmc-border);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--cmc-focus-ring);
  outline-offset: 2px;
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
body.dark .theme-toggle .icon-moon { display: none; }
body.dark .theme-toggle .icon-sun  { display: block; }

/* ================================================================
   HERO SECTION (card container for main content)
   ================================================================ */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
  background: var(--cmc-card-bg);
  padding: 45px 35px 35px 35px;
  border-radius: 12px;
  box-shadow: var(--shadow-hero);
}

.hero-section h2 {
  color: var(--cmc-title);
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.hero-section p {
  font-size: 16px;
  color: var(--cmc-text-main);
  line-height: 1.6;
  margin-bottom: 12px;
}

.hero-section .desc {
  font-size: 18px;
  margin-bottom: 24px;
  color: var(--cmc-text-main);
  line-height: 1.5;
}

.hero-section .subtitle {
  font-size: 14px;
  color: var(--cmc-text-secondary);
  margin-bottom: 20px;
}

/* ================================================================
   SECTION — unsub/manage/optin/message content
   ================================================================ */
section,
.section {
  margin-bottom: 0;
}

section h2,
.section h2 {
  color: var(--cmc-title);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

section h3 {
  color: var(--cmc-title);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 24px;
}

section p,
.section p {
  font-size: 15px;
  color: var(--cmc-text-main);
  line-height: 1.6;
  margin-bottom: 16px;
}

section a,
.hero-section a {
  color: var(--cmc-link);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}
section a:hover,
.hero-section a:hover {
  color: var(--cmc-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Buttons styled as <a> should keep button colors, not link colors */
section a.button,
.hero-section a.button {
  color: var(--cmc-btn-text);
  text-decoration: none;
}
section a.button:hover,
.hero-section a.button:hover {
  color: var(--cmc-btn-text);
  text-decoration: none;
}

/* ================================================================
   FORMS
   ================================================================ */
label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--cmc-title);
  margin-bottom: 6px;
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 2px solid var(--cmc-border-strong);
  background: var(--cmc-card-bg);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--cmc-title);
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s var(--ease-out-quart);
  font-family: inherit;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: var(--cmc-text-disabled);
  font-weight: 400;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--cmc-focus-ring);
}
input[disabled] {
  opacity: 0.5;
}

select {
  width: 100%;
  border: 2px solid var(--cmc-border-strong);
  background: var(--cmc-card-bg);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--cmc-text-main);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out-quart);
}
select:focus {
  border-color: var(--cmc-focus-ring);
}

/* Checkboxes and radios */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--cmc-primary);
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  cursor: pointer;
}

/* Inline checkbox + label pattern */
section p input[type="checkbox"],
.unsub-form p input[type="checkbox"],
.manage-form p input[type="checkbox"],
.data-form .row input[type="radio"] {
  margin-right: 8px;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.button,
button[type="submit"],
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cmc-primary-dark);
  color: var(--cmc-btn-text);
  border: none;
  border-radius: 25px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  min-width: 150px;
  text-decoration: none;
  font-family: inherit;
  transition: background-color 0.2s var(--ease-out-quart), transform 0.1s var(--ease-out-quart);
}
.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background-color: var(--cmc-primary-hover);
  color: var(--cmc-btn-text);
}
.button:active,
button[type="submit"]:active,
input[type="submit"]:active {
  transform: scale(0.97);
}
.button:focus-visible,
button[type="submit"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--cmc-focus-ring);
  outline-offset: 2px;
}

.button.button-outline,
input[type="submit"].button-outline {
  background: transparent;
  border: 2px solid var(--cmc-link);
  color: var(--cmc-link);
}
.button.button-outline:hover,
input[type="submit"].button-outline:hover {
  background: var(--cmc-link);
  color: var(--cmc-btn-text);
}

/* ================================================================
   LISTS (subscription management checkboxes)
   ================================================================ */
.lists,
ul.lists {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}
.lists li {
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--cmc-bg);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--cmc-title);
  display: flex;
  align-items: center;
}
.lists .description {
  margin: 0 0 12px 34px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--cmc-text-secondary);
  font-weight: 400;
}

/* ================================================================
   DATA/PRIVACY FORM
   ================================================================ */
.data-form {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--cmc-border);
}

.data-form section {
  margin-bottom: 0;
}

.data-form .row {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--cmc-bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--cmc-text-main);
  line-height: 1.5;
}
.data-form .row strong {
  color: var(--cmc-title);
}

/* ================================================================
   OPTIN FORM
   ================================================================ */
.optin-form ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.optin-form ul li {
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--cmc-bg);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--cmc-title);
}

/* ================================================================
   SUBSCRIPTION FORM PAGE
   ================================================================ */
.form .nonce {
  display: none;
}
.form .captcha {
  margin-top: 20px;
}

/* ================================================================
   ERROR + SUCCESS MESSAGES
   ================================================================ */
.error {
  color: var(--cmc-error);
  font-weight: 700;
}

/* ================================================================
   ARCHIVE
   ================================================================ */
.archive {
  list-style: none;
  margin: 20px 0;
  padding: 0;
}
.archive li {
  padding: 12px 0;
  border-bottom: 1px solid var(--cmc-border);
}
.archive li:last-child {
  border-bottom: none;
}
.archive .date {
  display: block;
  font-size: 13px;
  color: var(--cmc-text-secondary);
  font-weight: 700;
  margin-bottom: 2px;
}
.archive a {
  color: var(--cmc-link);
  font-weight: 700;
  text-decoration: none;
}
.archive a:hover {
  color: var(--cmc-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.feed {
  margin-right: 12px;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  margin-top: 24px;
  text-align: center;
}
.pg-page {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--cmc-text-secondary);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.pg-page:hover {
  background: var(--cmc-border);
  color: var(--cmc-text-main);
}
.pg-page.pg-selected {
  background: var(--cmc-primary);
  color: var(--cmc-btn-text);
}

/* ================================================================
   LOGIN PAGES
   ================================================================ */
.login .submit {
  margin-top: 20px;
}
.login button {
  width: 100%;
  vertical-align: middle;
  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;
}

/* ================================================================
   HOME OPTIONS
   ================================================================ */
.home-options {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.home-options a {
  color: var(--cmc-link);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.home-options a:hover {
  color: var(--cmc-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ================================================================
   BACK BUTTON (in message pages)
   ================================================================ */
#btn-back {
  display: none;
}

/* ================================================================
   UTILITIES
   ================================================================ */
.center { text-align: center; }
.right { text-align: right; }
.small { font-size: 0.875em; }
.row { margin-bottom: 16px; }

/* ================================================================
   THEME TRANSITIONS
   ================================================================ */
body,
.hero-section,
.back-link,
.theme-toggle,
input[type="text"],
input[type="email"],
input[type="password"],
select,
.lists li,
.data-form .row,
.optin-form ul li {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: var(--ease-out-quart);
}

/* ================================================================
   UNSUB TRANSITION ANIMATIONS
   ================================================================ */
.hero-section.is-hiding {
  animation: fade-out-down 250ms var(--ease-out-quart) forwards;
}
.unsub-success {
  display: none;
}
.unsub-success.is-visible {
  display: block;
  animation: fade-in-up 400ms var(--ease-out-quart) both;
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-out-down {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* Button spinner (inside unsub button) */
.btn-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
}
@keyframes spin { to { transform: rotate(360deg); } }

#btn-unsub {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
   LOGIN PAGE (standalone — light mode only, no shared header/footer)
   Matches token-showcase-v2.html login form design.
   All rules scoped to body.login-page / .login-card to avoid
   any impact on subscription, optin, message, or admin pages.
   ================================================================ */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  background: var(--cmc-bg);
  padding: 20px;
}

.login-card {
  background: var(--cmc-card-bg);
  border-radius: 10px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-hero);
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.login-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cmc-title);
  margin-bottom: 0.5rem;
}

.login-divider {
  border: none;
  border-top: 1px solid var(--cmc-border);
  margin: 0 0 0.75rem;
}

.login-field {
  margin-bottom: 0.85rem;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cmc-title);
  margin-bottom: 0.3rem;
}

body.login-page input[type="text"],
body.login-page input[type="email"],
body.login-page input[type="password"] {
  background: var(--cmc-card-bg);
  border: 1px solid var(--cmc-border);
  border-radius: 100px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  color: var(--cmc-text-main);
  width: 100%;
  outline: none;
  font-weight: 400;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.login-page input[type="text"]::placeholder,
body.login-page input[type="email"]::placeholder,
body.login-page input[type="password"]::placeholder {
  color: var(--cmc-text-disabled);
}
body.login-page input[type="text"]:focus,
body.login-page input[type="email"]:focus,
body.login-page input[type="password"]:focus {
  border-color: var(--cmc-focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cmc-focus-ring) 20%, transparent);
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.login-submit {
  margin-top: 0.75rem;
}

/* body.login-page scope beats base button[type="submit"] (0,1,1) */
body.login-page .login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cmc-primary-dark);
  color: var(--cmc-btn-text);
  border: none;
  border-radius: 100px;
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-width: auto;
  transition: background 0.15s var(--ease-out-quart), transform 0.1s var(--ease-out-quart);
}
body.login-page .login-btn:hover {
  background: var(--cmc-primary-hover);
}
body.login-page .login-btn:active {
  transform: scale(0.97);
}
body.login-page .login-btn:focus-visible {
  outline: 2px solid var(--cmc-focus-ring);
  outline-offset: 2px;
}

body.login-page .login-btn--full {
  width: 100%;
}

body.login-page .login-btn--outline {
  background: transparent;
  border: 2px solid var(--cmc-link);
  color: var(--cmc-link);
  width: 100%;
  gap: 0.5rem;
}
body.login-page .login-btn--outline:hover {
  background: var(--cmc-link);
  color: var(--cmc-btn-text);
}
body.login-page .login-btn--outline img {
  max-width: 24px;
}

.login-link {
  font-size: 0.82rem;
  color: var(--cmc-link);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}
.login-link:hover {
  color: var(--cmc-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-text {
  font-size: 0.82rem;
  color: var(--cmc-text-secondary);
  margin-bottom: 0.75rem;
  text-align: left;
}

.login-error {
  color: var(--cmc-error);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

body.login-page .login-totp {
  font-size: 1.75rem;
  letter-spacing: 0.3rem;
  text-align: center;
  padding: 0.6rem 1rem;
}

.login-oidc {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--cmc-border);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 600px) {
  .hero-section {
    padding: 30px 20px;
    margin-bottom: 30px;
  }
  .hero-section h2 {
    font-size: 24px;
  }
  .login-card {
    padding: 1.25rem 1rem 1.25rem;
  }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
