/* ================================================================
   ETERNITY — EDITORIAL FORMS
   Shared design system for every form across the site.
   Loaded after css/style.css. Inherits palette tokens from :root.
   ================================================================ */

:root {
  --ef-ink: #3a322c;
  --ef-ink-soft: #685c55;
  --ef-ink-muted: #8a7f77;
  --ef-cream: #fbf9f6;
  --ef-cream-deep: #f4eee3;
  --ef-rule: #ece4d8;
  --ef-rule-soft: #f0e9dd;
  --ef-gold: #a68d5b;
  --ef-gold-deep: #8b7547;
  --ef-coral: #c97b63;
  --ef-coral-soft: #f4e4de;
  --ef-sage: #8fa688;
  --ef-headline: 'Cormorant Garamond', Georgia, serif;
  --ef-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ef-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ----------------------------------------------------------------
   1. FORM SHELL — the editorial container
   ---------------------------------------------------------------- */
.ef-form {
  font-family: var(--ef-body);
  color: var(--ef-ink);
  max-width: 640px;
  margin: 0 auto;
}

.ef-form__intro {
  text-align: center;
  margin-bottom: 64px;
}

.ef-form__eyebrow {
  font-family: var(--ef-headline);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ef-gold);
  font-weight: 400;
  margin-bottom: 24px;
}

.ef-form__headline {
  font-family: var(--ef-headline);
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  line-height: 1.1;
  font-weight: 300;
  font-style: italic;
  color: var(--ef-ink-soft);
  letter-spacing: -0.01em;
  margin: 0 0 24px 0;
}

.ef-form__quote {
  font-family: var(--ef-headline);
  font-size: 18px;
  line-height: 1.6;
  font-style: italic;
  color: var(--ef-ink-muted);
  max-width: 480px;
  margin: 0 auto 12px;
}

.ef-form__quote-attr {
  font-family: var(--ef-headline);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ef-gold);
}

/* ----------------------------------------------------------------
   2. SECTION DIVIDERS — italic Roman numeral labels
   ---------------------------------------------------------------- */
.ef-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--ef-rule-soft);
}

.ef-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ef-section__label {
  font-family: var(--ef-headline);
  font-size: 13px;
  font-style: italic;
  color: var(--ef-gold);
  letter-spacing: 0.05em;
  margin-bottom: 28px;
  display: block;
}

/* ----------------------------------------------------------------
   3. FIELDS — border-bottom, no boxes, editorial whitespace
   ---------------------------------------------------------------- */
.ef-field {
  position: relative;
  margin-bottom: 36px;
}

.ef-field__label {
  display: block;
  font-family: var(--ef-headline);
  font-size: 14px;
  font-style: italic;
  color: var(--ef-ink-soft);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
  transition: color 0.3s var(--ef-ease);
}

.ef-field__label .ef-required {
  color: var(--ef-gold);
  font-style: normal;
  margin-left: 2px;
}

.ef-field__input,
.ef-field__select,
.ef-field__textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ef-rule);
  padding: 10px 0 14px 0;
  font-family: var(--ef-body);
  font-size: 16px;
  color: var(--ef-ink);
  line-height: 1.5;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.3s var(--ef-ease);
}

.ef-field__textarea {
  resize: vertical;
  min-height: 96px;
  font-family: var(--ef-body);
}

.ef-field__select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23a68d5b' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 28px;
  cursor: pointer;
}

.ef-field__input::placeholder,
.ef-field__textarea::placeholder {
  color: var(--ef-ink-muted);
  opacity: 0.55;
  font-style: italic;
}

.ef-field__input:focus,
.ef-field__select:focus,
.ef-field__textarea:focus {
  outline: none;
  border-bottom-color: var(--ef-gold);
}

.ef-field:focus-within .ef-field__label {
  color: var(--ef-gold);
}

