/**
 * PHS Lead Capture - Frontend Styles
 * Uses PHS brand design system variables from theme
 */

:root {
	/* Brand Colors */
	--phs-navy: #272361;
	--phs-navy-mid: #332f7a;
	--phs-slate: #4a4690;
	--phs-blue: #0074cf;
	--phs-blue-light: #2e8fe0;
	--phs-periwinkle: #92b4e7;
	--phs-cream: #F0F4FA;
	--phs-white: #FFFFFF;
	--phs-gray-50: #F7F8FC;
	--phs-gray-100: #EEF1F8;
	--phs-gray-200: #D8DDE8;
	--phs-gray-400: #8E96A8;
	--phs-gray-600: #5A6070;
	--phs-text: #16151F;
	--phs-green: #1A6B3C;
	--phs-font-display: 'DM Serif Display', Georgia, serif;
	--phs-font-body: 'DM Sans', system-ui, sans-serif;
	--phs-radius: 4px;
	--phs-radius-lg: 12px;
}

/* ========================================
   Base Block Styles
   ======================================== */

.wp-block-phs-lead-cta {
	font-family: var(--phs-font-body);
	color: var(--phs-text);
	margin: 2rem 0;
}

/* ========================================
   Inline Variant
   ======================================== */

.wp-block-phs-lead-cta.phs-lc-variant-inline {
	background: var(--phs-white);
	border-radius: var(--phs-radius-lg);
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.phs-lc-inline-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	align-items: stretch;
}

.phs-lc-inline-header {
	background: linear-gradient(135deg, var(--phs-navy) 0%, var(--phs-navy-mid) 100%);
	color: var(--phs-white);
	padding: 2rem 1.75rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.6rem;
}

.phs-lc-inline-icon {
	width: 40px;
	height: 40px;
	color: var(--phs-periwinkle);
	flex-shrink: 0;
}

.phs-lc-inline-icon svg {
	width: 100%;
	height: 100%;
}

