/* ============================================================================
   Emma — shared checkout. One page, used by all three A/B arms, so it must be
   a constant: same layout, same palette, same copy, whichever page you arrive
   from. Reuses the brand's self-hosted Pluto + Roboto.
   ========================================================================== */

@font-face{font-family:'Pluto';src:url('../fonts/PlutoBold.woff2') format('woff2'),url('../fonts/PlutoBold.woff') format('woff');font-weight:700;font-display:swap}
@font-face{font-family:'Pluto';src:url('../fonts/PlutoRegular.woff2') format('woff2'),url('../fonts/PlutoRegular.woff') format('woff');font-weight:400;font-display:swap}
@font-face{font-family:'RobotoL';src:url('../fonts/Roboto-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:'RobotoL';src:url('../fonts/Roboto-Medium.ttf') format('truetype');font-weight:500;font-display:swap}
@font-face{font-family:'RobotoL';src:url('../fonts/Roboto-Bold.ttf') format('truetype');font-weight:700;font-display:swap}

:root{
  --green:#237A60; --green-d:#1E4034; --green-l:#E9F1EC; --green-tint:#F5FAF7;
  --ink:#21241F; --body:#333333;
  /* #6c716a is 4.54:1 on cream — passing but with no margin. Muted text uses a
     darker grey so the VAT and renewal lines are comfortably above AA. */
  --muted:#5A5F58;
  --cream:#F7F4EC; --paper:#FFFFFF; --line:#E2DED2;
  /* #0F8C00 is 4.40:1 on white and FAILS AA for text. Text uses --ok-text;
     the brighter --ok stays for icons and borders, where 3:1 applies. */
  --ok:#0F8C00; --ok-text:#0B6B00;
  --red:#C0392B; --gold:#C89C01;
  --cta-a:#FFE259; --cta-b:#FFA751;
  --radius:14px;
  --shadow:0 10px 30px rgba(31,64,52,.10);
  --shadow-cta:0 1px 0 0 var(--gold), 0 3px 13px 0 rgba(200,156,1,.45);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--cream);color:var(--body);
  font-family:'RobotoL',-apple-system,'Segoe UI',Helvetica,Arial,sans-serif;
  font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
h1,h2,h3{font-family:'Pluto',Georgia,serif;font-weight:700;color:var(--green-d);margin:0}

/* ---- Shell --------------------------------------------------------------- */
.co-head{background:var(--paper);border-bottom:1px solid var(--line)}
.co-head .in{max-width:1140px;margin:0 auto;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.co-head img{height:30px;width:auto}
.co-secure{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:7px}
.co-secure svg{width:15px;height:15px;flex:none;color:var(--ok)}

.co-wrap{max-width:1140px;margin:0 auto;padding:28px 20px 64px;display:grid;gap:34px;grid-template-columns:1fr}
@media(min-width:960px){
  .co-wrap{grid-template-columns:minmax(0,1fr) 380px;gap:48px;align-items:start;padding-top:40px}
  /* The summary is FIRST in the DOM so it sits at the top on mobile, where it
     matters most. On desktop it is explicitly placed in the right column. */
  .co-form{grid-column:1;grid-row:1;max-width:600px}
  .co-aside{grid-column:2;grid-row:1;position:sticky;top:24px}
}

.co-title{font-size:clamp(26px,3.4vw,34px);line-height:1.15;margin-bottom:6px}
.co-sub{color:var(--muted);font-size:15px;margin:0 0 26px}

/* ---- Form sections ------------------------------------------------------- */
.sec{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:22px;margin-bottom:18px;box-shadow:0 1px 2px rgba(31,64,52,.04)}
.sec > h2{display:flex;align-items:center;gap:11px;font-size:19px;margin-bottom:18px}
.sec .n{flex:none;width:27px;height:27px;border-radius:50%;background:var(--green);color:#fff;font-family:'RobotoL';font-size:14px;font-weight:700;display:grid;place-items:center}

.row{display:grid;gap:14px;margin-bottom:14px}
.row:last-child{margin-bottom:0}
@media(min-width:560px){ .row.two{grid-template-columns:1fr 1fr} .row.exp{grid-template-columns:1fr 1fr} }

.f{display:block}
.f > label{display:block;font-size:13.5px;font-weight:500;color:var(--ink);margin-bottom:6px}
.f .opt{color:var(--muted);font-weight:400}
.f input,.f select{
  width:100%;height:50px;padding:0 14px;font:inherit;font-size:16px;color:var(--ink);
  background:var(--paper);border:1.5px solid var(--line);border-radius:9px;
  transition:border-color .14s ease,box-shadow .14s ease;
}
.f select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A5F58' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;background-size:12px;padding-right:38px}
.f input:hover,.f select:hover{border-color:#C9C3B3}
/* A solid outline, not just a tinted shadow — an 18%-alpha glow is not a
   visible focus indicator (WCAG 2.4.7), and outlines survive forced-colors mode. */
.f input:focus,.f select:focus{outline:2px solid var(--green);outline-offset:1px;border-color:var(--green);box-shadow:0 0 0 3px rgba(35,122,96,.18)}
.f input::placeholder{color:#9A9E95}
.f.bad input,.f.bad select{border-color:var(--red);background:#FEF7F6}
.f .err{display:none;margin-top:6px;font-size:13px;color:var(--red);font-weight:500}
.f.bad .err{display:block}

/* Keyboard users must always see where they are. */
a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid var(--green);outline-offset:2px;border-radius:6px}

/* ---- Card field ---------------------------------------------------------- */
.cardwrap{position:relative}
.cardwrap input{padding-right:62px;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.brandmark{position:absolute;right:12px;top:50%;transform:translateY(-50%);height:22px;display:flex;align-items:center;pointer-events:none}
.brandmark svg{height:22px;width:auto;opacity:0;transition:opacity .18s ease}
.brandmark svg.on{opacity:1}
.cvc-hint{font-size:12.5px;color:var(--muted);margin-top:6px}

/* ---- Order summary ------------------------------------------------------- */
.co-aside h2{font-size:15px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-family:'RobotoL';font-weight:700}
.card{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card > .pad{padding:20px}

.item{display:flex;gap:14px;align-items:center}
.item .thumb{flex:none;width:62px;height:62px;border-radius:10px;background:var(--green-tint);border:1px solid var(--line);display:grid;place-items:center;overflow:hidden}
.item .thumb img{width:46px;height:auto}
.item .nm{font-family:'Pluto';font-weight:700;font-size:19px;color:var(--green-d);line-height:1.2}
.item .sup{font-size:13px;color:var(--muted);margin-top:3px}

/* Plan chooser — identical on all three arms, so it never becomes a test variable. */
.plans{margin:18px 0 0;display:grid;gap:9px}
.plan{display:flex;gap:11px;align-items:flex-start;padding:12px 13px;border:2px solid var(--line);border-radius:11px;cursor:pointer;background:var(--paper);transition:border-color .14s ease,background .14s ease}
.plan:hover{border-color:#C9C3B3}
.plan input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.plan .dot{flex:none;width:20px;height:20px;border-radius:50%;border:2px solid #CBD0CE;margin-top:1px;display:grid;place-items:center;transition:border-color .14s ease}
.plan .dot::after{content:'';width:10px;height:10px;border-radius:50%;background:var(--ok);transform:scale(0);transition:transform .14s ease}
.plan.on{border-color:var(--ok);background:var(--green-tint)}
.plan.on .dot{border-color:var(--ok)}
.plan.on .dot::after{transform:scale(1)}
.plan:focus-within{outline:3px solid var(--green);outline-offset:2px}
.plan .t{font-size:14.5px;font-weight:700;color:var(--ink);line-height:1.3}
.plan .p{font-size:13px;color:var(--muted);margin-top:2px}
.plan .p b{color:var(--ink);font-weight:700}
.saveline{margin:10px 0 0;font-size:13.5px;font-weight:700;color:var(--ok-text);display:flex;align-items:center;gap:6px}

.gifts{margin-top:16px;border:1px dashed var(--ok);background:var(--green-tint);border-radius:11px;padding:0}
.gifts summary{list-style:none;cursor:pointer;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;font-weight:700;color:var(--ok-text)}
.gifts summary::-webkit-details-marker{display:none}
.gifts summary .zero{font-weight:700;color:var(--ok-text)}
.gifts ul{margin:0;padding:0 14px 13px 32px;font-size:13.5px;color:var(--body)}
.gifts li{margin:4px 0}

.lines{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.ln{display:flex;justify-content:space-between;gap:16px;font-size:14.5px;margin-bottom:9px}
.ln .lbl{color:var(--muted)}
.ln .val{font-variant-numeric:tabular-nums}
.ln.free .val{color:var(--ok-text);font-weight:700}
.total{display:flex;justify-content:space-between;align-items:baseline;gap:16px;border-top:1px solid var(--line);margin-top:6px;padding-top:14px}
.total .lbl{font-family:'Pluto';font-weight:700;font-size:18px;color:var(--green-d)}
.total .val{font-family:'Pluto';font-weight:700;font-size:26px;color:var(--green-d);font-variant-numeric:tabular-nums}
/* VAT sits BELOW the total, phrased "of which", so it can never read as an
   extra charge being added at the last moment. */
.vatline{text-align:right;font-size:13px;color:var(--muted);margin-top:4px}

.trust{border-top:1px solid var(--line);padding:16px 20px;display:grid;gap:11px;background:#FCFBF7}
.trust div{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;color:var(--body)}
.trust svg{flex:none;width:16px;height:16px;margin-top:2px;color:var(--ok)}

/* ---- Renewal disclosure --------------------------------------------------
   Deliberately OUTSIDE the collapsible summary and directly above the pay
   button. EU Consumer Rights Directive Art. 8(2): recurrence must be given
   immediately before the order button, and the button must be unambiguous. */
.renewal{background:#FFF9E8;border:1.5px solid var(--gold);border-radius:11px;padding:14px 16px;margin:0 0 14px;font-size:14px;color:var(--body);line-height:1.5}
.renewal b{color:var(--ink)}
.renewal .cancel{display:block;margin-top:6px;font-size:13px;color:var(--muted)}
.renewal .cancel a{color:var(--green);text-decoration:underline}

/* ---- Pay button ---------------------------------------------------------- */
.pay{
  width:100%;min-height:60px;padding:16px 20px;cursor:pointer;
  font-family:'RobotoL';font-size:19px;font-weight:700;color:#333333;
  background:linear-gradient(to bottom,var(--cta-a),var(--cta-b));
  /* The gradient itself is 9.79:1 -> 6.56:1 against #333 (fine), but its edge is
     only 1.29:1 against white — this border gives the button a real boundary. */
  border:1px solid var(--gold);border-radius:10px;box-shadow:var(--shadow-cta);
  display:flex;align-items:center;justify-content:center;gap:10px;
  transition:transform .12s ease,filter .12s ease;
}
.pay:hover{filter:brightness(1.04)}
.pay:active{transform:translateY(2px);box-shadow:0 0 0 0 var(--gold)}
.pay[disabled]{opacity:.6;cursor:progress}
.pay svg{width:17px;height:17px}
.guarantee{text-align:center;font-size:13px;color:var(--muted);margin:12px 0 0}

.formerr{display:none;background:#FEF7F6;border:1.5px solid var(--red);border-radius:10px;padding:12px 14px;margin-bottom:16px;font-size:14px;color:#8E2A1F;font-weight:500}
.formerr.on{display:block}

/* ---- Mobile summary ------------------------------------------------------ */
.sumtoggle{display:none}
@media(max-width:959px){
  .co-wrap{padding-top:0}
  .co-aside{order:-1;margin:0 -20px 22px;background:var(--paper);border-bottom:1px solid var(--line)}
  .co-aside > h2{display:none}
  .sumtoggle{
    display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;
    padding:15px 20px;min-height:56px;background:none;border:0;cursor:pointer;
    font:inherit;font-size:15px;color:var(--green);font-weight:500;text-align:left;
  }
  .sumtoggle .amt{font-family:'Pluto';font-weight:700;font-size:19px;color:var(--green-d)}
  .sumtoggle .chev{transition:transform .2s ease}
  .sumtoggle[aria-expanded="true"] .chev{transform:rotate(180deg)}
  .card{border:0;border-radius:0;box-shadow:none}
  #order-summary[hidden]{display:none}
  .co-title{font-size:25px}
  /* Room for the sticky pay bar. */
  .co-form{padding-bottom:12px}
  .paybar{position:sticky;bottom:0;z-index:20;background:var(--paper);border-top:1px solid var(--line);margin:0 -20px;padding:12px 20px calc(12px + env(safe-area-inset-bottom))}
  .paybar .guarantee{margin-top:8px}
}
@media(min-width:960px){ #order-summary{display:block !important} }

@media(prefers-reduced-motion:reduce){ *{transition:none !important;animation:none !important} }

/* ---- Sold-out modal ------------------------------------------------------
   Shown when STOCK_AVAILABLE is false and a checkout passed every validation.
   It has to do three jobs at once: deliver bad news without feeling like an
   error page, make the waitlist the obvious next move, and be unmistakably
   clear that no money moved. Hence: no red anywhere, one gold CTA, and the
   card reassurance sitting directly under it rather than in the footer.
   ------------------------------------------------------------------------ */
.so{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}
.so[hidden]{display:none}
.so-back{position:absolute;inset:0;background:rgba(30,64,52,.62);backdrop-filter:blur(3px);animation:so-fade .22s ease}
.so-card{
  position:relative;width:100%;max-width:468px;max-height:calc(100vh - 40px);overflow-y:auto;
  background:var(--paper);border-radius:18px;padding:26px 26px 18px;
  box-shadow:0 24px 60px rgba(20,44,35,.34);
  animation:so-rise .26s cubic-bezier(.2,.8,.3,1);
  text-align:center;
}
@keyframes so-fade{from{opacity:0}to{opacity:1}}
@keyframes so-rise{from{opacity:0;transform:translateY(14px) scale(.975)}to{opacity:1;transform:none}}

.so-badge{
  width:50px;height:50px;border-radius:50%;margin:0 auto 12px;
  display:flex;align-items:center;justify-content:center;
  background:#FFF3D1;color:#8A6D00;
}
.so-badge svg{width:25px;height:25px}
.so-badge.ok{background:var(--green-l);color:var(--green)}

.so-eyebrow{margin:0 0 6px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.so-h{font-size:27px;line-height:1.15;margin:0 0 9px;color:var(--green-d)}
.so-p{margin:0 0 16px;font-size:15.5px;line-height:1.58;color:var(--body)}

.so-offer{background:var(--green-tint);border:1px solid var(--green-l);border-radius:12px;padding:14px 16px;margin-bottom:16px;text-align:left}
.so-offer-h{margin:0 0 10px;font-family:'Pluto',Georgia,serif;font-weight:700;font-size:15px;color:var(--green-d)}
.so-list{list-style:none;margin:0;padding:0;font-size:14.5px;line-height:1.5}
.so-list li{position:relative;padding-left:26px;margin-bottom:8px;color:var(--body)}
.so-list li:last-child{margin-bottom:0}
.so-list li::before{
  content:"";position:absolute;left:0;top:.35em;width:16px;height:16px;border-radius:50%;
  background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat;
}

.so-form{text-align:left;margin-bottom:14px}
.so-label{display:block;font-size:13px;font-weight:600;color:var(--green-d);margin-bottom:6px}
.so-input{
  width:100%;min-height:50px;padding:12px 14px;font-family:inherit;font-size:16px;color:var(--ink);
  background:var(--paper);border:1.5px solid var(--line);border-radius:10px;
}
.so-input:focus-visible{outline:2px solid var(--green);outline-offset:1px;border-color:var(--green)}
.so-input.bad{border-color:var(--red)}
.so-err{display:none;margin:6px 0 0;font-size:13px;font-weight:500;color:var(--red)}
.so-err.on{display:block}

/* Inherits the .pay gradient so the biggest button on the page is still the
   biggest button in the modal — the eye does not have to relearn it. */
.so-cta{margin-top:12px;display:flex;align-items:center;justify-content:center;gap:9px}
.so-cta svg{width:18px;height:18px;flex:none}

.so-note{
  display:flex;gap:9px;align-items:flex-start;text-align:left;
  margin:0 0 6px;padding:11px 13px;border-radius:10px;
  background:var(--green-tint);border:1px solid var(--green-l);
  font-size:13px;line-height:1.5;color:var(--body);
}
.so-note svg{width:16px;height:16px;flex:none;margin-top:2px;color:var(--green)}
.so-note strong{color:var(--green-d)}

.so-dismiss{
  display:block;width:100%;margin:8px 0 0;padding:10px;cursor:pointer;
  background:none;border:0;font-family:inherit;font-size:14px;color:var(--muted);text-decoration:underline;
}
.so-dismiss:hover{color:var(--ink)}
.so-dismiss.strong{font-size:15px;font-weight:600;color:var(--green);text-decoration:none}

@media(max-width:520px){
  .so{padding:12px}
  .so-card{padding:26px 20px 18px;border-radius:16px;max-height:calc(100vh - 24px)}
  .so-h{font-size:25px}
}

/* The global reduced-motion rule sits above this block, so repeat it here. */
@media(prefers-reduced-motion:reduce){ .so-back,.so-card{animation:none !important} }
