/*
 * M1000 Give Bridge — GiveWP iframe presentation layer.
 *
 * This file is loaded only for a GiveWP form that is owned by the M1000
 * checkout bridge, or injected into the same-origin iframe as a fallback.
 * All rules are scoped to the bridge body class so ordinary GiveWP forms are
 * not restyled.
 */

body.m1000-give-iframe-amount-hidden {
	--font-family: "Ubuntu", sans-serif;
	font-family: var(--font-family) !important;
}

body.m1000-give-iframe-amount-hidden *,
body.m1000-give-iframe-amount-hidden *::before,
body.m1000-give-iframe-amount-hidden *::after {
	box-sizing: border-box !important;
}

/*
 * Keep text controls on the M1000 typeface without replacing icon fonts.
 * In particular, GiveWP uses Font Awesome on the secure lock and receipt
 * pseudo-elements; applying Ubuntu to every element and pseudo-element would
 * turn those glyphs into missing-character boxes.
 */
body.m1000-give-iframe-amount-hidden button,
body.m1000-give-iframe-amount-hidden input,
body.m1000-give-iframe-amount-hidden select,
body.m1000-give-iframe-amount-hidden textarea {
	font-family: var(--font-family) !important;
}

html,
body.m1000-give-iframe-amount-hidden {
	height: auto !important;
	min-height: 0 !important;
}

body.m1000-give-iframe-amount-hidden {
	margin: 0 !important;
	padding: 0 !important;
	color: #322a30 !important;
	background: transparent !important;
}

/*
 * The amount is selected in the M1000 shell and synchronized to GiveWP.
 * Keep the outer .givewp-fields-amount wrapper mounted: GiveWP renders its
 * validation error as the final child, outside the controls hidden below.
 */
.m1000-give-iframe-amount-hidden .givewp-fields-amount__input-label-container,
.m1000-give-iframe-amount-hidden .givewp-fields-amount__levels-container,
.m1000-give-iframe-amount-hidden .givewp-fields-amount__input-container,
.m1000-give-iframe-amount-hidden .givewp-fields-amount__fixed-message,
.m1000-give-iframe-amount-hidden .givewp-fields-amount__currency-switcher-message,
.m1000-give-iframe-amount-hidden .m1000-give-hide-single-gateway-row {
	display: none !important;
}

.m1000-give-iframe-amount-hidden .givewp-donation-form,
.m1000-give-iframe-amount-hidden .givewp-layout,
.m1000-give-iframe-amount-hidden .givewp-layouts,
.m1000-give-iframe-amount-hidden .givewp-form-wrap,
.m1000-give-iframe-amount-hidden .givewp-donation-form__steps,
.m1000-give-iframe-amount-hidden form {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	scroll-margin-top: 24px;
}

.m1000-give-iframe-amount-hidden h1,
.m1000-give-iframe-amount-hidden h2,
.m1000-give-iframe-amount-hidden h3 {
	color: #322a30 !important;
}

/*
 * The opening GiveWP campaign screen repeats the scholarship description that
 * M1000 already showed above the checkout. Keep the useful campaign heading,
 * but remove only that duplicate description (for example
 * “Vienos moters pokyčio stipendija – €150”). GiveWP renders it inside the
 * step-0 headerDescription component in both desktop and mobile layouts.
 */
