/*
 * Gravity Forms' own default CSS isn't loading correctly on this site.
 *
 * Investigation notes (see conversation): the plugin's actual live markup
 * uses the Orbital theme's classes (gform-theme, gform-theme--foundation,
 * gform-theme--framework, gform-theme--orbital), but the only base
 * stylesheets present on this install (assets/css/dist/basic.min.css and
 * theme.min.css) still scope every rule to the legacy ".gravity-theme"
 * class, which never appears in the rendered HTML - so even when GF's own
 * CSS is enqueued, those rules don't match anything. The dedicated
 * per-theme file (assets/css/dist/theme-components.min.css) is a 0-byte
 * file on this install, and no working Orbital-specific stylesheet could
 * be found at any of the paths GF is known to use. Re-enabling CSS output
 * via the `gform_disable_css` filter also did not cause any additional GF
 * stylesheet to appear on the page, which points to this being a broken/
 * incomplete Gravity Forms asset install rather than a simple settings
 * problem - worth a plugin re-install/repair at some point.
 *
 * Until that's sorted out, this file hand-replicates just what's needed
 * for the Mollie payment fields (used on the masterclass page) to work and
 * look correct, matching the *actual* classes/ids Gravity Forms + the
 * Mollie add-on render:
 *   1. Hide fields GF marks .gf_invisible / .gfield_visibility_hidden
 *      (e.g. card-detail fields when a non-card payment method is chosen).
 *   2. Lay out the card number / expiry+CVC / cardholder-name rows.
 *   3. Style the Mollie-hosted-iframe fields to look like real inputs.
 *   4. Restore the card-brand icon row (icons were present in the DOM but
 *      had no background-image and no fixed size without GF's CSS).
 *
 * The same content lives in src/input.css for the theme's normal build;
 * this standalone file is enqueued directly (see includes/scripts.php) so
 * it's live without needing a rebuild. Safe to remove once Gravity Forms'
 * own CSS is confirmed working correctly again.
 */

/* 1. Conditional field visibility */
.gf_invisible,
.gfield_visibility_hidden {
	display: none !important;
}

/* 2. Layout: card number (full width) / expiry+CVC (side by side) / cardholder name (full width) */
.ginput_container_mollie_components.gform-grid-row {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
}

.ginput_container_mollie_components .gform-grid-col.ginput_full {
	width: 100%;
}

.ginput_container_mollie_components .ginput_cardextras.gform-grid-row {
	display: flex;
	flex-direction: row;
	gap: 16px;
}

.ginput_container_mollie_components .ginput_cardinfo_left,
.ginput_container_mollie_components .ginput_cardinfo_right {
	flex: 1 1 0;
	min-width: 0;
}

.ginput_container_mollie_components .ginput_cardinfo_right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ginput_container_mollie_components .ginput_cardinfo_right .ginput_card_field {
	flex: 1 1 0;
	min-width: 0;
}

/* The CVC label sits as a sibling of the field + icon (not nested inside the
   field like the other labels), so force it onto its own line underneath
   rather than letting the flex row place it next to the icon. */
.ginput_container_mollie_components .ginput_cardinfo_right > .gform-field-label--type-sub {
	flex: 1 0 100%;
}

/* 3. Field boxes + labels */
.ginput_card_field {
	display: block;
	width: 100%;
}

.gform-field-label--type-sub {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 600;
}

.mollie-component {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 40px;
	padding: 0 12px;
	border: solid 1px lightgray;
	border-radius: 0;
	background-color: #ffffff;
}

.mollie-component iframe {
	width: 100% !important;
}

.mollie-component--is-focused {
	border-color: var(--color-rechtsvizier-lightgreen, #6B745F);
}

.mollie-component--has-error {
	border-color: var(--color-rechtsvizier-red, #EF565B);
}

.ginput_card_security_code_icon {
	flex: none;
	align-self: center;
}

/* 4. Card-brand icon row above the card number field */
.gform_card_icon_container {
	display: flex;
	align-items: center;
	height: auto;
	gap: 5px;
	margin: 0 0 8px 0;
}

.gform_card_icon_container .gform_card_icon {
	width: 40px;
	height: 26px;
	background-image: url('/wp-content/plugins/gravityforms/images/gf-creditcards.svg');
	background-repeat: no-repeat;
	text-indent: -9000px;
	flex: none;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_amex {
	background-position: -167px 0;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_discover {
	background-position: -221px 0;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_mastercard {
	background-position: -275px 0;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_visa {
	background-position: -59px 0;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_jcb {
	background-position: -329px 0;
}

.gform_card_icon_container .gform_card_icon.gform_card_icon_maestro {
	background-position: -5px 0;
}

/* 5. Hidden pricing field (masterclass form)
 *
 * Gravity Forms' form editor no longer offers a "Hidden" visibility option
 * for Product fields (only the field *label* can be hidden), so a fixed-fee
 * Product field used purely to give the Mollie feed something to charge
 * still renders a visible "price row" on the front end by default. Giving
 * the field the custom CSS class "rtw-hidden-price-field" (set in the field's
 * own settings) and hiding it here keeps it fully part of Gravity Forms'
 * price calculation (unlike hiding it via conditional logic, which would
 * exclude it from the total) while keeping it invisible to the visitor.
 */
.rtw-hidden-price-field {
	display: none !important;
}
