/* Proxima Nova / Kazimir are licensed fonts on the original site; Figtree / Source Serif 4 stand in. */
:root {
  --font-sans: "Proxima Nova", "Figtree", system-ui, sans-serif;
  --font-serif: "Kazimir Text", "Source Serif 4", Georgia, serif;

  --primary: #27678B;
  --primary-hover: #1F536F;
  --accent: #E8A93A;        /* warm amber to complement the blue */
  --text: #404044;
  --grey: #9C9EA1;
  --white: #FFF;
  --surface: #F5F6F7;       /* light tint of --grey for panels */
  --surface-2: #ECEDEF;     /* unselected button fill */
  --border: #D9DADC;
  --red: #C0392B;
  --radius: 8px;
}

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

a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Form shell ---------- */
.donate-form-container {
  width: 100%;
  max-width: 390px;
  margin: 40px auto;
  text-align: center;
  overflow: hidden;
}
.lang-toggle { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.lang-toggle button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 0 !important;
  background: var(--white);
  color: var(--grey);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
}
.lang-toggle button + button { border-left: 0; }
.lang-toggle button:first-child { border-radius: var(--radius) 0 0 var(--radius) !important; }
.lang-toggle button:last-child { border-radius: 0 var(--radius) var(--radius) 0 !important; }
.lang-toggle button.selected { background: var(--primary); border-color: var(--primary); color: var(--white); }
.lang-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.donate-form {
  box-shadow: 1px 1px 1px 1px #eaeaea;
  border-radius: var(--radius) !important;
  background: var(--white);
  padding-bottom: 16px;
  text-align: left;
}
.form-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 3px 3px 0 0 !important;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}
.form-body { padding: 12px 20px 0; }
.step[hidden] { display: none; }

/* Frequency toggle */
.freq-toggle { display: flex; }
.amount-option {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 50%;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  opacity: .5;
}
.amount-option:first-child { border-top-left-radius: 3px !important; }
.amount-option:last-child { border-top-right-radius: 3px !important; }
.amount-option:hover { opacity: 1; }
.amount-option.selected { background: var(--primary); color: var(--white); opacity: 1; }

/* Header on later steps */
.header-step {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-weight: 400;
}
/* !important so host-site button styles can't add a border/background */
.edit-amount,
.back-button {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0;
  cursor: pointer;
  color: var(--text);
}
.edit-amount:focus-visible,
.back-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.edit-amount {
  padding: 0 0 2px !important;
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: underline;
}
.header-back { position: relative; }
.back-button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border-radius: var(--radius) !important;
}
.back-button:hover { background: var(--surface-2) !important; }

/* Labels */
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin: 8px 0 12px;
}
.form-label.upper { text-transform: uppercase; font-weight: 500; }

/* Amount buttons */
.amount-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 10px;
}
.btn-grey {
  height: 48px;
  line-height: 46px;
  margin: 5px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s linear;
}
.btn-grey:hover, .btn-grey:focus-visible { background: var(--surface); border-color: var(--grey); }
.amount-button { width: calc((100% - 20px) / 3); }
.amount-button .unit { font-size: 10px; text-transform: none; color: var(--grey); }
.amount-button.selected .unit { color: var(--white); opacity: .8; }
.amount-button .unit .cur { text-transform: uppercase; }
.amount-button.selected,
.project-button.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.other-amount-button,
.other-input { width: calc(2 * (100% - 7px) / 3); }
.project-button { width: 100%; }
/* Project titles can run long in Russian; let them wrap instead of overflowing */
.project-button {
  height: auto;
  min-height: 48px;
  padding: 12px 16px;
  line-height: 1.3;
  white-space: normal;
  font-size: 14px;
  text-transform: uppercase;
}

.other-input { position: relative; margin: 5px 0; }
.other-input input {
  width: 100%;
  height: 48px;
  padding: 0 70px 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  font: 400 16px var(--font-sans);
  color: var(--primary);
  -moz-appearance: textfield;
}
.other-input input::-webkit-outer-spin-button,
.other-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.other-input input:focus { outline: none; border-color: var(--primary); }
.other-input input::placeholder { color: var(--grey); }
.preinput, .postinput {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 10px;
  font-size: 16px;
  font-weight: 500;
  pointer-events: none;
}
.preinput { left: 0; color: var(--grey); }
.postinput { right: 0; color: var(--grey); text-transform: none; }
.postinput .cur { text-transform: uppercase; }

.error-text {
  display: block;
  width: 100%;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
  margin: 0 0 5px;
}
.error-text:empty { display: none; }

