/* =====================================================================
   FA Alpha Daily signup, v7 (right rail + mobile bar)
   Scoped to .faad7 and .faad7-bar so nothing else on the page changes.
   Matched to the live faalpha.com article rail, measured Nov 20, 2026:
   Raleway, 350px rail, rail headings 28px / 600 / black,
   1px #ddd separators, pill buttons in #F9933B.
   ===================================================================== */

.faad7,
.faad7-bar {
  --faad7-orange: #F9933B;        /* live button color on faalpha.com */
  --faad7-orange-hover: #E8822A;
  --faad7-btn-text: #FFFFFF;      /* brand rule; set to #000000 for AA contrast */
  --faad7-ink: #000000;
  --faad7-text: #212529;          /* live body text */
  --faad7-muted: #5F6670;
  --faad7-line: #DDDDDD;          /* live rail separator */
  --faad7-field-line: #8C939A;    /* 3.1:1 against white, passes WCAG 1.4.11 */
  --faad7-blue: #044781;          /* live link color */
  --faad7-error: #8A3B00;
  --faad7-free: #A85508;          /* dark orange for small text, 5.3:1 */
  --faad7-top: 135px;             /* keep the sticky signup below the fixed header */
  --faad7-font: Raleway, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--faad7-font);
  color: var(--faad7-text);
}

.faad7 *,
.faad7 *::before,
.faad7 *::after,
.faad7-bar *,
.faad7-bar *::before,
.faad7-bar *::after { box-sizing: border-box; }

.faad7-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Rail section ---------- */

.faad7 {
  display: block;
  margin: 0 0 30px;
  padding: 0 0 30px;
  border-bottom: 1px solid var(--faad7-line);
}

/* Use when the section is the first item in the rail */
.faad7.faad7--first {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 30px;
  border-top: 0;
  border-bottom: 1px solid var(--faad7-line);
}

@media (min-width: 992px) {
  .faad7.faad7--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: var(--faad7-top);
    background: #FFFFFF;
    z-index: 1;
    isolation: isolate;
  }
}

.faad7__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faad7-ink);
}

.faad7__eyebrow b {
  font-weight: 700;
  color: var(--faad7-free);
}

.faad7__title {
  margin: 0 0 8px;
  font-family: var(--faad7-font);
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--faad7-ink);
  letter-spacing: 0;
}

.faad7__lead {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 24px;
  color: var(--faad7-text);
}

/* ---------- Form (shared by rail and bar) ---------- */

.faad7__form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.faad7__hp {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.faad7__input {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 20px;
  font-family: var(--faad7-font);
  font-size: 16px;                 /* 16px stops iOS zooming on focus */
  line-height: 46px;
  color: var(--faad7-ink);
  background: #FFFFFF;
  border: 1px solid var(--faad7-field-line);
  border-radius: 30px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.faad7__input::placeholder { color: var(--faad7-muted); opacity: 1; }

.faad7__input:focus {
  outline: none;
  border-color: var(--faad7-orange);
  box-shadow: 0 0 0 3px rgba(249, 147, 59, 0.3);
}

.faad7__input[aria-invalid="true"] {
  border-color: var(--faad7-error);
  box-shadow: 0 0 0 3px rgba(138, 59, 0, 0.15);
}

.faad7__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 22px;
  font-family: var(--faad7-font);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faad7-btn-text);
  background: var(--faad7-orange);
  border: 0;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.faad7__btn:hover { background: var(--faad7-orange-hover); color: var(--faad7-btn-text); }

.faad7__btn:focus-visible {
  outline: 3px solid var(--faad7-ink);
  outline-offset: 2px;
}

.faad7__btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }

.faad7__msg {
  margin: 2px 0 0;
  min-height: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.faad7__msg:empty { display: none; }
.faad7__msg[data-tone="error"] { color: var(--faad7-error); }
.faad7__msg[data-tone="ok"] { color: var(--faad7-blue); }

.faad7__note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 19px;
  color: var(--faad7-muted);
}

.faad7__note a,
.faad7__done a {
  color: var(--faad7-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Success panel ---------- */

.faad7__done {
  margin: 0;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 22px;
  color: var(--faad7-text);
  background: #F5F7FA;
  border-left: 3px solid var(--faad7-orange);
  border-radius: 6px;
}

.faad7__done strong {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
  color: var(--faad7-ink);
}

.faad7[data-state="done"] .faad7__form,
.faad7[data-state="done"] .faad7__note { display: none; }
.faad7:not([data-state="done"]) .faad7__done { display: none; }

/* ---------- Mobile bar ---------- */

.faad7-bar { display: none; }

@media (max-width: 991.98px) {
  .faad7-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
    background: #FFFFFF;
    border-top: 1px solid var(--faad7-line);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .faad7-bar.is-visible {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faad7-bar,
  .faad7-bar.is-visible { transition: none; }
}

.faad7-bar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.faad7-bar__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--faad7-text);
}

.faad7-bar__text strong {
  display: block;
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--faad7-ink);
}

.faad7-bar__text b { color: var(--faad7-free); font-weight: 700; }

.faad7-bar .faad7__btn.faad7-bar__open {
  flex: 0 0 auto;
  width: auto;
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.faad7-bar__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 -6px 0 0;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--faad7-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.faad7-bar__close:hover { color: var(--faad7-ink); background: #F2F2F2; }
.faad7-bar__close:focus-visible { outline: 3px solid var(--faad7-ink); outline-offset: 0; }

.faad7-bar__form {
  max-width: 720px;
  margin: 10px auto 2px;
  grid-template-columns: 1fr auto;
}

.faad7-bar__form .faad7__btn { width: auto; }
.faad7-bar__form .faad7__msg { grid-column: 1 / -1; }

.faad7-bar[data-state="done"] .faad7-bar__open,
.faad7-bar[data-state="done"] .faad7-bar__form { display: none; }

.faad7-bar[hidden],
.faad7-bar__form[hidden] { display: none !important; }

/* ---------- Elementor form path (Option A in INSTALL.md) ----------
   Give the Elementor Form widget the CSS class "faad7-el" and this block
   restyles its field and button to match the rail card. */

.faad7-el .elementor-form-fields-wrapper { display: grid !important; gap: 10px; margin: 0 !important; }
.faad7-el .elementor-field-group { width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
.faad7-el .elementor-field-type-email input,
.faad7-el input[type="email"] {
  height: 46px !important;
  padding: 0 20px !important;
  font-family: Raleway, sans-serif !important;
  font-size: 16px !important;
  color: #000 !important;
  background: #FFF !important;
  border: 1px solid #8C939A !important;
  border-radius: 30px !important;
}
.faad7-el input[type="email"]:focus { border-color: #F9933B !important; box-shadow: 0 0 0 3px rgba(249, 147, 59, 0.3) !important; outline: none !important; }
.faad7-el .elementor-button {
  width: 100% !important;
  height: 46px !important;
  font-family: Raleway, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #FFF !important;
  background: #F9933B !important;
  border-radius: 30px !important;
}
.faad7-el .elementor-button:hover { background: #E8822A !important; }
