/**
 * Stripe Payment Element look — works in both classic and Block checkout.
 * Rooted on our own class names so we don't depend on WooCommerce wrappers.
 */

.StripePaymentForm,
.StripePaymentForm * {
	box-sizing: border-box;
}

.StripePaymentForm {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	color: #0A2540;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 4px 0 0;
}

/* Field labels */
.StripeElement-label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #30313D;
	margin: 0 0 4px 0;
	letter-spacing: 0;
	line-height: 1.4;
}

/* Field wrappers */
.StripeElement-fieldWrap {
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #E0E6EB;
	border-radius: 6px;
	padding: 0 12px;
	min-height: 40px;
	box-shadow: 0 1px 1px rgba(10, 37, 64, 0.04), 0 3px 6px rgba(10, 37, 64, 0.03);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.StripeElement-fieldWrap:hover {
	border-color: #C1C9D2;
}

.StripeElement-field-group.StripeElement-focus .StripeElement-fieldWrap,
.StripeElement-fieldWrap:focus-within {
	border-color: #635BFF;
	box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.22);
	outline: none;
}

.StripeElement-field-group.StripeElement-error .StripeElement-fieldWrap {
	border-color: #DF1B41;
	box-shadow: 0 0 0 2px rgba(223, 27, 65, 0.15);
}

/* Inputs */
.StripeElement-input {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 38px;
	border: 0;
	outline: none;
	background: transparent;
	padding: 0;
	font-size: 14px;
	line-height: 1.2;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	color: #30313D;
	letter-spacing: 0.15px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: textfield;
	box-shadow: none !important;
}

.StripeElement-input::placeholder {
	color: #6D7A8A;
	font-weight: 400;
	opacity: 1;
}

/* Kill Chrome autofill blue background */
.StripeElement-input:-webkit-autofill,
.StripeElement-input:-webkit-autofill:hover,
.StripeElement-input:-webkit-autofill:focus,
.StripeElement-input:-webkit-autofill:active {
	-webkit-text-fill-color: #30313D !important;
	-webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
	box-shadow: 0 0 0 1000px #ffffff inset !important;
	transition: background-color 5000s ease-in-out 0s;
	caret-color: #30313D;
	background-clip: content-box !important;
}

/* Firefox */
.StripeElement-input:autofill {
	background: #fff !important;
	color: #30313D !important;
}

/* Hide number input spinners */
.StripeElement-input::-webkit-outer-spin-button,
.StripeElement-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Brand icon inside card number */
.StripeElement-brandIcon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 20px;
	margin-left: 8px;
	flex-shrink: 0;
	pointer-events: none;
}

.StripeElement-brandIcon svg,
.StripeElement-brandIcon img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
}

/* Row layout (expiry + cvc) */
.StripeElement-row {
	display: flex;
	gap: 12px;
}

.StripeElement-row .StripeElement-field-group {
	flex: 1;
	min-width: 0;
}

/* Footer (Powered by Stripe) */
.StripeElement-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	margin-top: 16px;
	font-size: 11px;
	color: #8898AA;
}

.StripeElement-poweredBy {
	opacity: 0.7;
}

.StripeElement-stripeLogo {
	height: 18px !important;
	width: auto !important;
}

/* Spacing between field groups */
.StripePaymentForm > .StripeElement-field-group,
.StripePaymentForm > .StripeElement-row {
	margin-bottom: 12px;
}

.StripePaymentForm > .StripeElement-row:last-of-type,
.StripePaymentForm > .StripeElement-field-group:last-child {
	margin-bottom: 0;
}

/* Helper error text (not shown by default) */
.StripeElement-errorText {
	display: none;
	color: #DF1B41;
	font-size: 12px;
	margin-top: 6px;
	margin-left: 2px;
	font-weight: 500;
}

.StripeElement-field-group.StripeElement-error .StripeElement-errorText {
	display: block;
}

/* ===== Block checkout container fixes ===== */
/* Kill theme greenish label color and reset button styling inside our form */
.wc-block-checkout .StripePaymentForm .StripeElement-label,
.wp-block-woocommerce-checkout .StripePaymentForm .StripeElement-label {
	color: #30313D !important;
	font-weight: 500 !important;
	text-transform: none !important;
	font-size: 12px !important;
	letter-spacing: 0 !important;
	margin: 0 0 4px 0 !important;
	line-height: 1.4 !important;
}

/* ONE frame lives on the accordion-option. Everything else is transparent. */

