/* Custom Donation Form 2.6 - styled to match the ACVA (learnify) look and feel:
   square containers, circular icon badges, pill CTAs, uppercase letter-spaced labels.
   Colours are lifted from the theme's own tokens (text_link, text_dark, alter_bg, ...). */

.cdf-wrap.cdf-wrap{
  /* Change --cdf-accent to re-theme the whole form. */
  --cdf-accent:#fb3434;
  --cdf-accent-dark:#e62c2c;
  --cdf-accent-soft:#fff1f1;
  --cdf-accent-tint:#ffe3e3;
  /* Wikimedia donate button palette (donate.wikimedia.org Special:LandingPage) */
  --cdf-frb-bg:#f8f9fa;
  --cdf-frb-text:#222;
  --cdf-frb-border:#a2a9b1;
  --cdf-frb-hover-bg:#fff;
  --cdf-frb-hover-text:#444;
  --cdf-frb-press-bg:#c8ccd1;
  --cdf-frb-press-border:#72777d;
  --cdf-frb-on:#2a4b8d;
  --cdf-frb-focus:#36c;
  --cdf-cta:#36c;
  --cdf-cta-hover:#447ff5;
  --cdf-cta-press:#2a4b8d;
  --cdf-cta-tint:#eff3fa;
  --cdf-text:#1f242e;
  --cdf-body:#6c6f73;
  --cdf-muted:#8f9093;
  --cdf-line:#dadedf;
  --cdf-line-soft:#e3e7e8;
  --cdf-surface:#f2f6f7;
  --cdf-surface-hover:#eaf0f1;
  --cdf-bg:#fff;
  --cdf-success:#27ab43;
  --cdf-danger:#e62c2c;
  --cdf-radius:0;
  --cdf-radius-pill:30px;

  max-width:44rem;
  margin:0 auto;
  color:var(--cdf-body);
  font-size:16px;
  line-height:1.706;
  -webkit-text-size-adjust:100%;
}
.cdf-wrap.cdf-wrap *,
.cdf-wrap.cdf-wrap *::before,
.cdf-wrap.cdf-wrap *::after{box-sizing:border-box}
.cdf-wrap.cdf-wrap [hidden]{display:none !important}

/* Host-theme normalize. A theme's stylesheet often loads after this file and
   restyles bare <button>/<input>/<legend> sitting inside its content area
   (learnify, for one, absolutely positions every fieldset legend and strips
   text inputs down to a bottom border). Everything the components below set
   outranks this block, so it only fills in what they leave unstated. */
.cdf-wrap.cdf-wrap button,
.cdf-wrap.cdf-wrap input,
.cdf-wrap.cdf-wrap legend{
  position:static;
  float:none;
  height:auto;
  min-width:0;
  max-width:none;
  letter-spacing:normal;
  text-transform:none;
  text-shadow:none;
  box-shadow:none;
  background-image:none;
}
.cdf-wrap.cdf-wrap legend{width:auto;top:auto;left:auto;background:none}

/* Themes commonly hide native checkboxes with !important and draw their own,
   which would leave the fee box invisible. Keep ours a real checkbox. */
.cdf-wrap.cdf-wrap .cdf-fee input[type="checkbox"]{
  position:static !important;
  clip:auto !important;
  clip-path:none !important;
  width:1rem !important;
  height:1rem !important;
  margin:.3rem 0 0 !important;
  padding:0 !important;
  opacity:1 !important;
}

/* Small uppercase label, the theme's signature for buttons and section headers. */
.cdf-wrap.cdf-wrap .cdf-methods legend,
.cdf-wrap.cdf-wrap .cdf-other label,
.cdf-wrap.cdf-wrap .cdf-fields label{
  font-size:.75rem;
  font-weight:600;
  line-height:1.75;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--cdf-text);
}

.cdf-wrap.cdf-wrap .cdf-card{
  background:var(--cdf-bg);
  border:1px solid var(--cdf-line);
  border-radius:var(--cdf-radius);
  padding:2rem;
  margin:0;
}

.cdf-wrap.cdf-wrap .cdf-title{
  font-size:1.75rem;
  line-height:1.2;
  font-weight:600;
  letter-spacing:-.5px;
  margin:0 0 .5rem;
  color:var(--cdf-text);
}
.cdf-wrap.cdf-wrap .cdf-intro{margin:0 0 1.5rem;color:var(--cdf-body);font-size:.95rem}
.cdf-wrap.cdf-wrap .cdf-intro p{margin:0 0 .6rem}
.cdf-wrap.cdf-wrap .cdf-intro p:last-child{margin-bottom:0}

