/* Email marketing consent (inc/mail-consent.php, mail-consent.js; plan: wordpress/EMAIL-MARKETING-PLAN.md, section 6).
   The theme's own tokens and patterns. Loaded in the head only on checkout, account and the business form; everywhere else
   mail-consent.js adds it together with the footer form, so the first screen pays nothing. */

/* ---- 1. Checkout: optional checkbox under the email row (step 1 of #co2) ---- */
#co2 .form-row.nl-mail-row{grid-column:1/-1; margin:-6px 0 0;}
#co2 .nl-mail-row .woocommerce-form__label-for-checkbox{display:flex; align-items:flex-start; gap:10px; min-height:44px; padding:11px 0;
  box-sizing:border-box; font-size:14px; font-weight:400; line-height:1.55; color:var(--co2-ink); cursor:pointer;}
#co2 .nl-mail-row input{flex:0 0 auto; margin-top:1px;}

/* ---- 2. Shared small checkbox line: sign-up form and footer (same rhythm as .company-consent) ---- */
.nl-mail-check{display:grid; grid-template-columns:22px minmax(0,1fr); gap:0 12px; align-items:start; margin:0 0 20px;
  font-size:13px; line-height:1.75; cursor:pointer;}
.nl-mail-check input{width:22px; height:22px; margin:11px 0; padding:0; accent-color:var(--color-primary,#004E81); cursor:pointer;}
.nl-mail-check span{display:block; padding-top:10px; min-height:44px; box-sizing:border-box;}

/* ---- 3. Footer: one quiet row between the link columns and the legal line ----
   site-footer.css may load after this file, so the grid rows are set through .has-footer-mail (added with the form). */
.clean-foot.has-footer-mail .footer-mail{grid-column:1/-1; grid-row:3; width:100%; margin:0; padding:22px 0 0; border-top:1px solid var(--color-rule-faint);
  display:grid; grid-template-columns:minmax(0,620px); justify-content:start;}
.clean-foot.has-footer-mail .foot-base{grid-row:4;}
.clean-foot .footer-mail .foot-h{margin:0 0 4px;}
.clean-foot .footer-mail-row{display:flex; align-items:flex-end; gap:14px; max-width:440px;}
.clean-foot .footer-mail-row input{flex:1 1 auto; min-width:0; height:44px; padding:8px 0; border:0; border-bottom:1px solid var(--color-rule-field);
  border-radius:0; background:transparent; font:inherit; font-size:15px; color:inherit; direction:ltr; text-align:right;}
.clean-foot .footer-mail-row input::placeholder{color:var(--color-muted-foreground); opacity:.75;}
.clean-foot .footer-mail-row input:focus{outline:none; border-bottom:2px solid var(--paper-primary); padding-bottom:7px;}
.clean-foot .footer-mail-row button{flex:0 0 auto; min-height:44px; padding:0 26px; border:0; border-radius:999px; background:var(--paper-primary);
  color:var(--paper-primary-foreground); font:inherit; font-size:14px; cursor:pointer; transition:transform var(--motion-lift,220ms) var(--ease-out,ease-out);}
.clean-foot .footer-mail-row button:focus-visible{outline:2px solid var(--paper-primary); outline-offset:3px;}
.clean-foot .footer-mail .nl-mail-check{margin:6px 0 0; font-size:12px; line-height:1.7; color:var(--color-muted-foreground); text-align:start;}
.clean-foot .footer-mail .nl-mail-check span{padding-top:11px;}
.clean-foot .footer-mail-status{margin:4px 0 0; font-size:13px; color:var(--paper-primary);}
.clean-foot .footer-mail-status:empty{display:none;}
html[lang^="en"] .clean-foot .footer-mail-row input{text-align:left;}
@media (hover:hover){.clean-foot .footer-mail-row button:hover{transform:translateY(-2px);}}
@media (max-width:860px),(hover:none) and (pointer:coarse) and (max-height:500px){
  .clean-foot.has-footer-mail .footer-mail{grid-column:1; grid-row:3; padding-top:20px;}
  .clean-foot .footer-mail-row{max-width:none;}
  .clean-foot.has-footer-mail .footer-socials{grid-row:4;}
  .clean-foot.has-footer-mail .foot-base{grid-row:5;}
}

/* ---- 4. My Account: a switch row under the business invite (same shape as .account-business-invite) ---- */
.acc2 .account-mail{margin-top:22px; padding-top:20px; border-top:1px solid var(--acc2-rule);}
.nl-switch{display:inline-flex; align-items:center; min-height:44px; cursor:pointer;}
.nl-switch input{appearance:none; -webkit-appearance:none; flex-shrink:0; width:44px; height:26px; margin:0; position:relative; cursor:pointer;
  border:1px solid var(--color-rule,rgba(184,174,154,.62)); border-radius:20px; background:var(--color-rule,rgba(184,174,154,.62)); transition:background-color .15s;}
.nl-switch input::before{content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:var(--color-paper,#F7F3EB); transition:transform .15s;}
.nl-switch input:checked{background:var(--color-primary,#004E81); border-color:var(--color-primary,#004E81);}
.nl-switch input:checked::before{transform:translateX(18px);}
.nl-switch input:focus-visible{outline:2px solid var(--color-primary,#004E81); outline-offset:3px;}
@media (max-width:760px){.acc2 .account-mail{flex-direction:row; align-items:center;}}
@media (prefers-reduced-motion:reduce){.nl-switch input, .nl-switch input::before, .clean-foot .footer-mail-row button{transition:none;}}

/* ---- 5. Thank-you page: one small card under the thanks line, only when the box wasn't ticked ---- */
.acc2 .nl-mail-thanks{max-width:640px; box-sizing:border-box; margin:-8px 0 28px; padding:16px 20px; background:var(--acc2-card); border:1px solid var(--acc2-rule); border-radius:16px;}
.acc2 .nl-mail-thanks button{flex:0 0 auto; min-height:44px; padding:0 24px; border:1px solid var(--acc2-blue); border-radius:999px; background:transparent;
  color:var(--acc2-blue); font:inherit; font-size:14px; white-space:nowrap; cursor:pointer;}
.acc2 .nl-mail-thanks button:focus-visible{outline:2px solid var(--acc2-blue); outline-offset:3px;}
@media (max-width:760px){.acc2 .nl-mail-thanks{gap:10px;}}

/* ---- Footer form states ---- */
.clean-foot .footer-mail-trap{position:absolute !important; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;}
.clean-foot .footer-mail-row button:disabled{opacity:.55; cursor:default; transform:none;}
.clean-foot .footer-mail.is-sent .footer-mail-row, .clean-foot .footer-mail.is-sent .nl-mail-check{display:none;}
.clean-foot .footer-mail.is-sent .footer-mail-status{margin-top:2px; font-size:15px;}
/* ---- Thank-you card after "yes" ---- */
.acc2 .nl-mail-thanks .nl-mail-done{margin:6px 0; font-size:16px; opacity:1; color:var(--acc2-blue);}
.acc2 .nl-mail-thanks button:disabled, .nl-switch input:disabled{opacity:.55; cursor:default;}