/* Strip visual chrome from ALL wrappers inside the payment block. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-methods,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-method,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control__option,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control__option-layout,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control__label-group,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control-accordion-content,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-method-content {
	width: 100%;
	max-width: 100%;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
}

/* Parent radio grid: authored for 3 columns, force single-column. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control {
	display: block !important;
	grid-template-columns: 1fr !important;
	gap: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-methods,
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-method {
	padding: 0 !important;
	margin: 0 !important;
	display: block;
}

/* THE frame — single rounded card wraps radio header + expanded form. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control-accordion-option {
	width: 100%;
	max-width: 100%;
	display: block;
	background: #fff !important;
	border: 1px solid #E6E6E6 !important;
	border-radius: 10px !important;
	box-shadow: 0 1px 3px rgba(10, 37, 64, 0.05) !important;
	overflow: hidden !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Header row — the label itself (which IS .wc-block-components-radio-control__option).
   Divider only, no inner frame, no doubled borders anywhere else. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control-accordion-option > label.wc-block-components-radio-control__option {
	width: 100% !important;
	max-width: 100% !important;
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	background: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid #E6E6E6 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 14px 20px !important;
	margin: 0 !important;
	cursor: pointer;
	min-height: 0 !important;
}

/* "Card de plată" text — Stripe navy, not theme green. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control__label {
	color: #0A2540 !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	background: transparent !important;
}

/* Body region padding — where the Stripe form lives. */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control-accordion-content {
	padding: 18px 20px 20px !important;
	margin: 0 !important;
	box-sizing: border-box;
}

.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .wc-block-components-payment-method-content {
	padding: 0 !important;
	margin: 0 !important;
	box-sizing: border-box;
}

.wc-block-checkout .wp-block-woocommerce-checkout-payment-block .StripePaymentForm {
	width: 100%;
	max-width: 100%;
	padding: 0;
}

/* Radio glyph — override theme forest-green disc EVERYWHERE in the block checkout
   (payment, shipping, delivery pickers all use the same class). Theme rule lives
   on `.woocommerce-checkout .wc-block-components-radio-control__input`, so we
   match that base and win on !important + later stylesheet order. */
.woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"],
.wc-block-checkout input.wc-block-components-radio-control__input[type="radio"],
.wp-block-woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"] {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	box-sizing: border-box !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	border: 1.5px solid #C1C9D2 !important;
	border-radius: 50% !important;
	background: #fff !important;
	background-color: #fff !important;
	background-image: none !important;
	background-clip: padding-box !important;
	position: static !important;
	margin: 0 12px 0 0 !important;
	padding: 0 !important;
	flex-shrink: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	transition: border-color 0.15s ease, background 0.15s ease;
	cursor: pointer;
	vertical-align: middle;
	accent-color: #635BFF;
}

.woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]::before,
.woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]::after,
.wc-block-checkout input.wc-block-components-radio-control__input[type="radio"]::before,
.wc-block-checkout input.wc-block-components-radio-control__input[type="radio"]::after,
.wp-block-woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]::before,
.wp-block-woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]::after {
	content: none !important;
	display: none !important;
	background: none !important;
}

.woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]:checked,
.wc-block-checkout input.wc-block-components-radio-control__input[type="radio"]:checked,
.wp-block-woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]:checked {
	border-color: #635BFF !important;
	background: #635BFF !important;
	background-color: #635BFF !important;
	background-image: none !important;
	box-shadow: inset 0 0 0 3px #fff !important;
}

.woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]:focus-visible,
.wc-block-checkout input.wc-block-components-radio-control__input[type="radio"]:focus-visible,
.wp-block-woocommerce-checkout input.wc-block-components-radio-control__input[type="radio"]:focus-visible {
	outline: 2px solid rgba(99, 91, 255, 0.35) !important;
	outline-offset: 2px;
}

/* Collapse the empty bottom gap between the form and the next section */
.wc-block-checkout .wp-block-woocommerce-checkout-payment-block,
.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-payment-block {
	padding-bottom: 0;
}

/* Classic checkout compatibility */
#payment .payment_method_stripe .payment_box,
.woocommerce-checkout .payment_method_stripe .payment_box {
	background: #fff !important;
	border-radius: 6px !important;
	padding: 16px !important;
	margin: 12px 0 0 !important;
	color: #30313D !important;
}

#payment .payment_method_stripe fieldset.StripePaymentForm {
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}
