/* DriveEV Lead Intelligence — Lead Capture Modal Styles */
/* Version 1.0.0 */

/* ---- Reset (scoped to modal) ---- */
#driveev-modal-overlay *,
#driveev-modal-overlay *::before,
#driveev-modal-overlay *::after {
	box-sizing: border-box;
}

/* ---- Overlay (backdrop) ---- */
.driveev-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.65);
	z-index: 99999;
	overflow-y: auto;
	padding: 1rem;
	-webkit-overflow-scrolling: touch;
}

.driveev-modal-overlay--visible {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

/* ---- Prevent body scroll when modal is open ---- */
body.driveev-modal-open {
	overflow: hidden;
}

/* ---- Modal container ---- */
.driveev-modal-container {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	width: 100%;
	max-width: 560px;
	margin: auto;
	position: relative;
	animation: driveev-modal-in 0.22s ease-out;
}

@keyframes driveev-modal-in {
	from { opacity: 0; transform: translateY(-16px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---- Modal header ---- */
.driveev-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e8e8e8;
	background-color: #00337a;
	border-radius: 12px 12px 0 0;
}

.driveev-modal-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
}

.driveev-modal-close {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	opacity: 0.8;
	transition: opacity 0.15s;
}

.driveev-modal-close:hover {
	opacity: 1;
}

/* ---- Modal body ---- */
.driveev-modal-body {
	padding: 1.5rem;
}

/* ---- Form groups ---- */
.driveev-form-group {
	margin-bottom: 1rem;
}

.driveev-form-group label,
.driveev-form-group legend {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: #00337a;
	margin-bottom: 0.375rem;
}

.driveev-form-group fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

.driveev-required {
	color: #e53e3e;
	margin-left: 2px;
}

.driveev-optional {
	color: #888;
	font-weight: 400;
	margin-left: 4px;
	font-size: 0.8rem;
}

/* ---- Inputs, selects, textarea ---- */
.driveev-lead-form input[type="text"],
.driveev-lead-form input[type="tel"],
.driveev-lead-form input[type="email"],
.driveev-lead-form select,
.driveev-lead-form textarea {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	font-size: 0.9375rem;
	color: #00337a;
	background-color: #ffffff;
	transition: border-color 0.15s, box-shadow 0.15s;
	appearance: none;
	-webkit-appearance: none;
}

.driveev-lead-form textarea {
	resize: vertical;
	font-family: inherit;
	line-height: 1.5;
}

.driveev-lead-form input:focus,
.driveev-lead-form select:focus,
.driveev-lead-form textarea:focus {
	outline: none;
	border-color: #00337a;
	box-shadow: 0 0 0 3px rgba(0, 51, 122, 0.2);
}

.driveev-lead-form input[aria-invalid="true"],
.driveev-lead-form select[aria-invalid="true"],
.driveev-lead-form textarea[aria-invalid="true"] {
	border-color: #e53e3e;
}

/* ---- Phone input with country code prefix ---- */
.driveev-phone-input-wrap {
	display: flex;
	align-items: center;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	overflow: hidden;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.driveev-phone-input-wrap:focus-within {
	border-color: #00337a;
	box-shadow: 0 0 0 3px rgba(0, 51, 122, 0.2);
}
.driveev-phone-prefix {
	padding: 0.625rem 0.75rem;
	background: #f3f4f6;
	color: #00337a;
	font-weight: 600;
	font-size: 0.9375rem;
	border-right: 1.5px solid #d1d5db;
	white-space: nowrap;
	user-select: none;
}
.driveev-phone-input-wrap input[type="tel"] {
	border: none;
	padding: 0.625rem 0.75rem;
	font-size: 0.9375rem;
	color: #00337a;
	width: 100%;
	outline: none;
	background: #ffffff;
}
.driveev-phone-input-wrap input[type="tel"]:focus {
	box-shadow: none;
}

.driveev-lead-form select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23888' d='M7 7l3 3 3-3'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 1.25rem;
	padding-right: 2.5rem;
}

/* ---- Radio buttons ---- */
.driveev-form-group--radio {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.driveev-radio-label,
#driveev-modal-overlay .driveev-radio-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 400;
	color: #000000;
	cursor: pointer;
}

.driveev-radio-label input[type="radio"] {
	width: 1rem;
	height: 1rem;
	accent-color: #00337a;
	flex-shrink: 0;
}

/* ---- Checkbox ---- */
.driveev-checkbox-label,
#driveev-modal-overlay .driveev-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.875rem;
	font-weight: 400;
	color: #000000;
	cursor: pointer;
	line-height: 1.4;
}

.driveev-checkbox-label input[type="checkbox"] {
	width: 1rem;
	height: 1rem;
	accent-color: #00337a;
	flex-shrink: 0;
	margin-top: 0.15rem;
}

.driveev-checkbox-label a,
#driveev-modal-overlay .driveev-checkbox-label a {
	color: #00337a;
	text-decoration: underline;
	display: inline;
}

/* ---- Field error messages ---- */
.driveev-field-error {
	display: block;
	font-size: 0.8125rem;
	color: #e53e3e;
	margin-top: 0.25rem;
	min-height: 1rem;
}

/* ---- General error ---- */
.driveev-form-error-general {
	background-color: #fff5f5;
	border: 1px solid #fed7d7;
	border-radius: 6px;
	color: #e53e3e;
	font-size: 0.875rem;
	padding: 0.75rem 1rem;
	margin-top: 1rem;
}

/* ---- Submit button ---- */
#driveev-modal-overlay .driveev-btn--primary {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.875rem 1.5rem;
	background-color: #00337a;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s, transform 0.1s;
	text-align: center;
}

.driveev-btn--primary:hover:not(:disabled) {
	background-color: #002255;
}

.driveev-btn--primary:active:not(:disabled) {
	transform: scale(0.98);
}

.driveev-btn--primary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* ---- Form note below submit ---- */
.driveev-form-note {
	text-align: center;
	font-size: 0.8rem;
	color: #6b7280;
	margin-top: 10px;
}

/* ---- Success state ---- */
.driveev-modal-success {
	text-align: center;
	padding: 2rem 1rem;
}

.driveev-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background-color: #00337a;
	color: #ffffff;
	border-radius: 50%;
	font-size: 1.75rem;
	margin-bottom: 1rem;
}

.driveev-modal-success h3 {
	font-size: 1.25rem;
	font-weight: 700;
	color: #00337a;
	margin: 0 0 0.5rem;
}

.driveev-modal-success p {
	color: #555;
	font-size: 0.9375rem;
	margin: 0;
}

/* ---- Mobile responsive (max-width: 768px) ---- */
@media ( max-width: 768px ) {
	.driveev-modal-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.driveev-modal-container {
		border-radius: 16px 16px 0 0;
		max-width: 100%;
		max-height: 92vh;
		overflow-y: auto;
	}

	.driveev-modal-header {
		border-radius: 16px 16px 0 0;
	}

	.driveev-modal-body {
		padding: 1.25rem 1rem 2rem;
	}

	.driveev-modal-title {
		font-size: 1rem;
	}
}
