/**
 * Consultation Popup Pro — Frontend Popup Styles
 * Mobile-first, self-contained (no external font/icon dependencies).
 */

:root {
	--cpp-header-1: #123a5c;
	--cpp-header-2: #1f7a9c;
	--cpp-accent: #d6146f;
	--cpp-accent-2: #a3105a;
	--cpp-accent-rgb: 214, 20, 111;
	--cpp-badge-color: #0f9d58;
	--cpp-badge-rgb: 15, 157, 88;
	--cpp-radius: 24px;
	--cpp-width: 880px;
	--cpp-overlay-opacity: 0.65;
}

/* ---------------------------------------------------------------------
 * Overlay
 * ------------------------------------------------------------------- */
.cpp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(10, 14, 22, var(--cpp-overlay-opacity));
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	box-sizing: border-box;
}

.cpp-overlay * {
	box-sizing: border-box;
}

.cpp-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

body.cpp-no-scroll {
	overflow: hidden;
}

/* ---------------------------------------------------------------------
 * Modal shell
 * ------------------------------------------------------------------- */
.cpp-modal {
	position: relative;
	width: 100%;
	max-width: var(--cpp-width);
	max-height: 92vh;
	overflow-y: auto;
	overflow-x: hidden;
	background: #ffffff;
	border-radius: var(--cpp-radius);
	box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35), 0 8px 20px -6px rgba(0, 0, 0, 0.15);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* Entrance animations */
.cpp-anim-scale {
	transform: scale(0.92) translateY(14px);
	opacity: 0;
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.cpp-anim-slide {
	transform: translateY(48px);
	opacity: 0;
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.cpp-overlay.is-open .cpp-modal.cpp-anim-scale,
.cpp-overlay.is-open .cpp-modal.cpp-anim-slide {
	transform: translateY(0) scale(1);
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.cpp-overlay,
	.cpp-modal {
		transition: none !important;
	}
}

/* Close button */
.cpp-close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 5;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.cpp-close:hover {
	background: rgba(255, 255, 255, 0.28);
	transform: rotate(90deg);
}
.cpp-close svg {
	width: 16px;
	height: 16px;
}

.cpp-layout-simple .cpp-close {
	background: #f3f4f6;
	color: #6b7280;
}
.cpp-layout-simple .cpp-close:hover {
	background: #e5e7eb;
}

/* ---------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------- */
.cpp-header {
	padding: 34px 36px 28px;
	background: linear-gradient(135deg, var(--cpp-header-1), var(--cpp-header-2));
	color: #ffffff;
}

.cpp-heading {
	margin: 0;
	font-size: 25px;
	line-height: 1.25;
	font-weight: 800;
	letter-spacing: -0.01em;
	padding-right: 32px;
}

.cpp-subheading {
	margin: 8px 0 0;
	font-size: 14.5px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
	font-weight: 400;
}

.cpp-layout-simple .cpp-header {
	background: #ffffff;
	color: #0f172a;
	text-align: center;
	padding: 40px 36px 8px;
}
.cpp-layout-simple .cpp-heading {
	color: #0f172a;
	padding-right: 0;
}
.cpp-layout-simple .cpp-subheading {
	color: #6b7280;
}

/* ---------------------------------------------------------------------
 * Body / badges
 * ------------------------------------------------------------------- */
.cpp-body {
	padding: 26px 36px 34px;
}
.cpp-layout-simple .cpp-body {
	padding-top: 18px;
}

.cpp-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 22px;
}

.cpp-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(var(--cpp-badge-rgb), 0.1);
	color: var(--cpp-badge-color);
	font-size: 12.5px;
	font-weight: 700;
	white-space: nowrap;
}
.cpp-badge-icon {
	display: inline-flex;
	width: 14px;
	height: 14px;
}
.cpp-badge-icon svg {
	width: 100%;
	height: 100%;
}

/* ---------------------------------------------------------------------
 * Form fields
 * ------------------------------------------------------------------- */
.cpp-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 6px;
}

.cpp-field-full {
	grid-column: 1 / -1;
}
.cpp-field-half {
	grid-column: span 1;
}

.cpp-hp-wrap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cpp-input-wrap {
	position: relative;
}

.cpp-input {
	width: 100%;
	padding: 17px 16px;
	font-size: 14.5px;
	font-family: inherit;
	color: #111827;
	background: #f8f9fb;
	border: 1.5px solid #e5e7eb;
	border-radius: 14px;
	outline: none;
	transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
	appearance: none;
	-webkit-appearance: none;
}

.cpp-input-wrap.has-icon .cpp-input {
	padding-left: 46px;
}

textarea.cpp-input {
	resize: vertical;
	min-height: 90px;
	padding-top: 20px;
}

select.cpp-input {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px;
	padding-right: 42px;
	cursor: pointer;
}

.cpp-input::placeholder {
	color: transparent;
}

.cpp-input:focus,
.cpp-input-wrap.is-focused .cpp-input {
	background: #ffffff;
	border-color: var(--cpp-accent);
	box-shadow: 0 0 0 4px rgba(var(--cpp-accent-rgb), 0.09);
}

.cpp-field-icon {
	position: absolute;
	left: 16px;
	top: 26px;
	width: 18px;
	height: 18px;
	color: #9ca3af;
	pointer-events: none;
	transition: color 0.18s ease;
	display: flex;
}
.cpp-field-icon svg {
	width: 100%;
	height: 100%;
}
.cpp-field-type-textarea .cpp-field-icon {
	top: 20px;
}