/* ------------------------------------------------ frequency + amount buttons */
/* Button spec copied from donate.wikimedia.org (.frb-btn): 1px #a2a9b1 border,
   2px radius, #f8f9fa resting, #2a4b8d when selected, fixed 50px/60px heights,
   100ms transitions. display/text-align stay forced so a host theme cannot
   turn the button into a flex row and shove the label left. */
.cdf-wrap.cdf-wrap .cdf-freq,
.cdf-wrap.cdf-wrap .cdf-amounts{
  display:grid;
  gap:8px;
  margin-bottom:8px;
  border:0;
  border-radius:0;
  overflow:visible;
}
.cdf-wrap.cdf-wrap .cdf-freq{grid-template-columns:repeat(auto-fit,minmax(0,1fr));margin-bottom:1.25rem}
.cdf-wrap.cdf-wrap .cdf-amounts{grid-template-columns:1fr 1fr 1fr 1fr;margin-bottom:.85rem}

.cdf-wrap.cdf-wrap .cdf-freq-tab,
.cdf-wrap.cdf-wrap .cdf-amt{
  appearance:none;
  -webkit-appearance:none;
  display:flex !important;
  justify-content:center;
  align-content:center;
  align-items:center;
  flex-wrap:wrap;
  text-align:center !important;
  text-indent:0;
  width:100%;
  justify-self:stretch;
  height:50px;
  padding:0 2px;
  border:1px solid var(--cdf-frb-border);
  border-radius:2px;
  font-family:inherit;
  font-size:inherit;
  font-weight:500;
  line-height:1.2;
  letter-spacing:normal;
  text-transform:none;
  background-color:var(--cdf-frb-bg);
  color:var(--cdf-frb-text);
  cursor:pointer;
  transition:background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms;
}
.cdf-wrap.cdf-wrap .cdf-freq-tab:hover,
.cdf-wrap.cdf-wrap .cdf-amt:hover{
  background-color:var(--cdf-frb-hover-bg);
  color:var(--cdf-frb-hover-text);
  border-color:var(--cdf-frb-border);
}
.cdf-wrap.cdf-wrap .cdf-freq-tab:active,
.cdf-wrap.cdf-wrap .cdf-amt:active{
  background-color:var(--cdf-frb-press-bg);
  color:#000;
  border-color:var(--cdf-frb-press-border);
  box-shadow:none;
}
.cdf-wrap.cdf-wrap .cdf-freq-tab.is-active,
.cdf-wrap.cdf-wrap .cdf-amt.is-active,
.cdf-wrap.cdf-wrap .cdf-freq-tab.is-active:hover,
.cdf-wrap.cdf-wrap .cdf-amt.is-active:hover{
  background-color:var(--cdf-frb-on);
  color:#fff;
  border-color:var(--cdf-frb-on);
}
.cdf-wrap.cdf-wrap .cdf-freq-tab:focus-visible,
.cdf-wrap.cdf-wrap .cdf-amt:focus-visible{
  outline:0;
  border-color:var(--cdf-frb-focus);
  box-shadow:inset 0 0 0 1px var(--cdf-frb-focus);
}
.cdf-wrap.cdf-wrap .cdf-freq-tab.is-active:focus-visible,
.cdf-wrap.cdf-wrap .cdf-amt.is-active:focus-visible{
  box-shadow:inset 0 0 0 1px var(--cdf-frb-focus),inset 0 0 0 2px #fff;
}

/* Amount buttons are the taller of the two on Wikimedia's page. */
.cdf-wrap.cdf-wrap .cdf-amt{height:60px;font-size:15px}
.cdf-wrap.cdf-wrap .cdf-amt-other{font-size:15px;letter-spacing:normal;text-transform:none}

/* ------------------------------------------------------------ custom amount */
.cdf-wrap.cdf-wrap .cdf-other{margin:0 0 .85rem}
.cdf-wrap.cdf-wrap .cdf-other label{display:block;margin-bottom:.4rem}
.cdf-wrap.cdf-wrap .cdf-money{
  display:flex;
  align-items:stretch;
  border:1px solid var(--cdf-line-soft);
  border-radius:var(--cdf-radius);
  overflow:hidden;
  background:var(--cdf-bg);
  transition:border-color .2s ease;
}
.cdf-wrap.cdf-wrap .cdf-money:focus-within{border-color:var(--cdf-accent)}
.cdf-wrap.cdf-wrap .cdf-money span{
  display:flex;
  align-items:center;
  padding:0 .9rem;
  background:var(--cdf-surface);
  border-right:1px solid var(--cdf-line-soft);
  font-weight:600;
  color:var(--cdf-text);
}
.cdf-wrap.cdf-wrap .cdf-money input{
  flex:1;
  min-width:0;
  border:0;
  padding:.8rem .9rem;
  font:inherit;
  font-weight:600;
  background:transparent;
  color:var(--cdf-text);
}
.cdf-wrap.cdf-wrap .cdf-money input:focus{outline:none}

