/*
 * Wealthy & Wise: design tokens + shared components (signup form, pop-up, links).
 * Loaded on the site and inside the block editor.
 */
:root {
  --ww-paper: #f9f7f2;
  --ww-ink: #151412;
  --ww-footer: #121110;
  --ww-rule: #dcd8cf;
  --ww-muted: #4a4742;
  --ww-body: #2c2a27;
  --ww-footer-link: #8d8a84;
  --ww-placeholder: #6f6c66;
  --ww-accent: #8a3b2a;
  --ww-error: #8a2c1f;
  --ww-card: #ffffff;
  --ww-scrim: rgba(18, 17, 16, .55);
  --ww-display: 'Libre Caslon Display', Georgia, serif;
  --ww-sans: 'Figtree', system-ui, sans-serif;
}

.ww-block {
  font-family: var(--ww-sans);
  color: var(--ww-ink);
  -webkit-font-smoothing: antialiased;
}

.ww-block,
.ww-block *,
.ww-block *::before,
.ww-block *::after {
  box-sizing: border-box;
}

.ww-block a {
  color: inherit;
  text-decoration: none;
}

/* Elements toggled with the hidden attribute must stay hidden even when a class sets display. */
.ww-block [hidden],
.ww-block[hidden] {
  display: none !important;
}

.ww-block .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ww-block :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Underlined text link ("Go to homepage →") */
.ww-text-link {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ww-ink);
  border-bottom: 1.5px solid var(--ww-ink);
  padding-bottom: 2px;
  transition: opacity .2s;
}

.ww-text-link:hover {
  opacity: .65;
}

/* Black pill button ("Share with a friend") */
.ww-pill {
  font-family: var(--ww-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--ww-paper);
  background: var(--ww-ink);
  border: 1.5px solid var(--ww-ink);
  border-radius: 999px;
  padding: 13px 32px;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.ww-pill:hover {
  background: transparent;
  color: var(--ww-ink);
}

/* ---------- Signup form ---------- */
.ww-signup__row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1.5px solid var(--ww-ink);
  padding: 18px 0;
  transition: box-shadow .2s;
}

/* The underline thickens while the field has focus (the input itself has no outline). */
.ww-signup__row:focus-within {
  box-shadow: 0 1.5px 0 var(--ww-ink);
}

.ww-signup__input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--ww-sans);
  font-size: clamp(17px, 1.65vw, 20px);
  color: var(--ww-ink);
  padding: 4px 0;
  -webkit-appearance: none;
  appearance: none;
}

/* Keep the field transparent when the browser autofills it (no blue/yellow box). */
.ww-signup__input:-webkit-autofill,
.ww-signup__input:-webkit-autofill:hover,
.ww-signup__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ww-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--ww-paper) inset;
  box-shadow: 0 0 0 1000px var(--ww-paper) inset;
  caret-color: var(--ww-ink);
  transition: background-color 9999s ease-out 0s;
}

.ww-signup__input::placeholder {
  color: var(--ww-placeholder);
  opacity: 1;
}

.ww-block .ww-signup__input:focus,
.ww-block .ww-signup__input:focus-visible {
  outline: none;
}

.ww-signup__submit {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  font-family: var(--ww-sans);
  font-size: clamp(17px, 1.65vw, 20px);
  font-weight: 600;
  color: var(--ww-ink);
  cursor: pointer;
  padding: 4px 24px 4px 8px;
  transition: opacity .2s;
}

.ww-signup__submit:hover {
  opacity: .65;
}

.ww-signup__submit:disabled {
  opacity: .5;
  cursor: progress;
}

.ww-signup__error {
  font-size: 14px;
  color: var(--ww-error);
  margin: 10px 0 0;
}

.ww-signup__disclaimer {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ww-muted);
  margin: 14px 0 0;
  text-wrap: pretty;
}

/* Honeypot: invisible to people, bots fill it in. */
.ww-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ww-signup-done {
  border-bottom: 1.5px solid var(--ww-ink);
  padding: 18px 0;
}

.ww-signup-done__title {
  font-family: var(--ww-display);
  font-size: clamp(24px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  margin: 0;
}

.ww-signup-done__text {
  font-size: 16px;
  color: var(--ww-muted);
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}

/* ---------- Confirmation pop-up ---------- */
.ww-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--ww-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ww-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--ww-paper);
  color: var(--ww-ink);
  padding: clamp(36px, 5vw, 56px) clamp(24px, 5vw, 52px) clamp(32px, 4.5vw, 44px);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

.ww-modal__dialog:focus {
  outline: none;
}

.ww-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-family: var(--ww-sans);
  font-size: 26px;
  line-height: 1;
  color: var(--ww-ink);
  cursor: pointer;
  transition: opacity .2s;
}

.ww-modal__close:hover {
  opacity: .6;
}

.ww-modal__logo {
  width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.ww-modal__rule {
  height: 1px;
  background: var(--ww-ink);
  margin: 22px 0 28px;
}

.ww-modal__title {
  font-family: var(--ww-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

.ww-modal__text {
  font-size: 17px;
  line-height: 1.5;
  margin: 16px auto 0;
  max-width: 380px;
  text-wrap: pretty;
}

.ww-modal__text strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ww-modal__help {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ww-muted);
  margin: 10px auto 0;
  max-width: 380px;
  text-wrap: pretty;
}

.ww-modal .ww-pill {
  margin-top: 30px;
}

@media (prefers-reduced-motion: reduce) {
  .ww-block *,
  .ww-block *::before,
  .ww-block *::after {
    transition: none !important;
  }
}
