/* Direct Debit Field Styling */
.lhl-direct-debit-wrapper {
	display: flex;
	gap: 150px;
	align-items: flex-start;
	margin-bottom: 20px;
}

/* Left side - Form fields */
.lhl-dd-content {
	flex: 1;
	min-width: 0; /* Allows flex item to shrink */
}

/* Right side - Guarantee box */
.lhl-direct-debit-wrapper .lhl-dd-guarantee-box {
	background: #f8f9fa;
	border-radius: 8px;
	padding: 30px;
	text-align: center;
	min-width: 280px;
	max-width: 320px;
	flex-shrink: 0;
}

.lhl-direct-debit-wrapper .lhl-dd-image {
	max-width: 200px !important;
	height: auto;
	margin-bottom: 20px;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.lhl-direct-debit-wrapper .lhl-dd-link {
	color: var(--Purple, #573D91);
	font-family: Clother;
	font-size: 16px;
	font-style: normal;
	font-weight: 900;
	line-height: 18px; /* 112.5% */
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-decoration-skip-ink: none;
	text-decoration-thickness: auto;
	text-underline-offset: auto;
	text-underline-position: from-font;
	display: inline-block;
	transition: color 0.3s ease;
}

.lhl-dd-link:hover {
	color: #4a2f7a;
}

/* Responsive design */
@media (max-width: 768px) {
	.lhl-direct-debit-wrapper {
		flex-direction: column;
		gap: 20px;
	}
	
	.lhl-dd-content {
		width: 100%;
		max-width: 100%;
	}
	
	.lhl-dd-content input {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box;
	}
	
	.lhl-dd-guarantee-box {
		max-width: 100%;
		min-width: auto;
		padding: 20px;
	}
}

/**
 * LHL Payment Field Styles - Minimal Required Styling
 */
 
 /* Make payment field labels inherit Gravity Forms styling */
/* Make payment field labels match DD field styling */
 .gfield--type-lhl_payment .lhl-payment-wrapper .lhl-payment-fields label {
	 font-family: var(--e-global-typography-accent-font-family);
	 font-size: var(--e-global-typography-accent-font-size);
	 font-weight: var(--e-global-typography-accent-font-weight);
	 text-transform: var(--e-global-typography-accent-text-transform);
	 font-style: var(--e-global-typography-accent-font-style);
	 text-decoration: var(--e-global-typography-accent-text-decoration);
	 line-height: var(--e-global-typography-accent-line-height);
	 letter-spacing: var(--e-global-typography-accent-letter-spacing);
	 word-spacing: var(--e-global-typography-accent-word-spacing);
	 color: var(--e-global-color-primary);
	 display: block;
	 margin-bottom: 0.5em;
 }
 
 /* Make payment field inputs match DD field styling */
 .gfield--type-lhl_payment .lhl-payment-wrapper .lhl-payment-fields input[type=text] {
	 margin-top: 10px;
	 margin-bottom: 20px;
	 width: 100% !important;
	 border-color: var(--e-global-color-primary) !important;
 }
 
 /* Purple border when inputs have content */
 .gfield--type-lhl_payment .lhl-payment-wrapper .lhl-payment-fields input[type=text]:not(:placeholder-shown) {
	 border-color: var(--e-global-color-primary);
 }
 
 /* Payment wrapper width - half page on desktop */
 .gfield--type-lhl_payment .lhl-payment-wrapper {
	 max-width: 50%;
 }
 
/* Fix First Data payment field styling */
 .lhl-payment-wrapper .payment-fields {
	 height: 58px !important; /* Force proper height */
	 min-height: 40px !important;
	 display: flex;
	 align-items: center;
	 background-color: transparent;
	 border: 1px solid var(--e-global-color-secondary);
	 border-radius: 30px !important;
	 padding: 17px 30px !important;
	 cursor: pointer;
	 outline: none;
 }
 
 .lhl-payment-wrapper .payment-fields iframe {
	 height: 50px !important; /* Slightly smaller than container */
	 width: 100% !important;
	 border: none !important;
	 display: block !important;
	 float: none !important; /* Remove float */
 }
 
 /* Fix the row layout for Expiry/CVV */
 .lhl-payment-row {
	 display: flex !important;
	 gap: 15px !important;
	 flex-wrap: nowrap !important;
 }
 
 .lhl-payment-half {
	 flex: 1 !important;
	 min-width: 0; /* Allow flex items to shrink */
 }
 
 /* Make labels consistent */
 .lhl-payment-wrapper label {
	 display: block;
	 margin-bottom: 5px;
	 font-weight: 600;
	 color: #333;
	 font-size: 14px;
 }
 
 /* Field container spacing */
 .lhl-field-container {
	 margin-bottom: 15px;
 }
 
 /* Fix any overflow issues */
 .lhl-payment-wrapper {
	 overflow: visible;
 }
 
 /* Responsive - full width on tablet and below */
 @media (max-width: 768px) {
	 .gfield--type-lhl_payment .lhl-payment-wrapper {
		 max-width: 100%;
	 }
	 
	 .lhl-payment-row {
		 flex-direction: column;
		 gap: 0;
	 }
 }

/* Card Type Icons - Not handled by GForms */
.lhl-input-wrapper {
	position: relative;
}

.card-type-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 20px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.card-type-icon.visa {
	background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iIzAwNTFBNSIvPgo8cGF0aCBkPSJNMTYuNzUgN0gxNEwxMi4yNSAxN0gxNUwxNi43NSA3WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTI2IDdIMjMuMjVMMjEuNSAxN0gyNEwyNiA3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+');
}

.card-type-icon.mastercard {
	background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0VCMDAxQiIvPgo8Y2lyY2xlIGN4PSIxNSIgY3k9IjEyIiByPSI3IiBmaWxsPSIjRkY1RjAwIi8+CjxjaXJjbGUgY3g9IjI1IiBjeT0iMTIiIHI9IjciIGZpbGw9IiNGRkY1RjAiLz4KPC9zdmc+');
}

.card-type-icon.amex {
	background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iIzAwNkZDRiIvPgo8dGV4dCB4PSIyMCIgeT0iMTUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSI4IiBmaWxsPSJ3aGl0ZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+QU1FWDwvdGV4dD4KPC9zdmc+');
}

.card-type-icon.discover {
	background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0ZGNjAwMCIvPgo8dGV4dCB4PSIyMCIgeT0iMTUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSI2IiBmaWxsPSJ3aGl0ZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+RElTQ09WRUM8L3RleHQ+Cjwvc3ZnPg==');
}

/* Processing State - Custom UI */
.lhl-processing-message {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 15px;
	background: #e8f5e8;
	border-radius: 4px;
	margin-top: 15px;
	border: 1px solid #c3e6c3;
}

.processing-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #28a745;
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.processing-text {
	color: #155724;
	font-weight: 500;
	font-size: 14px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* 3DS Popup - Completely custom */
.lhl-3ds-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
}

.lhl-3ds-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.lhl-3ds-content {
	background: white;
	border-radius: 8px;
	width: 100%;
	max-width: 500px;
	max-height: 90vh;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.lhl-3ds-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid #eee;
	background: #f8f9fa;
}

.lhl-3ds-header h3 {
	margin: 0;
	color: #333;
	font-size: 18px;
	font-weight: 600;
}

.lhl-3ds-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #999;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.lhl-3ds-close:hover {
	color: #333;
	background-color: #e9ecef;
}

.lhl-3ds-iframe-container {
	padding: 0;
	height: 400px;
}

.lhl-3ds-iframe-container iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* Form Editor Preview */
.lhl-payment-preview {
	padding: 20px;
	background: #f9f9f9;
	border: 1px dashed #ccc;
	text-align: center;
	color: #666;
	border-radius: 4px;
	font-style: italic;
}

/* Responsive adjustments for custom elements */
@media (max-width: 768px) {
	.lhl-field-row {
		flex-direction: column;
		gap: 0;
	}
	
	.lhl-field-half {
		margin-bottom: 20px;
	}
	
	.lhl-3ds-overlay {
		padding: 10px;
	}
	
	.lhl-3ds-content {
		max-height: 95vh;
	}
	
	.lhl-3ds-header {
		padding: 15px;
	}
	
	.lhl-3ds-header h3 {
		font-size: 16px;
	}
	
	.lhl-3ds-iframe-container {
		height: 350px;
	}
}

/* LHL Payment Message Styles - Generic Classes */

/* Error messages */
.lhl-error-message {
	background: #f8d7da;
	color: #721c24;
	padding: 12px;
	border-radius: 4px;
	margin-top: 15px;
	border: 1px solid #f5c6cb;
	font-size: 18px;
	line-height: 1.4;
	display: none; 
	font-family: 'Clother';
}

/* Success messages */
.lhl-success-message {
	background: #d4edda;
	color: #155724;
	padding: 12px;
	border-radius: 4px;
	margin-top: 15px;
	border: 1px solid #c3e6cb;
	font-size: 18px;
	line-height: 1.4;
	display: none;
	font-family: 'Clother';
}

/* Processing messages */
.lhl-processing-message {
	background: #d1ecf1;
	color: #0c5460;
	padding: 12px;
	border-radius: 4px;
	margin-top: 15px;
	border: 1px solid #bee5eb;
	font-size: 18px;
	line-height: 1.4;
	display: none;
	font-family: 'Clother';
}

/* Add visual icons */
.lhl-error-message::before {
	content: "⚠️ ";
	margin-right: 6px;
}

.lhl-success-message::before {
	content: "✅ ";
	margin-right: 6px;
}

/*.lhl-processing-message::before {
	content: "⏳ ";
	margin-right: 6px;
}*/

/* Hover effects */
/*.lhl-error-message:hover {
	background: #f1b2b5;
	border-color: #ef7a82;
}

.lhl-success-message:hover {
	background: #c8e5d0;
	border-color: #a3d9b1;
}*/

/* Responsive adjustments */
@media (max-width: 768px) {
	.lhl-error-message,
	.lhl-success-message,
	.lhl-processing-message {
		font-size: 13px;
		padding: 10px;
		margin-top: 12px;
	}
}

/* Animation for showing messages */
.lhl-error-message.fade-in,
.lhl-success-message.fade-in,
.lhl-processing-message.fade-in {
	animation: fadeInMessage 0.3s ease-in-out;
}

@keyframes fadeInMessage {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Proper spacing in payment containers */
.lhl-payment-wrapper .lhl-error-message,
.lhl-payment-wrapper .lhl-success-message,
.lhl-payment-wrapper .lhl-processing-message {
	margin-top: 35px;
	margin-bottom: 10px;
}

/* Ensure messages are visible above other elements */
.lhl-error-message,
.lhl-success-message,
.lhl-processing-message {
	position: relative;
	z-index: 10;
}

/* Unique Key Field */
body .lhl-unique-key {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* Also hide the input directly */
.lhl-unique-key input,
.lhl-unique-key label {
	display: none !important;
}

/* If it's in a wrapper */
.ginput_container .lhl-unique-key,
.lhl-unique-key .ginput_container {
	display: none !important;
}

/* Hide all but the first gform_supporting_hospice element */
.gform_supporting_hospice ~ .gform_supporting_hospice {
	display: none !important;
}

.gform_wrapper.gform-multistep .gform_body .gform_page .gform_page_fields .gfield.gfield--type-checkbox.communication.lhl-marketing-permissions {
	padding-left: 0px;
	padding-right: 0px;
}

.gform_wrapper.gform-multistep .gform_body .gform_page .gform_page_fields .gfield.gfield--type-checkbox.communication.lhl-marketing-permissions, .gform_wrapper.gform-multistep .gform_body .gform_page .gform_page_fields .gfield.gfield--type-checkbox.communication.lhl-hospice-marketing-want, .gform_wrapper.gform-multistep .gform_body .gform_page .gform_page_fields .gfield.gfield--type-checkbox.communication.lhl-hospice-marketing-not-want {
	padding-left: 0px;
	padding-right: 0px;
}

body .select2-container--default .select2-dropdown .select2-results .select2-results__options .select2-results__option.select2-results__option--disabled {
	color: #999  !important; 
	cursor: not-allowed; 
}

body .gform_wrapper.gravity-theme .gfield_validation_message, .gform_wrapper.gravity-theme .validation_message {
	border: none;
	background: none; 
}

body .gform_page_footer {
	z-index: 9999; 
}

/* Sticky Nav */ 
.gform_wrapper.gform-multistep .gform_body .gform_page .gform_page_footer {
	position: sticky !important;
	bottom: 25px;
	width: 100%; 
	z-index: 99;
}


.lhl-sd-entries .gform-field-label.lhl-disabled {
	opacity: 0.3 !important;
	cursor: not-allowed !important; 
}

/* Target Select2 dropdowns specifically in DOB wrapper */
.select2-container--default .select2-dropdown .select2-results .select2-results__options {
	max-height: 300px !important;
	overflow-y: auto !important;
}

/* Mobile specific - even smaller */
@media (max-width: 768px) {
	.select2-container--default .select2-dropdown .select2-results .select2-results__options {
		max-height: 250px !important;
	}
}