/* Impact calculator */
.impact {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.impact p { margin: 0; font-size: 12px; line-height: 1.5; text-wrap: pretty; }
.impact strong { font-weight: 600; }

/* Primary button */
.btn-primary {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius) !important;
  background: var(--primary);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s linear;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.form-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  line-height: 1.5;
  margin: 20px auto 0;
  white-space: nowrap;
}
/* Cyrillic Д descends below the baseline; skip-ink would erase the underline under it */
.form-footer a {
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* Upsell */
.upsell { text-align: center; }
.upsell h3 { font-size: 18px; font-weight: 500; margin: 8px 0 0; }
.upsell .sub { font-size: 14px; line-height: 1.45; margin: 8px 0 0; }
.upsell-box {
  margin: 16px 0;
  padding: 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
}
.upsell-box .row { display: flex; align-items: center; gap: 16px; }
.upsell-box .row p { margin: 0; font-size: 14px; font-weight: 600; }
.upsell-box .label { margin: 12px 0 0; font-size: 14px; line-height: 1.45; }

.switch { position: relative; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 12px !important;
  background: var(--grey);
  transition: background-color .15s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50% !important;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .15s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Express checkout (Stripe Express Checkout Element) */
.express-section { margin: 8px 0 0; }
#express-checkout { margin: 8px 0 4px; min-height: 44px; }
.form-explainer { font-size: 14px; margin: 20px 0 8px; }

/* PayPal button under the Stripe pay button, set off by a ruled "or" */
.paypal-section { margin-top: 16px; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 12px; color: var(--grey); }
.or-divider::before,
.or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
#paypal-buttons { min-height: 45px; }

/* Inputs */
.field { margin: 0 0 16px; }
/* Honeypot: moved off-screen rather than display:none, which some bots check for */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.field-row { display: flex; gap: 24px; margin-top: 16px; }
.field-row .field { flex: 1 1 0; min-width: 0; }
.field label { display: block; font-size: 12px; color: var(--text); margin-bottom: 8px; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--grey);
  border-radius: var(--radius) !important;
  font: 400 16px var(--font-sans);
  color: var(--text);
  background: var(--white);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input.invalid { border-color: var(--red); }
.field .error-text { margin-top: 6px; }

.phone { display: flex; }
.phone .cc {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--grey);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius) !important;
  font-size: 14px;
  background: var(--surface);
}
.phone .cc:focus-within { outline: 2px solid var(--primary); outline-offset: -2px; }
.phone .cc svg { color: var(--grey); }
.phone select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.phone .input { border-radius: 0 var(--radius) var(--radius) 0 !important; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
/* Email and text opt-ins under the phone field */
.consents { margin: 0 0 16px; }
.consents .check { font-size: 12px; }
.consents .check:first-child { margin-top: 0; }
.check > input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.org-check { margin: 0 0 16px; font-size: 12px; }
.cover-fee { align-items: flex-start; margin: 16px 0 8px; font-size: 12px; line-height: 1.5; }
/* Line up the 24px switch with the first line of text */
.cover-fee .switch { margin-top: -3px; }


/* Long legal label: keep the box beside its first line */
.sms-consent { align-items: flex-start; font-size: 12px; line-height: 1.5; }
.sms-consent a { text-decoration: underline; }
.processed-by {
  margin: 0;
  padding: 8px 20px 0;
  font-size: 12px;
  color: var(--text);
  text-align: center;
}
.processed-by a { text-decoration: underline; }
.processed-by svg { vertical-align: -1px; margin-right: 4px; }

/* Payment (Stripe Payment Element) */
.payment-tab-label { font-size: 12px; font-weight: 500; text-transform: uppercase; padding: 10px 0; margin: 0; }
#payment-element { margin: 0 0 16px; min-height: 120px; }
#pay-error, #express-error { margin: 0 0 12px; }

/* Other ways to give */
.other-ways { padding-top: 8px; }
.give-method { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.give-method:first-child { padding-top: 4px; }
.give-method h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.give-method p, .give-method address { font-size: 14px; line-height: 1.5; margin: 0; font-style: normal; }
.give-method .note { font-size: 12px; margin-top: 8px; }
.bank-details { margin: 0; font-size: 14px; }
.bank-lang { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); margin: 12px 0 2px; }
.bank-lang:first-of-type { margin-top: 4px; }
.bank-details div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
.bank-details dt { color: var(--grey); flex: none; }
.bank-details dd { margin: 0; display: flex; align-items: center; gap: 8px; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.copy-button {
  flex: none;
  padding: 2px 6px !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  background: var(--surface) !important;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.other-help { font-size: 12px; text-align: center; margin: 16px 0 0; }

/* Success */
.success { text-align: center; padding: 16px 0 4px; }
.success h2 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 1.25; margin: 12px 0 8px; }
.success p { font-size: 16px; line-height: 1.5; margin: 0; }
.success .receipt-note { margin-top: 12px; font-size: 14px; color: var(--grey); }

@media (max-width: 420px) {
  .donate-form-container { max-width: 100%; }
  .form-body { padding: 12px 16px 0; }
  .field-row { gap: 12px; }
}