.ef-field__hint {
  display: block;
  font-family: var(--ef-headline);
  font-size: 12px;
  font-style: italic;
  color: var(--ef-ink-muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* Two-column layout on desktop */
.ef-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 720px) {
  .ef-row {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ----------------------------------------------------------------
   4. RADIO PILLS — concern picker / time preference
   ---------------------------------------------------------------- */
.ef-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ef-pill {
  position: relative;
  cursor: pointer;
}

.ef-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ef-pill__face {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--ef-rule);
  border-radius: 999px;
  font-family: var(--ef-headline);
  font-size: 14px;
  font-style: italic;
  color: var(--ef-ink-soft);
  background: transparent;
  transition: all 0.3s var(--ef-ease);
}

.ef-pill:hover .ef-pill__face {
  border-color: var(--ef-gold);
  color: var(--ef-gold);
}

.ef-pill input:checked + .ef-pill__face {
  background: var(--ef-gold);
  border-color: var(--ef-gold);
  color: #ffffff;
}

.ef-pill input:focus-visible + .ef-pill__face {
  outline: 2px solid var(--ef-gold);
  outline-offset: 3px;
}

/* ----------------------------------------------------------------
   5. ERROR STATE — warm coral, never red
   ---------------------------------------------------------------- */
.ef-field.is-error .ef-field__label {
  color: var(--ef-coral);
}

.ef-field.is-error .ef-field__input,
.ef-field.is-error .ef-field__select,
.ef-field.is-error .ef-field__textarea {
  border-bottom-color: var(--ef-coral);
}

.ef-field__error {
  display: none;
  font-family: var(--ef-headline);
  font-size: 12px;
  font-style: italic;
  color: var(--ef-coral);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.ef-field.is-error .ef-field__error {
  display: block;
  animation: ef-fade-up 0.4s var(--ef-ease);
}

@keyframes ef-fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   6. SUBMIT BUTTON — first-person, editorial
   ---------------------------------------------------------------- */
.ef-submit-wrap {
  margin-top: 56px;
  text-align: center;
}

.ef-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 280px;
  padding: 20px 48px;
  background: var(--ef-ink-soft);
  color: #ffffff;
  border: 1px solid var(--ef-ink-soft);
  border-radius: 0;
  font-family: var(--ef-headline);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.15em;
  text-transform: none;
  cursor: pointer;
  transition: all 0.4s var(--ef-ease);
  overflow: hidden;
}

.ef-submit:hover {
  background: var(--ef-gold);
  border-color: var(--ef-gold);
  letter-spacing: 0.2em;
}

.ef-submit:focus-visible {
  outline: 2px solid var(--ef-gold);
  outline-offset: 4px;
}

.ef-submit[disabled] {
  cursor: wait;
  opacity: 0.85;
}

.ef-submit__label { transition: opacity 0.3s var(--ef-ease); }
.ef-submit.is-loading .ef-submit__label { opacity: 0; }

.ef-submit__dots {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ef-submit.is-loading .ef-submit__dots {
  display: flex;
}

.ef-submit__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: ef-dot 1.2s infinite var(--ef-ease);
}
.ef-submit__dots span:nth-child(2) { animation-delay: 0.2s; }
.ef-submit__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ef-dot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.9); }
  30% { opacity: 1; transform: scale(1.15); }
}

.ef-submit__reassure {
  display: block;
  margin-top: 18px;
  font-family: var(--ef-headline);
  font-size: 12px;
  font-style: italic;
  color: var(--ef-ink-muted);
  letter-spacing: 0.03em;
}

/* ----------------------------------------------------------------
   7. SUCCESS STATE — full editorial takeover
   ---------------------------------------------------------------- */
.ef-success {
  display: none;
  text-align: center;
  padding: 40px 0;
  animation: ef-success-in 0.7s var(--ef-ease);
}

.ef-success.is-visible { display: block; }

.ef-form.is-submitted { display: none; }

@keyframes ef-success-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.ef-success__seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 36px;
  border: 1px solid var(--ef-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ef-headline);
  font-size: 28px;
  font-style: italic;
  color: var(--ef-gold);
}

.ef-success__eyebrow {
  font-family: var(--ef-headline);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ef-gold);
  margin-bottom: 24px;
}

.ef-success__headline {
  font-family: var(--ef-headline);
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.75rem);
  line-height: 1.1;
  font-weight: 300;
  font-style: italic;
  color: var(--ef-ink-soft);
  margin: 0 0 32px 0;
}

.ef-success__body {
  max-width: 520px;
  margin: 0 auto 40px;
  font-family: 'Georgia', serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ef-ink-soft);
}

.ef-success__body p { margin: 0 0 18px 0; }
.ef-success__body p:last-child { margin-bottom: 0; }

.ef-success__callback {
  display: inline-block;
  margin: 0 auto 48px;
  padding: 20px 36px;
  background: var(--ef-cream);
  border: 1px solid var(--ef-rule);
}

.ef-success__callback-eyebrow {
  font-family: var(--ef-headline);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ef-gold);
  margin-bottom: 8px;
}

.ef-success__callback-time {
  font-family: var(--ef-headline);
  font-size: 22px;
  font-style: italic;
  color: var(--ef-ink-soft);
}

.ef-success__steps {
  max-width: 480px;
  margin: 0 auto 48px;
  text-align: left;
}

.ef-success__step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--ef-rule-soft);
}

.ef-success__step:last-child { border-bottom: 1px solid var(--ef-rule-soft); }

.ef-success__step-num {
  font-family: var(--ef-headline);
  font-size: 22px;
  font-style: italic;
  color: var(--ef-gold);
  flex-shrink: 0;
  line-height: 1.2;
}