.cpp-input:focus ~ .cpp-field-icon,
.cpp-input-wrap.is-focused .cpp-field-icon {
	color: var(--cpp-accent);
}

.cpp-field-label {
	position: absolute;
	left: 46px;
	top: 26px;
	transform: translateY(-50%);
	font-size: 14.5px;
	color: #6b7280;
	background: transparent;
	padding: 0 4px;
	pointer-events: none;
	transition: all 0.16s ease;
	max-width: calc(100% - 60px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cpp-input-wrap:not(.has-icon) .cpp-field-label {
	left: 16px;
}

.cpp-req {
	color: var(--cpp-accent);
}

.cpp-input-wrap.is-focused .cpp-field-label,
.cpp-input-wrap.is-filled .cpp-field-label {
	top: 0;
	transform: translateY(-50%);
	font-size: 11.5px;
	font-weight: 700;
	background: #ffffff;
	border-radius: 4px;
	color: #6b7280;
	left: 14px;
}
.cpp-input-wrap.is-focused .cpp-field-label {
	color: var(--cpp-accent);
}

/* Select needs its label pinned up whenever a real value is chosen */
.cpp-input-wrap select.cpp-input {
	color: #111827;
}

/* ---------------------------------------------------------------------
 * Submit button
 * ------------------------------------------------------------------- */
.cpp-submit-btn {
	position: relative;
	width: 100%;
	margin-top: 20px;
	padding: 17px 24px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--cpp-accent), var(--cpp-accent-2));
	color: #ffffff;
	font-size: 15.5px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 16px 28px -10px rgba(var(--cpp-accent-rgb), 0.55), 0 4px 10px rgba(var(--cpp-accent-rgb), 0.22);
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.cpp-submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 34px -10px rgba(var(--cpp-accent-rgb), 0.6), 0 6px 14px rgba(var(--cpp-accent-rgb), 0.28);
}
.cpp-submit-btn:active {
	transform: translateY(0);
}
.cpp-submit-btn:disabled {
	cursor: not-allowed;
	opacity: 0.85;
	transform: none;
}

.cpp-submit-content {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.cpp-btn-icon,
.cpp-btn-arrow {
	display: inline-flex;
	width: 18px;
	height: 18px;
}
.cpp-btn-icon svg,
.cpp-btn-arrow svg {
	width: 100%;
	height: 100%;
}
.cpp-btn-arrow {
	width: 16px;
	height: 16px;
	transition: transform 0.15s ease;
}
.cpp-submit-btn:hover .cpp-btn-arrow {
	transform: translateX(3px);
}

.cpp-submit-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: cpp-spin 0.7s linear infinite;
}
.cpp-submit-btn.is-loading .cpp-submit-content {
	visibility: hidden;
}
.cpp-submit-btn.is-loading .cpp-submit-spinner {
	display: block;
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -10px 0 0 -10px;
}

@keyframes cpp-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Trigger button rendered by the shortcode, outside the popup */
.cpp-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 14px 28px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--cpp-accent), var(--cpp-accent-2));
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 14px 26px -10px rgba(var(--cpp-accent-rgb), 0.55);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	text-decoration: none;
	line-height: 1.2;
}
.cpp-trigger-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 30px -10px rgba(var(--cpp-accent-rgb), 0.6);
	color: #ffffff;
}
.cpp-trigger-btn .cpp-btn-icon {
	width: 17px;
	height: 17px;
}

/* ---------------------------------------------------------------------
 * Footer note / messages
 * ------------------------------------------------------------------- */
.cpp-footer-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 14px 0 0;
	font-size: 12px;
	color: #9ca3af;
}
.cpp-footer-icon {
	display: inline-flex;
	width: 13px;
	height: 13px;
}
.cpp-footer-icon svg {
	width: 100%;
	height: 100%;
}

.cpp-form-message {
	display: none;
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 13.5px;
	line-height: 1.5;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}
.cpp-form-message.is-visible {
	display: block;
}

/* ---------------------------------------------------------------------
 * Success state
 * ------------------------------------------------------------------- */
.cpp-success-state {
	text-align: center;
	padding: 40px 20px 20px;
}
.cpp-success-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(15, 157, 88, 0.1);
	color: #0f9d58;
	animation: cpp-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cpp-success-icon svg {
	width: 32px;
	height: 32px;
}
@keyframes cpp-pop {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}
.cpp-success-heading {
	margin: 18px 0 0;
	font-size: 20px;
	font-weight: 800;
	color: #111827;
}
.cpp-success-message {
	margin: 8px 0 0;
	font-size: 14.5px;
	color: #6b7280;
	line-height: 1.6;
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 600px) {
	.cpp-header {
		padding: 28px 22px 22px;
	}
	.cpp-heading {
		font-size: 21px;
		padding-right: 30px;
	}
	.cpp-subheading {
		font-size: 13.5px;
	}
	.cpp-body {
		padding: 20px 20px 26px;
	}
	.cpp-fields-grid {
		grid-template-columns: 1fr;
	}
	.cpp-field-half {
		grid-column: 1 / -1;
	}
	.cpp-input {
		padding: 15px 14px;
	}
	.cpp-input-wrap.has-icon .cpp-input {
		padding-left: 42px;
	}
	.cpp-field-icon {
		top: 24px;
	}
	.cpp-field-label {
		top: 24px;
	}
	.cpp-submit-btn {
		padding: 15px 20px;
	}
	.cpp-close {
		top: 14px;
		right: 14px;
		width: 32px;
		height: 32px;
	}
}