.cdf-wrap.cdf-wrap .cdf-note{margin:0 0 1.25rem;font-size:.875rem;color:var(--cdf-muted)}
.cdf-wrap.cdf-wrap .cdf-note.is-error{color:var(--cdf-danger);font-weight:600}

/* ------------------------------------------------------------ fee agreement */
.cdf-wrap.cdf-wrap .cdf-fee{
  display:flex;
  gap:.7rem;
  align-items:flex-start;
  padding:1rem;
  margin:0 0 1.5rem;
  border-left:3px solid var(--cdf-accent);
  background:var(--cdf-surface);
  font-size:.875rem;
  line-height:1.6;
  cursor:pointer;
}
.cdf-wrap.cdf-wrap .cdf-fee input{margin:.3rem 0 0;flex:0 0 auto;width:1rem;height:1rem;accent-color:var(--cdf-accent);cursor:pointer}
.cdf-wrap.cdf-wrap .cdf-fee strong{color:var(--cdf-text)}

/* ---------------------------------------------------------- payment methods */
.cdf-wrap.cdf-wrap .cdf-methods{border:0;padding:0;margin:0 0 1.5rem;min-width:0}
.cdf-wrap.cdf-wrap .cdf-methods legend{padding:0;margin-bottom:.7rem}
/* auto-fit keeps a lone tile full width instead of stranding it in half a row */
.cdf-wrap.cdf-wrap .cdf-method-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));gap:.5rem}
/* Wikimedia's .payment-method-button: same shell as the amount buttons, but
   blue label text and a #447ff5 hover border. The sub-label and check circle
   are ours, so they follow the same palette. */
.cdf-wrap.cdf-wrap .cdf-method{
  display:flex;
  align-items:center;
  gap:.85rem;
  width:100%;
  margin:0;
  text-align:left;
  appearance:none;
  -webkit-appearance:none;
  overflow:hidden;
  min-height:50px;
  background-color:var(--cdf-frb-bg);
  border:1px solid var(--cdf-frb-border);
  border-radius:2px;
  padding:.7rem 1rem;
  font-family:inherit;
  font-size:15px;
  font-weight:500;
  line-height:1.2;
  color:var(--cdf-cta);
  cursor:pointer;
  transition:background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms;
}
.cdf-wrap.cdf-wrap .cdf-method:hover{background-color:var(--cdf-frb-hover-bg);border-color:var(--cdf-cta-hover)}
.cdf-wrap.cdf-wrap .cdf-method:active{
  background-color:var(--cdf-cta-tint);
  color:var(--cdf-cta-press);
  border-color:var(--cdf-cta-press);
  box-shadow:none;
}
.cdf-wrap.cdf-wrap .cdf-method.is-active{
  background-color:var(--cdf-frb-on);
  border-color:var(--cdf-frb-on);
  color:#fff;
}
.cdf-wrap.cdf-wrap .cdf-method:focus-visible{
  outline:0;
  border-color:var(--cdf-frb-focus);
  box-shadow:inset 0 0 0 1px var(--cdf-frb-focus);
}