.phs-lc-inline-title {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.phs-lc-inline-header .phs-lc-headline {
	font-family: var(--phs-font-display);
	font-size: 1.75rem;
	font-weight: 500;
	line-height: 1.2;
	margin: 0;
	color: var(--phs-white);
}

.phs-lc-inline-header .phs-lc-subheadline {
	font-size: 0.95rem;
	line-height: 1.5;
	margin: 0;
	opacity: 0.95;
	color: var(--phs-periwinkle);
}

.phs-lc-inline-content {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.phs-lc-inline-content .phs-lc-body-text {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--phs-gray-600);
	margin: 0;
}

/* ========================================
   Sidebar Variant
   ======================================== */

.wp-block-phs-lead-cta.phs-lc-variant-sidebar {
	max-width: 360px;
	margin-left: auto;
	margin-right: 0;
}

.phs-lc-sidebar-wrapper {
	background: linear-gradient(135deg, var(--phs-navy) 0%, var(--phs-navy-mid) 100%);
	color: var(--phs-white);
	padding: 2rem;
	border-radius: var(--phs-radius-lg);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.phs-lc-sidebar-label {
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--phs-periwinkle);
	margin: 0;
}

.phs-lc-sidebar-wrapper .phs-lc-headline {
	font-family: var(--phs-font-display);
	font-size: 1.35rem;
	font-weight: 500;
	line-height: 1.2;
	margin: 0.5rem 0 0 0;
	color: var(--phs-white);
}

.phs-lc-sidebar-wrapper .phs-lc-body-text {
	font-size: 0.9rem;
	line-height: 1.5;
	margin: 0.5rem 0;
	opacity: 0.95;
}

.phs-lc-sidebar-trust {
	font-size: 0.8rem;
	margin-top: 1rem;
	margin-bottom: 0;
	opacity: 0.85;
	color: var(--phs-gray-200);
}

/* ========================================
   Form Styles
   ======================================== */

.phs-lc-form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.phs-lc-form-row {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.phs-lc-form-field {
	display: flex;
	flex: 1;
	min-width: 0;
}

.phs-lc-form-field input,
.phs-lc-form-field select {
	flex: 1;
	padding: 0.65rem 0.75rem;
	font-family: var(--phs-font-body);
	font-size: 0.9rem;
	border: 1px solid var(--phs-gray-200);
	border-radius: var(--phs-radius);
	background-color: var(--phs-white);
	color: var(--phs-text);
	transition: all 150ms ease;
	appearance: none;
	min-width: 0;
}

.phs-lc-variant-inline .phs-lc-form-field input,
.phs-lc-variant-inline .phs-lc-form-field select {
	background-color: var(--phs-gray-50);
	border-color: var(--phs-gray-200);
}

.phs-lc-variant-sidebar .phs-lc-form-field input,
.phs-lc-variant-sidebar .phs-lc-form-field select {
	background-color: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.25);
	color: var(--phs-white);
}

.phs-lc-variant-sidebar .phs-lc-form-field input::placeholder,
.phs-lc-variant-sidebar .phs-lc-form-field select {
	color: rgba(255, 255, 255, 0.7);
}

.phs-lc-form-field input::placeholder,
.phs-lc-form-field select::placeholder {
	color: var(--phs-gray-400);
}

.phs-lc-form-field input:focus,
.phs-lc-form-field select:focus {
	outline: none;
	border-color: var(--phs-blue);
	box-shadow: 0 0 0 3px rgba(0, 116, 207, 0.1);
}

.phs-lc-variant-sidebar .phs-lc-form-field input:focus,
.phs-lc-variant-sidebar .phs-lc-form-field select:focus {
	box-shadow: 0 0 0 3px rgba(46, 143, 224, 0.2);
}

.phs-lc-form-field select {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6070' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2rem;
}

.phs-lc-variant-sidebar .phs-lc-form-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

/* ========================================
   Button Styles
   ======================================== */

.phs-lc-button {
	padding: 0.65rem 1.25rem;
	font-family: var(--phs-font-body);
	font-size: 0.9rem;
	font-weight: 600;
	border: none;
	border-radius: var(--phs-radius);
	background-color: var(--phs-blue);
	color: var(--phs-white);
	cursor: pointer;
	transition: all 150ms ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.phs-lc-variant-inline .phs-lc-button {
	background-color: var(--phs-blue);
}

.phs-lc-variant-sidebar .phs-lc-button {
	background-color: var(--phs-blue-light);
}

.phs-lc-button:hover {
	background-color: var(--phs-navy);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.phs-lc-button:active {
	transform: translateY(0);
}

.phs-lc-button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.phs-lc-button-text {
	display: inline;
}

.phs-lc-button-spinner {
	width: 16px;
	height: 16px;
}

.phs-lc-spinner {
	animation: phs-lc-spin 1s linear infinite;
}

@keyframes phs-lc-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ========================================
   Trust Badges (Inline Only)
   ======================================== */

.phs-lc-trust-badges {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding-top: 0.75rem;
	margin-top: 0.25rem;
	justify-content: center;
}

.phs-lc-trust-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.75rem;
	color: var(--phs-gray-400);
	letter-spacing: 0.01em;
}

.phs-lc-trust-badge svg {
	flex-shrink: 0;
	opacity: 0.7;
}

.phs-lc-trust-sep {
	color: var(--phs-gray-200);
	font-size: 0.75rem;
	line-height: 1;
}

/* ========================================
   Form State Messages
   ======================================== */

.phs-lc-form-message {
	padding: 1rem;
	border-radius: var(--phs-radius);
	font-size: 0.9rem;
	text-align: center;
	animation: phs-lc-fadeIn 300ms ease forwards;
}

.phs-lc-form-message.phs-lc-success {
	background-color: rgba(26, 107, 60, 0.1);
	color: var(--phs-green);
	border-left: 4px solid var(--phs-green);
}

.phs-lc-form-message.phs-lc-error {
	background-color: rgba(207, 0, 0, 0.1);
	color: #cf0000;
	border-left: 4px solid #cf0000;
}

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

/* ========================================
   Editor Preview Styles
   ======================================== */

.phs-lc-editor-preview {
	border: 2px dashed var(--phs-gray-200);
	opacity: 0.8;
	pointer-events: none;
}

.phs-lc-inline-preview,
.phs-lc-sidebar-preview {
	padding: 1.5rem;
}

.phs-lc-form-preview {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 1rem 0;
}

.phs-lc-form-preview .phs-lc-form-field {
	height: 2.5rem;
	background-color: var(--phs-gray-100);
	border-radius: var(--phs-radius);
	padding: 0 0.75rem;
	align-items: center;
	font-size: 0.85rem;
	color: var(--phs-gray-400);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
	.phs-lc-inline-wrapper {
		grid-template-columns: 1fr;
	}

	.phs-lc-inline-header {
		padding: 1.5rem;
	}

	.phs-lc-inline-content {
		padding: 1.25rem;
	}

	.phs-lc-inline-header .phs-lc-headline {
		font-size: 1.35rem;
	}

	.phs-lc-inline-header .phs-lc-subheadline {
		font-size: 0.9rem;
	}

	.phs-lc-form-row {
		flex-direction: column;
	}

	.phs-lc-trust-badges {
		gap: 0.4rem;
		padding-top: 0.5rem;
	}
}

@media (max-width: 600px) {
	.phs-lc-inline-header .phs-lc-headline {
		font-size: 1.15rem;
	}

	.phs-lc-inline-header .phs-lc-subheadline {
		font-size: 0.85rem;
	}

	.phs-lc-inline-header {
		padding: 1.5rem;
	}

	.phs-lc-inline-content {
		padding: 1.25rem;
	}

	.phs-lc-inline-content .phs-lc-body-text {
		font-size: 0.9rem;
	}

	.phs-lc-sidebar-wrapper {
		max-width: none;
		margin-left: 0;
	}

	.phs-lc-form-field input,
	.phs-lc-form-field select {
		font-size: 16px; /* Prevent zoom on iOS */
	}

	.phs-lc-form-row {
		flex-direction: column;
	}

	.phs-lc-button {
		width: 100%;
	}

	.phs-lc-trust-badges {
		gap: 0.3rem;
		flex-wrap: wrap;
		justify-content: center;
	}
}

/* ========================================
   Accessibility
   ======================================== */

.phs-lc-form-field input:focus-visible,
.phs-lc-form-field select:focus-visible {
	outline: 2px solid var(--phs-blue);
	outline-offset: 2px;
}

.phs-lc-button:focus-visible {
	outline: 2px solid var(--phs-text);
	outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
	.phs-lc-form-field input,
	.phs-lc-form-field select {
		border-width: 2px;
	}

	.phs-lc-button {
		border: 2px solid var(--phs-text);
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.phs-lc-button,
	.phs-lc-form-field input,
	.phs-lc-form-field select,
	.phs-lc-spinner {
		transition: none;
		animation: none;
	}

	.phs-lc-button:hover {
		transform: none;
	}
}
