/**
 * Premium Stylesheet for front-end Popup Modals.
 * Custom crafted to match the exact design:
 * - Direct single-column layout for Brochure downloads (450px wide)
 * - Two-column responsive grid layout for Apply (600px wide)
 * - Soft gray rounded inputs (border-radius: 12px)
 * - Centered rich purple pill button (border-radius: 50px)
 * - Safe/Secure footer with lock icon
 */

:root {
	--cl-primary: #653392;          /* Rich Purple from mockup */
	--cl-primary-hover: #53267a;
	--cl-text-dark: #334155;         /* Elegant slate dark gray */
	--cl-text-muted: #94a3b8;
	--cl-border: #e2e8f0;
	--cl-input-bg: #f8fafc;          /* Soft light-gray fill */
	--cl-bg: #ffffff;
	--cl-error: #ef4444;
	--cl-success: #10b981;
}

/* Modal Overlay Base Container */
.cl-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999999;
	background: rgba(15, 23, 42, 0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 16px;
	box-sizing: border-box;
}

.cl-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Modal Content Card */
.cl-modal-card {
	background: var(--cl-bg);
	width: 100%;
	border-radius: 24px;              /* Rounded corners from mockup */
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
	border: 1.5px solid var(--cl-border);
	overflow: hidden;
	transform: scale(0.95) translateY(10px);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.3s ease;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	position: relative;
}

/* Dynamic Width Adjustments */
.cl-modal-card.card-brochure {
	max-width: 440px;                 /* Clean, compact width for single column inputs */
}

.cl-modal-card.card-apply {
	max-width: 580px;                 /* Slightly wider to allow side-by-side columns */
}

.cl-modal-overlay.active .cl-modal-card {
	transform: scale(1) translateY(0);
}

.cl-modal-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--cl-text-dark);
	margin: 0;
	line-height: 1.3;
	letter-spacing: 0.3px;            /* Added letter-spacing for bold fonts */
}

.cl-modal-subtitle {
	font-size: 13px;
	color: var(--cl-text-muted);
	margin: 4px 0 0 0;
	line-height: 1.4;
}

/* Close Trigger */
.cl-modal-close-btn {
	position: absolute;
	top: 20px;
	right: 20px;
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	font-size: 18px;
	font-weight: bold;
	line-height: 1;
	padding: 0;
	z-index: 10;
}

.cl-modal-close-btn:hover {
	background: #e2e8f0;
	color: #000000;
}

/* Form Fields Layout & Body */
.cl-modal-body {
	padding: 36px 36px 28px 36px;     /* Generous white padding matching mockup */
	overflow-y: auto;
	max-height: calc(100vh - 100px);
	box-sizing: border-box;
}

/* Grid System for Side-by-Side inputs (Form 1 only) */
.cl-form-row {
	display: flex;
	gap: 16px;
	margin-bottom: 0px;
	box-sizing: border-box;
}

.cl-form-col {
	flex: 1;
	min-width: 0;
	box-sizing: border-box;
}

.cl-form-group {
	margin-bottom: 16px;
	box-sizing: border-box;
	text-align: left;
}

.cl-form-group.full-width {
	width: 100%;
}

.cl-form-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #4b5563;
	margin-bottom: 6px;
	letter-spacing: 0.3px;            /* Added letter-spacing for bold fonts */
}

/* Soft Gray Input Fields */
.cl-form-input {
	width: 100%;
	height: 48px;                     /* Fixed height for perfect cross-browser vertical centering */
	padding: 0 16px;                  /* Left/Right padding only */
	border: 1.5px solid var(--cl-border);
	border-radius: 12px;              /* Soft rounded borders matching mockup */
	font-size: 14px;
	color: #1e293b;
	background-color: var(--cl-input-bg);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	box-sizing: border-box;
	font-family: inherit;
	line-height: normal;              /* Reset line-height to allow vertical centering */
}

.cl-form-input:focus {
	outline: none;
	border-color: var(--cl-primary);
	background-color: #ffffff;
	box-shadow: 0 0 0 3px rgba(101, 51, 146, 0.12);
}

.cl-form-input::placeholder {
	color: #94a3b8;
}

select.cl-form-input {
	appearance: none;
	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='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 14px;
	padding-right: 40px;
	cursor: pointer;
	line-height: 44px;                /* Force line height centering in select boxes under Windows/Firefox */
}

/* Large purple centered pill button */
.cl-submit-wrapper {
	text-align: center;
	margin-top: 24px;
	margin-bottom: 16px;
}

.cl-submit-btn {
	display: inline-flex;
	width: 100%;
	padding: 12px 24px;
	background: var(--cl-primary);
	color: #ffffff;
	border: none;
	border-radius: 50px;              /* Complete Pill Shape from mockup */
	font-size: 16px;
	font-weight: 700;                 /* Bold button text */
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-shadow: 0 4px 12px rgba(101, 51, 146, 0.2);
	letter-spacing: 0.3px;            /* Added letter-spacing for bold fonts */
}

.cl-submit-btn:hover {
	background: var(--cl-primary-hover);
}

.cl-submit-btn:active {
	transform: scale(0.98);
}

.cl-submit-btn:disabled {
	background: #cbd5e1;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* Secure Privacy Footer */
.cl-secure-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	color: #64748b;
	gap: 4px;
}

.cl-secure-footer a {
	color: var(--cl-primary);
	text-decoration: underline;
	font-weight: 600;
	letter-spacing: 0.3px;            /* Added letter-spacing for bold fonts */
}

.cl-secure-footer a:hover {
	color: var(--cl-primary-hover);
}

/* Hidden Honeypot Field */
.cl-hp-field {
	display: none !important;
	visibility: hidden !important;
}

/* Inline Alerts styling */
.cl-form-alert {
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 16px;
	display: none;
	line-height: 1.4;
	box-sizing: border-box;
	text-align: left;
}

.cl-form-alert.alert-error {
	background-color: #fef2f2;
	border: 1px solid #fee2e2;
	color: var(--cl-error);
	display: block;
}

.cl-form-alert.alert-success {
	background-color: #ecfdf5;
	border: 1px solid #d1fae5;
	color: var(--cl-success);
	display: block;
}

/* Loading Spinner Ring */
.cl-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: cl-spin 0.8s linear infinite;
}

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

/* Success View checkmark animation styles */
.cl-success-view {
	text-align: center;
	padding: 24px 10px;
	display: none;
}

.cl-success-view.active {
	display: block;
}

.cl-success-icon {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	background: #ecfdf5;
	color: var(--cl-success);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	margin-bottom: 16px;
	border: 2px solid #d1fae5;
}

/* Responsiveness adaptation */
@media (max-width: 600px) {
	.cl-form-row {
		flex-direction: column;
		gap: 0;
	}
	.cl-modal-body {
		padding: 24px;
	}
}