body.m1000-give-iframe-amount-hidden
#givewp-donation-form-step-0 .givewp-layouts-headerDescription,
body.m1000-give-iframe-amount-hidden
.givewp-donation-form__step--start .givewp-layouts-headerDescription {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

/* The M1000 checkout already owns the campaign title and hero artwork. */
.m1000-give-iframe-amount-hidden .givewp-donation-form__title,
.m1000-give-iframe-amount-hidden .givewp-form-summary,
.m1000-give-iframe-amount-hidden .givewp-form-summary__title,
.m1000-give-iframe-amount-hidden .givewp-donation-form__summary,
.m1000-give-iframe-amount-hidden .givewp-layouts-headerImage,
.m1000-give-iframe-amount-hidden .givewp-layouts-headerImage img,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates-ms > .givewp-layouts-headerImage,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates .givewp-layouts-headerImage,
.m1000-give-iframe-amount-hidden .givewp-layouts-header img,
.m1000-give-iframe-amount-hidden .givewp-layouts-header picture,
.m1000-give-iframe-amount-hidden .givewp-layouts-header figure,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates img,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates picture,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates figure,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates-ms img,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates-ms picture,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates-ms figure,
.m1000-give-iframe-amount-hidden [class*="givewp-layouts-header"] img,
.m1000-give-iframe-amount-hidden [class*="givewp-layouts-header"] picture,
.m1000-give-iframe-amount-hidden [class*="givewp-layouts-header"] figure {
	display: none !important;
}

.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates-ms,
.m1000-give-iframe-amount-hidden .givewp-layouts-header__templates {
	min-height: 0 !important;
	padding-top: 0 !important;
}

/*
 * In GiveWP's Two Panel design the visual header is a separate flex column.
 * Once M1000 hides that campaign artwork, leaving only the image hidden would
 * retain a wide, empty left panel. Collapse the whole visual header and let
 * the actual donation steps occupy the checkout width.
 */
body.m1000-give-iframe-amount-hidden
#root-givewp-donation-form.givewp-donation-form-design--two-panel-steps {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.m1000-give-iframe-amount-hidden
#root-givewp-donation-form.givewp-donation-form-design--two-panel-steps
> .givewp-layouts-header {
	display: none !important;
	width: 0 !important;
	min-width: 0 !important;
	max-width: 0 !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
}

body.m1000-give-iframe-amount-hidden
#root-givewp-donation-form.givewp-donation-form-design--two-panel-steps
> .givewp-donation-form__steps {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	overflow: visible !important;
}

.m1000-give-iframe-amount-hidden input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.m1000-give-iframe-amount-hidden select,
.m1000-give-iframe-amount-hidden textarea {
	min-height: 56px !important;
	padding: 14px 16px !important;
	border: 1px solid rgba(42, 36, 40, 0.12) !important;
	border-radius: 18px !important;
	background: #ffffff !important;
	box-shadow: none !important;
}

/*
 * Keep GiveWP help/intro copy readable without globally forcing every <p> or
 * <small> element visible. Hidden validation and gateway UI must retain its
 * own display state.
 */
.m1000-give-iframe-amount-hidden .givewp-field-description,
.m1000-give-iframe-amount-hidden .givewp-description,
.m1000-give-iframe-amount-hidden .givewp-donation-form__field-description,
.m1000-give-iframe-amount-hidden .givewp-text-medium,
.m1000-give-iframe-amount-hidden .givewp-personal-info__intro,
.m1000-give-iframe-amount-hidden .givewp-donor-information__intro,
.m1000-give-iframe-amount-hidden .givewp-fields__description {
	position: relative !important;
	height: auto !important;
	min-height: calc(1em + 8px) !important;
	max-height: none !important;
	margin-top: 0 !important;
	margin-bottom: 14px !important;
	padding-top: 0.32em !important;
	padding-bottom: 2px !important;
	overflow: visible !important;
	clip: auto !important;
	line-height: 1.62 !important;
}

.m1000-give-iframe-amount-hidden label {
	color: #322a30 !important;
	font-weight: 700 !important;
}

.m1000-give-iframe-amount-hidden button[type="submit"],
.m1000-give-iframe-amount-hidden input[type="submit"],
.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-button-next {
	min-height: 58px !important;
	border: 0 !important;
	border-radius: 999px !important;
	color: #ffffff !important;
	background: linear-gradient(135deg, #e74972 0%, #d83f68 100%) !important;
	box-shadow: 0 16px 34px rgba(231, 73, 114, 0.28) !important;
	font-weight: 700 !important;
}

.m1000-give-iframe-amount-hidden button[type="submit"]:focus-visible,
.m1000-give-iframe-amount-hidden input[type="submit"]:focus-visible,
.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-button-next:focus-visible,
.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button:focus-visible {
	outline: 3px solid rgba(231, 73, 114, 0.42) !important;
	outline-offset: 3px !important;
}

/* Never suppress GiveWP's real Previous button on later steps. */
#root-givewp-donation-form .givewp-donation-form__steps-header-previous.m1000-give-previous-active,
#root-givewp-donation-form .givewp-donation-form__steps-header-previous:has(.givewp-donation-form__steps-header-previous-button) {
	display: flex !important;
	width: auto !important;
	min-width: auto !important;
	max-width: none !important;
	flex: 0 0 auto !important;
	overflow: visible !important;
}

/*
 * GiveWP positions the step title absolutely and lets the Previous button sit
 * above it. On narrow screens that can place the arrow on top of the title.
 * Reserve equal navigation columns on both sides instead, so the title stays
 * optically centered and may wrap without entering the arrow hit area.
 */
body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header {
	display: grid !important;
	grid-template-columns: 52px minmax(0, 1fr) 52px !important;
	align-items: center !important;
	width: 100% !important;
	min-height: 56px !important;
	padding: 0 4px !important;
	position: relative !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous {
	grid-column: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 52px !important;
	min-width: 52px !important;
	max-width: 52px !important;
	height: 100% !important;
	min-height: 56px !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button {
	position: static !important;
	width: 48px !important;
	height: 52px !important;
	min-height: 52px !important;
	padding: 0 !important;
	border-radius: 12px !important;
	background-position: center !important;
	background-size: 20px 20px !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-title {
	grid-column: 2 !important;
	position: static !important;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 10px 8px !important;
	text-align: center !important;
	text-overflow: clip !important;
	z-index: auto !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-title-text {
	margin: 0 !important;
	overflow: visible !important;
	text-overflow: clip !important;
	white-space: normal !important;
	overflow-wrap: break-word !important;
	line-height: 1.3 !important;
}

@media (max-width: 420px) {
	body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header {
		grid-template-columns: 46px minmax(0, 1fr) 46px !important;
		padding-inline: 2px !important;
	}

	body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous {
		width: 46px !important;
		min-width: 46px !important;
		max-width: 46px !important;
	}

	body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button {
		width: 44px !important;
	}

	body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-title {
		padding-inline: 4px !important;
	}
}

/* ========================================================================
   v0.1.534 — integrated GiveWP back action
   Use one navigation control in the form header. The iframe agent changes
   GiveWP's English/arrow-only Previous button to the Lithuanian text “Atgal”.
   On the first details step it returns to the M1000 amount chooser; on later
   steps GiveWP keeps its own native previous-step behavior.
   ======================================================================== */
body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header {
  grid-template-columns: 82px minmax(0, 1fr) 82px !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  justify-content: flex-start !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button {
  width: auto !important;
  min-width: 70px !important;
  max-width: 82px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #5f6672 !important;
  font-family: var(--font-family) !important;
  font-size: 0.9rem !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  letter-spacing: -0.01em !important;
  text-indent: 0 !important;
  text-align: left !important;
  overflow: visible !important;
  box-shadow: none !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button:hover {
  color: #322a30 !important;
  background: rgba(42, 36, 40, 0.05) !important;
}

body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button.m1000-give-previous-to-shell {
  color: #322a30 !important;
}

@media (max-width: 420px) {
  body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header {
    grid-template-columns: 74px minmax(0, 1fr) 74px !important;
  }

  body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
  }

  body.m1000-give-iframe-amount-hidden .givewp-donation-form__steps-header-previous-button {
    min-width: 66px !important;
    max-width: 74px !important;
    padding-inline: 8px !important;
    font-size: 0.86rem !important;
  }
}


/* ========================================================================
   v0.1.537 — flatten GiveWP's own nested form rings
   GiveWP 4.16.4 adds one border to the responsive outer form and another
   to the steps surface. The M1000 checkout already supplies the white
   surface, so both GiveWP-owned outer rings are removed while the useful
   internal header divider remains.
   ======================================================================== */
body.m1000-give-iframe-amount-hidden #root-givewp-donation-form.givewp-donation-form,
body.m1000-give-iframe-amount-hidden #root-givewp-donation-form .givewp-donation-form__steps {
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

body.m1000-give-iframe-amount-hidden #root-givewp-donation-form .givewp-donation-form__steps {
	overflow: visible !important;
}

/* ========================================================================
   v0.1.540 — skip GiveWP's redundant campaign/header step
   M1000 already owns the campaign message and amount choice. While the
   lightweight agent advances GiveWP from step 0 to donor details, keep that
   duplicate screen from flashing. The agent removes this class as soon as
   GiveWP reaches step 1 and fails open after a short timeout if navigation is
   ever rejected by a future GiveWP version.
   ======================================================================== */
body.m1000-give-iframe-amount-hidden.m1000-give-header-step-pending
.givewp-donation-form__steps {
	opacity: 0 !important;
	pointer-events: none !important;
}
