﻿/**
 * Public-facing styles for JF Kruse plugin
 */

/* Popup Overlay */
.jf-kruse-jewelers-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 999999;
	padding: 20px;
	box-sizing: border-box;
	overflow-y: auto;
	height: 100vh;
	width: 100vw;
}

.jf-kruse-jewelers-popup-container {
	background: white;
	padding: 0;
	border-radius: 12px;
	max-width: 900px;
	width: 90%;
	max-height: calc(100vh - 40px);
	overflow: hidden;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
}

.jf-kruse-jewelers-popup-content {
	display: flex;
	flex-direction: row;
	min-height: 500px;
}

.jf-kruse-jewelers-popup-image {
	flex: 0 0 45%;
	background: #f5f5f5;
	overflow: hidden;
	position: relative;
	min-height: 500px;
	width: 45%;
}

.jf-kruse-jewelers-popup-image picture {
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
}

.jf-kruse-jewelers-popup-image img {
	width: 100%;
	height: 100% !important;
	min-height: 500px;
	object-fit: cover;
	object-position: center 30%;
	display: block;
}

.jf-kruse-jewelers-popup-form-section {
	flex: 1;
	padding: 40px 36px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow-y: auto;
	max-height: 90vh;
}

.jf-kruse-jewelers-popup-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #1d2327;
	line-height: 1;
	padding: 8px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	z-index: 10;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jf-kruse-jewelers-popup-close:hover {
	background: white;
	color: #000;
	transform: scale(1.1);
}

/* Form Styles */
.jf-kruse-jewelers-form-container {
	padding: 0;
}

.jf-kruse-jewelers-headline {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: #1d2327;
	line-height: 1.3;
	letter-spacing: 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e5e5;
}

.jf-kruse-jewelers-subheadline {
	font-size: 25px;
	margin: 0 0 12px 0;
	color: #000000;
	line-height: 1.5;
	font-weight: 700;
}

.jf-kruse-jewelers-optional-text {
	font-size: 15px; 
	margin: 0 0 12px 0;
	color: #646970;
	font-style: normal;
	line-height: 1.6;
}

.jf-kruse-jewelers-form {
	margin-top: 12px;
	display: block;
	width: 100%;
}

.jf-kruse-jewelers-form > .jf-kruse-jewelers-form-field {
	display: block !important;
	width: 100% !important;
	position: relative !important;
	float: none !important;
	clear: both !important;
	box-sizing: border-box;
}

.jf-kruse-jewelers-form-field {
	margin-bottom: 20px;
	display: block !important;
	visibility: visible !important;
	position: relative;
	width: 100%;
	clear: both;
	float: none;
}

.jf-kruse-jewelers-form-field:last-of-type {
	margin-bottom: 0;
}

.jf-kruse-jewelers-form-field.jf-kruse-jewelers-sms-field {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative;
	z-index: 2;
	width: 100%;
	clear: both;
	float: none;
	margin-top: 20px;
	margin-bottom: 20px;
}

.jf-kruse-jewelers-form-field.jf-kruse-jewelers-phone-field {
	position: relative;
	z-index: 1;
	width: 100%;
	display: none !important;
}

.jf-kruse-jewelers-form-field.jf-kruse-jewelers-submit-field {
	position: relative;
	z-index: 1;
	width: 100%;
}

.jf-kruse-jewelers-form-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.4;
}