/* Circular icon badge - the theme leans on round media throughout. */
.cdf-wrap.cdf-wrap .cdf-method-badge{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:2.25rem;
  height:2.25rem;
  border-radius:50%;
  background:#fff;
  border:1px solid var(--cdf-frb-border);
  transition:background-color 100ms,border-color 100ms;
}
.cdf-wrap.cdf-wrap .cdf-method:hover .cdf-method-badge{border-color:var(--cdf-cta-hover)}
.cdf-wrap.cdf-wrap .cdf-method.is-active .cdf-method-badge{background:#fff;border-color:#fff}

.cdf-wrap.cdf-wrap .cdf-method-text{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}
.cdf-wrap.cdf-wrap .cdf-method-name{
  font-size:15px;
  font-weight:500;
  line-height:1.2;
  letter-spacing:normal;
  text-transform:none;
  color:inherit;
}
.cdf-wrap.cdf-wrap .cdf-method-text small{color:var(--cdf-frb-text);font-size:12px;line-height:1.3;margin-top:2px}
.cdf-wrap.cdf-wrap .cdf-method.is-active .cdf-method-text small{color:#fff}

.cdf-wrap.cdf-wrap .cdf-method-check{
  flex:0 0 auto;
  width:1.15rem;
  height:1.15rem;
  border-radius:50%;
  border:1px solid var(--cdf-frb-border);
  background:#fff no-repeat center;
  background-size:.65rem;
  transition:border-color 100ms,background-color 100ms;
}
.cdf-wrap.cdf-wrap .cdf-method.is-active .cdf-method-check{
  border-color:#fff;
  background-color:var(--cdf-frb-on);
  background-image:var(--i-check);
}

.cdf-wrap.cdf-wrap .cdf-method-icon{
  flex:0 0 auto;
  width:20px;
  height:20px;
  background-color:var(--cdf-cta);
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;
  -webkit-mask-size:contain;mask-size:contain;
}
.cdf-wrap.cdf-wrap .cdf-method:hover .cdf-method-icon{background-color:var(--cdf-cta-hover)}
.cdf-wrap.cdf-wrap .cdf-method.is-active .cdf-method-icon{background-color:var(--cdf-frb-on)}
.cdf-wrap.cdf-wrap .cdf-method-icon[data-icon="card"]{-webkit-mask-image:var(--i-card);mask-image:var(--i-card)}
.cdf-wrap.cdf-wrap .cdf-method-icon[data-icon="bank"]{-webkit-mask-image:var(--i-bank);mask-image:var(--i-bank)}
.cdf-wrap.cdf-wrap .cdf-method-icon[data-icon="paypal"]{-webkit-mask-image:var(--i-paypal);mask-image:var(--i-paypal)}

.cdf-wrap.cdf-wrap{
  --i-check: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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5.5 5.5L20 6.5'/%3E%3C/svg%3E");
  --i-card:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20M6 15h4'/%3E%3C/svg%3E");
  --i-bank:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-5 9 5'/%3E%3Cpath d='M5 10v8M9.5 10v8M14.5 10v8M19 10v8'/%3E%3Cpath d='M3 20h18'/%3E%3C/svg%3E");
  --i-paypal:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 20L9.5 4h5a4 4 0 0 1 0 8h-4'/%3E%3Cpath d='M11 20l.8-5'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ buttons */
/* Wikimedia's .mc-button / .mc-link: 64px min-height, 17px bold, #36c filled,
   #447ff5 on hover, #2a4b8d while pressed, 2px radius. */
.cdf-wrap.cdf-wrap .cdf-btn{
  display:block;
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  min-height:64px;
  border-radius:2px;
  padding:12px;
  font-family:inherit;
  font-size:17px;
  font-weight:700;
  line-height:1.3;
  letter-spacing:normal;
  text-transform:none;
  text-align:center;
  outline:0;
  cursor:pointer;
  transition:all .25s ease-in-out;
}
.cdf-wrap.cdf-wrap .cdf-btn[disabled]{opacity:.55;cursor:not-allowed}
.cdf-wrap.cdf-wrap .cdf-btn:focus-visible{
  outline:0;
  border-color:var(--cdf-cta);
  box-shadow:inset 0 0 0 1px var(--cdf-cta),inset 0 0 0 2px #fff;
}

.cdf-wrap.cdf-wrap .cdf-btn-primary{
  background-color:var(--cdf-cta);
  border:1px solid var(--cdf-cta);
  color:#fff;
}
.cdf-wrap.cdf-wrap .cdf-btn-primary:hover:not([disabled]){
  background-color:var(--cdf-cta-hover);
  border-color:var(--cdf-cta-hover);
}
.cdf-wrap.cdf-wrap .cdf-btn-primary:active:not([disabled]){
  background-color:var(--cdf-cta-press);
  border-color:var(--cdf-cta-press);
  box-shadow:none;
}
/* learnify recolours button[disabled] with !important; keep our own faded state
   so the pay button does not turn grey while checkout is opening. */
.cdf-wrap.cdf-wrap .cdf-btn-primary[disabled]{
  color:#fff !important;
  border-color:var(--cdf-cta) !important;
  background-color:var(--cdf-cta) !important;
}

/* Secondary choice on the upsell panel - the button shell, blue on white. */
.cdf-wrap.cdf-wrap .cdf-btn-ghost{
  background-color:#fff;
  border:1px solid var(--cdf-frb-border);
  color:var(--cdf-cta);
}
.cdf-wrap.cdf-wrap .cdf-btn-ghost:hover{background-color:#fff;border-color:var(--cdf-cta-hover)}
.cdf-wrap.cdf-wrap .cdf-btn-ghost:active{
  background-color:var(--cdf-cta-tint);
  color:var(--cdf-cta-press);
  border-color:var(--cdf-cta-press);
  box-shadow:none;
}

.cdf-wrap.cdf-wrap .cdf-btn-link{
  min-height:0;
  margin-top:12px;
  padding:10px 12px;
  background:transparent;
  border:0;
  font-size:15px;
  font-weight:700;
  color:var(--cdf-cta);
  text-decoration:none;
}
.cdf-wrap.cdf-wrap .cdf-btn-link:hover{color:var(--cdf-cta-hover);text-decoration:underline}

.cdf-wrap.cdf-wrap .cdf-back{
  appearance:none;-webkit-appearance:none;
  background:none;border:0;
  margin:0 0 1rem;
  padding:0;
  font-family:inherit;
  font-size:15px;
  font-weight:700;
  letter-spacing:normal;
  text-transform:none;
  color:var(--cdf-cta);
  cursor:pointer;
  transition:color 100ms;
}
.cdf-wrap.cdf-wrap .cdf-back:hover{color:var(--cdf-cta-hover);text-decoration:underline}

.cdf-wrap.cdf-wrap .cdf-error{margin:1rem 0 0;color:var(--cdf-danger);font-size:.875rem;font-weight:600;min-height:1px}
.cdf-wrap.cdf-wrap .cdf-error:empty{margin:0}
.cdf-wrap.cdf-wrap .cdf-secure{margin:1rem 0 0;font-size:.8rem;color:var(--cdf-muted);text-align:center}

/* ------------------------------------------------------------------- upsell */
.cdf-wrap.cdf-wrap .cdf-upsell{display:flex;flex-direction:column;gap:.6rem}

/* ------------------------------------------------------- summary and fields */
.cdf-wrap.cdf-wrap .cdf-summary{
  border:0;
  border-left:3px solid var(--cdf-accent);
  border-radius:var(--cdf-radius);
  padding:1rem 1.25rem;
  margin-bottom:1.5rem;
  background:var(--cdf-surface);
  font-size:.925rem;
}
.cdf-wrap.cdf-wrap .cdf-summary-row{display:flex;justify-content:space-between;gap:1rem;padding:.2rem 0}
.cdf-wrap.cdf-wrap .cdf-summary-row strong{color:var(--cdf-text);font-weight:600}
.cdf-wrap.cdf-wrap .cdf-summary-total{
  border-top:1px solid var(--cdf-line);
  margin-top:.5rem;
  padding-top:.6rem;
  font-size:1.05rem;
}
.cdf-wrap.cdf-wrap .cdf-summary-total strong{color:var(--cdf-accent)}

.cdf-wrap.cdf-wrap .cdf-fields{margin-bottom:1.5rem}
.cdf-wrap.cdf-wrap .cdf-fields label{display:block;margin:0 0 .4rem}
.cdf-wrap.cdf-wrap .cdf-fields input{
  display:block;
  width:100%;
  border:1px solid var(--cdf-line-soft);
  border-radius:var(--cdf-radius);
  padding:.8rem .9rem;
  margin:0 0 1rem;
  font:inherit;
  background:var(--cdf-bg);
  color:var(--cdf-text);
  transition:border-color .2s ease;
}
.cdf-wrap.cdf-wrap .cdf-fields input:focus{outline:none;border-color:var(--cdf-accent)}
.cdf-wrap.cdf-wrap .cdf-fields input.is-invalid{border-color:var(--cdf-danger)}
.cdf-wrap.cdf-wrap .cdf-hint{margin:0;font-size:.8rem;color:var(--cdf-muted)}

.cdf-wrap.cdf-wrap .cdf-paypal{margin-top:.75rem;min-height:1px}

.cdf-wrap.cdf-wrap .cdf-tick{
  width:64px;height:64px;
  margin:0 auto 1.25rem;
  border-radius:50%;
  background:var(--cdf-surface);
  color:var(--cdf-success);
  font-size:2rem;
  line-height:64px;
  text-align:center;
  font-weight:700;
}
.cdf-wrap.cdf-wrap .cdf-panel[data-panel="thanks"]{text-align:center}

/* ------------------------------------------------------------- small screens */
@media (max-width:29.9rem){
  .cdf-wrap.cdf-wrap .cdf-card{padding:1.25rem}
  .cdf-wrap.cdf-wrap .cdf-title{font-size:1.5rem}
  .cdf-wrap.cdf-wrap .cdf-amounts{grid-template-columns:repeat(2,1fr)}
  .cdf-wrap.cdf-wrap .cdf-method-grid{grid-template-columns:1fr}
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion:reduce){
  .cdf-wrap.cdf-wrap *{transition:none !important}
}