.ef-success__step-text {
  font-family: 'Georgia', serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ef-ink-soft);
}

.ef-success__step-text strong {
  font-weight: 400;
  color: var(--ef-ink);
}

.ef-success__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.ef-success__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-family: var(--ef-headline);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.15em;
  text-decoration: none;
  border: 1px solid var(--ef-ink-soft);
  color: var(--ef-ink-soft);
  background: transparent;
  transition: all 0.4s var(--ef-ease);
  cursor: pointer;
}

.ef-success__btn:hover {
  background: var(--ef-ink-soft);
  color: #ffffff;
  letter-spacing: 0.2em;
}

.ef-success__btn--filled {
  background: var(--ef-ink-soft);
  color: #ffffff;
}

.ef-success__btn--filled:hover {
  background: var(--ef-gold);
  border-color: var(--ef-gold);
}

.ef-success__signature {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--ef-rule-soft);
  font-family: var(--ef-headline);
}

.ef-success__signature-from {
  font-size: 14px;
  font-style: italic;
  color: var(--ef-ink-muted);
  margin-bottom: 6px;
}

.ef-success__signature-name {
  font-size: 26px;
  font-style: italic;
  color: var(--ef-ink-soft);
  margin-bottom: 8px;
}

.ef-success__signature-credential {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ef-gold);
}

/* ----------------------------------------------------------------
   8. NETWORK ERROR BANNER
   ---------------------------------------------------------------- */
.ef-banner {
  display: none;
  margin: 0 0 32px 0;
  padding: 18px 24px;
  background: var(--ef-coral-soft);
  border-left: 3px solid var(--ef-coral);
  font-family: var(--ef-headline);
  font-size: 14px;
  font-style: italic;
  color: var(--ef-ink-soft);
  line-height: 1.6;
  animation: ef-fade-up 0.4s var(--ef-ease);
}

.ef-banner.is-visible { display: block; }

.ef-banner a {
  color: var(--ef-coral);
  text-decoration: underline;
}

/* ----------------------------------------------------------------
   9. RETENTION TOAST — "Welcome back"
   ---------------------------------------------------------------- */
.ef-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  max-width: 340px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid var(--ef-rule);
  box-shadow: 0 20px 40px rgba(96, 84, 77, 0.08);
  font-family: var(--ef-body);
  transform: translateY(140%);
  opacity: 0;
  transition: all 0.6s var(--ef-ease);
}

.ef-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.ef-toast__eyebrow {
  font-family: var(--ef-headline);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ef-gold);
  margin-bottom: 6px;
}

.ef-toast__msg {
  font-family: var(--ef-headline);
  font-size: 17px;
  font-style: italic;
  color: var(--ef-ink-soft);
  line-height: 1.4;
  margin: 0;
}

.ef-toast__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--ef-ink-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ----------------------------------------------------------------
   10. NEWSLETTER COMPACT VARIANT — for blog footer
   ---------------------------------------------------------------- */
.ef-form--inline {
  max-width: 480px;
}

.ef-form--inline .ef-row-inline {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ef-rule);
}

.ef-form--inline .ef-row-inline input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 0;
  font-family: var(--ef-body);
  font-size: 15px;
  color: var(--ef-ink);
}

.ef-form--inline .ef-row-inline input:focus { outline: none; }

.ef-form--inline .ef-row-inline button {
  background: none;
  border: none;
  padding: 0 8px;
  font-family: var(--ef-headline);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.15em;
  color: var(--ef-gold);
  cursor: pointer;
  text-transform: none;
  transition: color 0.3s var(--ef-ease);
}

.ef-form--inline .ef-row-inline button:hover { color: var(--ef-gold-deep); }

.ef-form--inline:focus-within .ef-row-inline { border-bottom-color: var(--ef-gold); }

/* ----------------------------------------------------------------
   11. PATHWAY MICRO-FORM — embedded in skin-concerns panels
   ---------------------------------------------------------------- */
.ef-form--pathway {
  max-width: 100%;
  padding: 32px;
  background: var(--ef-cream);
  border: 1px solid var(--ef-rule);
}

.ef-form--pathway .ef-form__headline {
  font-size: 24px;
  margin-bottom: 8px;
}

.ef-form--pathway .ef-form__quote {
  font-size: 14px;
  margin-bottom: 24px;
}

.ef-form--pathway .ef-field { margin-bottom: 24px; }
.ef-form--pathway .ef-submit-wrap { margin-top: 32px; }
.ef-form--pathway .ef-submit { min-width: 240px; padding: 16px 36px; }

/* ----------------------------------------------------------------
   12. REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ef-success,
  .ef-banner,
  .ef-toast,
  .ef-field__error {
    animation: none !important;
    transition: none !important;
  }
  .ef-submit__dots span { animation: none; opacity: 0.7; }
}