.jf-kruse-jewelers-form-field .screen-reader-text {
	position: absolute;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.jf-kruse-jewelers-form-field {
	position: relative;
}

.jf-kruse-jewelers-form-field input[type="email"],
.jf-kruse-jewelers-form-field input[type="text"],
.jf-kruse-jewelers-form-field input[type="tel"] {
	width: 100%;
	padding: 16px 14px 12px;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	font-size: 16px;
	font-family: inherit;
	background: #ffffff;
	color: #1d2327;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.jf-kruse-jewelers-form-field input::placeholder {
	color: transparent;
	transition: color 0.2s ease;
}

.jf-kruse-jewelers-form-field input:placeholder-shown::placeholder {
	color: #6b7280;
}

.jf-kruse-jewelers-form-field input:hover {
	border-color: #9ca3af;
}

.jf-kruse-jewelers-form-field input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.jf-kruse-jewelers-form-field input:focus::placeholder {
	color: transparent;
}

/* Floating label effect for desktop popup */
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field {
	position: relative;
}

/* Exclude checkbox label from absolute positioning */
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field label:not(.jf-kruse-jewelers-checkbox-label) {
	position: absolute;
	left: 14px;
	top: 16px;
	font-size: 16px;
	color: #6b7280;
	pointer-events: none;
	transition: all 0.2s ease;
	background: white;
	padding: 0 4px;
	z-index: 1;
	margin: 0;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input:focus + label,
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input:not(:placeholder-shown) + label {
	top: -8px;
	left: 10px;
	font-size: 12px;
	color: #2271b1;
	font-weight: 500;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input {
	padding-top: 16px;
	padding-bottom: 12px;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input:focus {
	padding-top: 20px;
	padding-bottom: 8px;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input::placeholder {
	color: transparent;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-form-field input:placeholder-shown::placeholder {
	color: transparent;
}

/* Phone field: show format placeholder when empty, hide label when empty */
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]::placeholder {
	color: #9ca3af;
	opacity: 1;
	font-family: monospace;
	letter-spacing: 0;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]:placeholder-shown::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]:focus::placeholder {
	color: transparent;
	opacity: 0;
}

/* Style the actual input value - make underscores less visible, dashes more visible */
.jf-kruse-jewelers-phone-field input[type="tel"] {
	font-family: monospace;
	letter-spacing: 0;
}

.jf-kruse-jewelers-phone-field input[type="tel"]::selection {
	background: rgba(34, 113, 177, 0.2);
}

/* Regular form phone field placeholder styling */
.jf-kruse-jewelers-form-container .jf-kruse-jewelers-phone-field input[type="tel"]::placeholder {
	color: #9ca3af;
	opacity: 1;
	font-family: monospace;
	letter-spacing: 0;
}

/* Hide phone label when placeholder is shown (field is empty) */
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]:placeholder-shown + label {
	opacity: 0;
	pointer-events: none;
}

/* Show phone label when field has content or is focused */
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]:not(:placeholder-shown) + label,
.jf-kruse-jewelers-popup-form-section .jf-kruse-jewelers-phone-field input[type="tel"]:focus + label {
	opacity: 1;
	top: -8px;
	left: 10px;
	font-size: 12px;
	color: #2271b1;
	font-weight: 500;
}

/* Floating label effect for mobile */
@media (max-width: 768px) {
	.jf-kruse-jewelers-form-field {
		position: relative;
	}
	
	/* Exclude checkbox label from absolute positioning */
	.jf-kruse-jewelers-form-field label:not(.jf-kruse-jewelers-checkbox-label) {
		position: absolute;
		left: 14px;
		top: 16px;
		font-size: 16px;
		color: #6b7280;
		pointer-events: none;
		transition: all 0.2s ease;
		background: white;
		padding: 0 4px;
		z-index: 1;
	}
	
	.jf-kruse-jewelers-form-field input:focus + label,
	.jf-kruse-jewelers-form-field input:not(:placeholder-shown) + label {
		top: -8px;
		left: 10px;
		font-size: 12px;
		color: #2271b1;
		font-weight: 500;
	}
	
	.jf-kruse-jewelers-form-field input {
		padding-top: 16px;
		padding-bottom: 12px;
	}
	
	.jf-kruse-jewelers-form-field input:focus {
		padding-top: 20px;
		padding-bottom: 8px;
	}
}

.jf-kruse-jewelers-sms-field {
	margin-top: 20px;
	margin-bottom: 20px;
	padding-top: 0;
	border-top: none;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative;
	z-index: 2;
	clear: both;
	width: 100%;
	float: none;
	overflow: visible;
}

.jf-kruse-jewelers-phone-field {
	margin-top: 0;
	margin-bottom: 20px;
	transition: all 0.2s ease;
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	position: relative;
	z-index: 1;
	width: 100%;
	clear: both;
	float: none;
	overflow: visible;
}


.jf-kruse-jewelers-phone-field.show {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	margin-top: 0;
	margin-bottom: 20px;
}

.jf-kruse-jewelers-checkbox-label {
	display: flex !important;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-weight: normal;
	margin: 0;
	visibility: visible !important;
	opacity: 1 !important;
	width: 100%;
	position: relative;
	z-index: 2;
	clear: both;
}

.jf-kruse-jewelers-checkbox-label input[type="checkbox"] {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	margin-top: 2px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: #2271b1;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	appearance: checkbox;
	-webkit-appearance: checkbox;
	-moz-appearance: checkbox;
}

.jf-kruse-jewelers-checkbox-label input[type="checkbox"]:checked {
	background-color: #2271b1;
	border-color: #2271b1;
}

.jf-kruse-jewelers-checkbox-text {
	font-size: 14px;
	color: #50575e;
	line-height: 1.5;
	font-weight: 400;
	display: inline-block;
	visibility: visible !important;
	opacity: 1 !important;
}

.jf-kruse-jewelers-submit-field {
	margin-top: 24px;
	position: relative;
	z-index: 1;
	clear: both;
	width: 100%;
	float: none;
	overflow: visible;
}

.jf-kruse-jewelers-cta-button {
	width: 100%;
	padding: 16px 24px;
	background: #2B6CF5;
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.jf-kruse-jewelers-cta-button:hover {
	background: #1a5cd9;
	opacity: 1;
	box-shadow: 0 4px 8px rgba(43, 108, 245, 0.3);
	filter: brightness(0.9);
}

.jf-kruse-jewelers-cta-button:active {
	background: #1550c4;
	opacity: 1;
	filter: brightness(0.8);
}

.jf-kruse-jewelers-cta-button:disabled {
	background: #9ca3af;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.jf-kruse-jewelers-post-cta-text {
	margin-top: 15px;
	margin-bottom: 0;
	font-size: 13px;
	color: #646970;
	text-align: center;
	line-height: 1.5;
	display: block;
	width: 100%;
	clear: both;
}

.jf-kruse-jewelers-form-messages {
	margin-top: 15px;
	padding: 12px;
	border-radius: 4px;
}

.jf-kruse-jewelers-success {
	background: #00a32a;
	color: white;
	padding: 12px;
	border-radius: 4px;
}

.jf-kruse-jewelers-error {
	background: #d63638;
	color: white;
	padding: 12px;
	border-radius: 4px;
}

.required {
	color: #d63638;
	font-weight: 600;
}

.optional {
	color: #9ca3af;
	font-weight: 400;
	font-size: 13px;
}

/* Responsive - Mobile Only */
@media (max-width: 768px) {
	.jf-kruse-jewelers-popup-content {
		flex-direction: column;
		min-height: auto;
	}

	.jf-kruse-jewelers-popup-image {
		width: 100%;
		height: 200px;
		max-height: 200px;
		flex: none;
		min-height: auto;
	}

	.jf-kruse-jewelers-popup-image img {
		min-height: 200px;
		object-position: center 30%;
	}

	.jf-kruse-jewelers-popup-image .jf-kruse-jewelers-desktop-image {
		display: none;
	}

	.jf-kruse-jewelers-popup-image .jf-kruse-jewelers-mobile-image {
		display: block;
	}

	.jf-kruse-jewelers-popup-form-section {
		padding: 30px 24px 40px;
		max-height: calc(90vh - 200px);
		justify-content: flex-start;
	}

	.jf-kruse-jewelers-popup-container {
		max-width: 95%;
		max-height: calc(100vh - 40px);
	}

	/* Condensed spacing for mobile */
	.jf-kruse-jewelers-headline {
		margin: 0 0 8px 0;
		padding-bottom: 8px;
	}

	.jf-kruse-jewelers-subheadline {
		margin: 0 0 8px 0;
		font-size: 22px;
		color: #000000;
		font-weight: 700;
	}

	.jf-kruse-jewelers-optional-text {
		display: none;
	}

	.jf-kruse-jewelers-form {
		margin-top: 0;
	}

	.jf-kruse-jewelers-form-field {
		margin-bottom: 16px;
	}

/* Optional reCAPTCHA field */
.jf-kruse-jewelers-recaptcha-field {
	margin-bottom: 16px;
}

.jf-kruse-jewelers-recaptcha {
	display: flex;
	justify-content: center;
}

	/* Floating labels on mobile - labels shown inside fields */
	/* Exclude checkbox label from absolute positioning */
	.jf-kruse-jewelers-form-field label:not(.jf-kruse-jewelers-checkbox-label) {
		display: block;
		position: absolute;
		left: 14px;
		top: 16px;
		font-size: 16px;
		color: #6b7280;
		pointer-events: none;
		transition: all 0.2s ease;
		background: white;
		padding: 0 4px;
		z-index: 1;
		margin: 0;
	}
	
	.jf-kruse-jewelers-form-field input:focus + label,
	.jf-kruse-jewelers-form-field input:not(:placeholder-shown) + label {
		top: -8px;
		left: 10px;
		font-size: 12px;
		color: #2271b1;
		font-weight: 500;
	}
	
	.jf-kruse-jewelers-form-field input {
		padding-top: 16px;
		padding-bottom: 12px;
		border-width: 2px;
	}
	
	.jf-kruse-jewelers-form-field input:focus {
		padding-top: 20px;
		padding-bottom: 8px;
	}
	
	.jf-kruse-jewelers-form-field input::placeholder {
		color: transparent;
	}
	
	.jf-kruse-jewelers-form-field input:placeholder-shown::placeholder {
		color: transparent;
	}
	
	/* Remove border line under SMS checkbox on mobile */
	.jf-kruse-jewelers-sms-field {
		border-top: none;
		padding-top: 0;
		margin-top: 16px;
		margin-bottom: 20px;
		position: relative !important;
		z-index: 2;
		width: 100% !important;
		clear: both !important;
		display: block !important;
		float: none !important;
	}
	
	.jf-kruse-jewelers-phone-field {
		margin-top: 0;
		margin-bottom: 20px;
		display: none !important;
		position: relative !important;
		z-index: 1;
		width: 100% !important;
		clear: both !important;
		float: none !important;
	}
	
	.jf-kruse-jewelers-phone-field.show {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		margin-top: 0;
		margin-bottom: 20px;
		position: relative !important;
	}
	
	.jf-kruse-jewelers-submit-field {
		clear: both !important;
		margin-top: 24px;
		margin-bottom: 0;
		width: 100% !important;
		position: relative !important;
		z-index: 1;
		float: none !important;
	}
	
	/* Post-CTA text should appear after submit button */
	.jf-kruse-jewelers-post-cta-text {
		margin-top: 15px;
		margin-bottom: 0;
		display: block;
		width: 100%;
		clear: both;
	}
	
	/* Ensure checkbox is visible and clickable on mobile */
	.jf-kruse-jewelers-checkbox-label {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		position: relative;
		z-index: 2;
		clear: both;
		width: 100%;
	}
	
	.jf-kruse-jewelers-checkbox-label input[type="checkbox"] {
		pointer-events: auto !important;
		touch-action: manipulation;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
	}
	
}

@media (max-width: 600px) {
	.jf-kruse-jewelers-popup-container {
		width: 95%;
		max-height: calc(100vh - 40px);
	}

	.jf-kruse-jewelers-popup-image {
		height: 150px;
		max-height: 150px;
	}

	.jf-kruse-jewelers-popup-image img {
		min-height: 150px;
	}

	.jf-kruse-jewelers-popup-form-section {
		padding: 24px 20px;
		max-height: calc(95vh - 150px);
	}

	.jf-kruse-jewelers-headline {
		font-size: 16px;
		padding-bottom: 8px;
	}

	.jf-kruse-jewelers-subheadline {
		font-size: 22px;
		color: #000000;
		font-weight: 700;
	}

	.jf-kruse-jewelers-popup-close {
		top: 12px;
		right: 12px;
		width: 32px;
		height: 32px;
		font-size: 20px;
	}
}
