/* ========================================
   Juice Mailer — Frontend Form Styles
   Scoped to: .juice-contact-form[data-juice-form^="mailer"]
   ======================================== */

/* Slimmer form (footer-friendly)
   - Use CSS var to tune per layout if needed:
     --juice-mailer-max-width: 480px;
*/

/* Apply the "mailer" base layout to BOTH:
   - data-juice-form="mailer"
   - data-juice-form="mailer-unsub"
*/
.juice-contact-form[data-juice-form="mailer"],
.juice-contact-form[data-juice-form="mailer-unsub"]{
  --juice-mailer-max-width: 450px;

  /* Micro nudge for field error row (visual only; no layout shift) */
  --juice-field-error-nudge: 3px;

  font-family: 'Inter', sans-serif;
  width: 100% !important;
  max-width: var(--juice-mailer-max-width) !important;
  padding: 0 !important;
  margin: 0 !important;
}

@media (min-width: 1024px){
  .juice-contact-form[data-juice-form="mailer"],
  .juice-contact-form[data-juice-form="mailer-unsub"]{
    --juice-mailer-max-width: 420px;
  }
}

.juice-contact-form[data-juice-form="mailer"] .juice-contact-form__inner,
.juice-contact-form[data-juice-form="mailer-unsub"] .juice-contact-form__inner{
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

/* ---------------------------------------------------------
   Field wrapper (slimmer)
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap{
  position: relative;
  margin-bottom: 10px;
  padding-bottom: 16px;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap br{
  display: none !important;
}
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap p:empty{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------------------------------------------------------
   Inputs / textarea
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input,
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;

  font-size: 14px;
  font-weight: 400;
  line-height: 20px;

  padding-top: 10px;
  padding-bottom: 6px;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  border-radius: 0;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap.is-textarea textarea{
  resize: vertical;
  min-height: 92px;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input::placeholder,
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea::placeholder{
  opacity: 0;
}
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input::-webkit-input-placeholder,
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea::-webkit-input-placeholder{
  opacity: 0;
}

/* ---------------------------------------------------------
   Floating label (slower + elegant easing)
   --------------------------------------------------------- */
body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap label{
  position: absolute;
  left: 0;
  top: 8px;
  transform-origin: left center;

  color: #fff;
  opacity: 1;

  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;

  pointer-events: none;

  transition: transform 980ms cubic-bezier(0.16, 1, 0.3, 1),
              top 980ms cubic-bezier(0.16, 1, 0.3, 1),
              font-size 980ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 980ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap.is-active label,
body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap:focus-within label,
body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input:not(:placeholder-shown) ~ label,
body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea:not(:placeholder-shown) ~ label{
  top: -8px !important;
  font-size: 9px !important;
  transform: scale(0.85) !important;
}

/* ---------------------------------------------------------
   Underlines (slower focus expansion)
   --------------------------------------------------------- */
body .juice-contact-form[data-juice-form^="mailer"] .juice-underline-static,
body .juice-contact-form[data-juice-form^="mailer"] .juice-underline-animated{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 1px;
  margin: 0 !important;
}

body .juice-contact-form[data-juice-form^="mailer"] .juice-underline-static{
  width: 100%;
  background: rgba(255, 255, 255, 0.28);
}

body .juice-contact-form[data-juice-form^="mailer"] .juice-underline-animated{
  left: 50%;
  right: auto;
  width: 0;
  background: #fff;
  transform: translateX(-50%);
  transition: width 820ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap:focus-within .juice-underline-animated{
  width: 100% !important;
}

/* ---------------------------------------------------------
   Field errors
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form^="mailer"] .juice-field-error{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  align-items: center;
  gap: 6px;

  min-height: 16px;
  margin: 0 !important;

  color: #c41e3a;
  font-size: 12px;
  font-weight: 400;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);

  transition: opacity 300ms ease,
              transform 300ms ease,
              visibility 300ms;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-field-error.is-visible{
  opacity: 1;
  visibility: visible;

  /* Micro nudge down (visual only; no layout shift) */
  transform: translateY(var(--juice-field-error-nudge, 2px));
}

.juice-contact-form[data-juice-form^="mailer"] .juice-field-error svg{
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------
   Turnstile wrapper (mailer only; unsubscribe has none)
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form="mailer"] .juice-turnstile-wrap{
  margin-top: 8px;
  margin-bottom: 0;
  min-height: 72px;
  max-width: none !important;
}

.juice-contact-form[data-juice-form="mailer"] .juice-turnstile{
  display: block;
  width: 100%;
  min-height: 70px;
  overflow: visible;
  contain: none;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------
   Newsletter opt-in (mailer only; unsubscribe has none)
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form="mailer"] .juice-optin-wrap{
  margin-top: 8px;
  margin-bottom: 14px;
  max-width: none !important;
}

.juice-contact-form[data-juice-form="mailer"] .juice-optin{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;

  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #fff; /* force pure white */
}

.juice-contact-form[data-juice-form^="mailer"] .juice-optin input[type="checkbox"]{
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin: 3px 0 0 0;

  appearance: none;
  -webkit-appearance: none;

  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 2px;
  background: transparent;

  cursor: pointer;

  transition: border-color 240ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.juice-contact-form[data-juice-form^="mailer"] .juice-optin input[type="checkbox"]:checked{
  border-color: rgba(255, 255, 255, 0.95);
  transform: scale(1.02);

  background-repeat: no-repeat;
  background-position: center;
  background-size: 9px 9px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2.2 6.2 4.8 8.8 9.8 3.6' fill='none' stroke='rgba(255,255,255,0.95)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.juice-contact-form[data-juice-form="mailer"] .juice-optin input[type="checkbox"]:focus-visible{
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10);
}

.juice-contact-form[data-juice-form="mailer"] .juice-optin span{
  display: block;
  line-height: 1.35;
  padding-left: 0 !important;
  color: #fff; /* force pure white */
}

.juice-contact-form[data-juice-form="mailer"] .juice-optin-help{
  margin: 6px 0 0 23px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #fff; /* force pure white */
  line-height: 1.35;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  body .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap label,
  body .juice-contact-form[data-juice-form^="mailer"] .juice-underline-animated{
    transition: none !important;
  }

  .juice-contact-form[data-juice-form="mailer"] .juice-optin input[type="checkbox"]{
    transition: none !important;
  }
}

/* ---------------------------------------------------------
   Submit button (keep clean, slightly slimmer)
   --------------------------------------------------------- */
.juice-contact-form[data-juice-form^="mailer"] .juice-submit{
  display: block;
  width: 100%;
  max-width: none !important;
  margin: 0;

  background: transparent;
  color: #fff;

  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 11px 28px;

  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;

  cursor: pointer;

  transition: background-color 300ms ease,
              color 300ms ease,
              border-color 300ms ease;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-submit:hover{
  background: #fff;
  color: #000;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-submit:disabled,
.juice-contact-form[data-juice-form^="mailer"] .juice-submit.is-loading{
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------------------------------------------------
   Toast (NOT scoped on purpose — appended to <body>)
   --------------------------------------------------------- */
.juice-toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);

  background: #fff;
  color: #1a1a2e;

  padding: 16px 24px;
  border-radius: 8px;

  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;

  z-index: 99999;
  max-width: min(92vw, 520px);
  text-align: center;

  opacity: 0;
  visibility: hidden;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 300ms;
}

.juice-toast.is-visible{
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.juice-toast[data-error="1"]{
  background: #c41e3a;
  color: #fff;
}

/* ✅ Mobile-only: hide ONLY error toasts (success/info toasts still show) */
@media (max-width: 781px){
  .juice-toast[data-error="1"]{
    display: none !important;
  }
}

/* ---------------------------------------------------------
   Autofill + iOS zoom prevention
   --------------------------------------------------------- */
@keyframes juiceAutofill { from { opacity: 1; } to { opacity: 1; } }

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input:-webkit-autofill{
  animation-name: juiceAutofill;
  animation-duration: 0.01s;

  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px #000 inset !important;
  box-shadow: 0 0 0px 1000px #000 inset !important;
  background-color: #000 !important;
  caret-color: #fff !important;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input,
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea{
  font-size: 16px !important;
}

@media (min-width: 768px){
  .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap input,
  .juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap textarea{
    font-size: 14px !important;
  }
}

/* Textarea underline alignment */
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap.is-textarea{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap.is-textarea .juice-underline-static,
.juice-contact-form[data-juice-form^="mailer"] .juice-input-wrap.is-textarea .juice-underline-animated{
  bottom: 0 !important;
}



/* ---------------------------------------------------------
   Unsubscribe page visibility (page-id-4371)
   --------------------------------------------------------- */

/* Extra breathing room below header + hero bar */
body.page-id-4371 main{
  padding-top: calc(var(--juice-content-offset, 0px) + 28px) !important;
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"]{
  margin-inline: auto !important;

  /* Push the form down a bit so it's not cramped under the black bar */
  margin-top: clamp(18px, 2.8vw, 34px) !important;
}

/* Make unsubscribe page text black */
body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-input-wrap input,
body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-input-wrap textarea{
  color: #000;
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-input-wrap label{
  color: #000;
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-underline-static{
  background: rgba(0, 0, 0, 0.22);
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-underline-animated{
  background: #000;
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-submit{
  color: #000;
  border-color: rgba(0, 0, 0, 0.35);
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-submit:hover{
  background: #000;
  color: #fff;
}

/* STATUS MESSAGE (the “invalid link / success” line) */
body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-form-status{
  margin-top: 12px;
  text-align: center;

  font-size: 11px;
  line-height: 1.35;

  text-transform: uppercase;
  letter-spacing: 2px;

  color: rgba(0,0,0,0.82);
}

body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-form-status[data-error="1"]{
  color: rgba(0,0,0,0.82); /* keep monochrome */
}

/* Autofill (unsubscribe page) */
body.page-id-4371 .juice-contact-form[data-juice-form="mailer-unsub"] .juice-input-wrap input:-webkit-autofill{
  -webkit-text-fill-color: #000 !important;
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  box-shadow: 0 0 0px 1000px #fff inset !important;
  background-color: #fff !important;
  caret-color: #000 !important;
}
