/* CiviCRM CF7 Leads — Campanha Grass
   Scoped to .ccfl-form-wrap so Elementor controls can override freely */

.ccfl-form-wrap {
	box-sizing: border-box;
	width: 100%;
}

.ccfl-form-heading {
	margin-top: 0;
	margin-bottom: 4px;
}

.ccfl-form-subheading {
	margin-top: 0;
	margin-bottom: 20px;
	opacity: 0.75;
}

/* ── Normalize CF7 form layout ─────────────────────────────── */

.ccfl-form-wrap .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ccfl-form-wrap .wpcf7-form p {
	margin: 0;
}

.ccfl-form-wrap .wpcf7-form p br {
    display: none;
}

.ccfl-form-wrap .wpcf7-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

/* Text / email / tel / number inputs + textarea + select */
.ccfl-form-wrap input:not([type=submit]):not([type=checkbox]):not([type=radio]),
.ccfl-form-wrap select,
.ccfl-form-wrap textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-size: 1rem;
	line-height: 1.5;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.ccfl-form-wrap 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='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.ccfl-form-wrap input:not([type=submit]):not([type=checkbox]):not([type=radio]):focus,
.ccfl-form-wrap select:focus,
.ccfl-form-wrap textarea:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* ── Checkboxes & radio ─────────────────────────────────────── */

.ccfl-form-wrap .wpcf7-checkbox,
.ccfl-form-wrap .wpcf7-radio {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ccfl-form-wrap .wpcf7-checkbox .wpcf7-list-item,
.ccfl-form-wrap .wpcf7-radio .wpcf7-list-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
}

.ccfl-form-wrap .wpcf7-checkbox .wpcf7-list-item input,
.ccfl-form-wrap .wpcf7-radio .wpcf7-list-item input {
	margin-top: 3px;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	cursor: pointer;
}

.ccfl-form-wrap .wpcf7-checkbox .wpcf7-list-item-label,
.ccfl-form-wrap .wpcf7-radio .wpcf7-list-item-label {
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}

/* ── Name fields row (for Escutas Presenciais) ─────────────────── */

.ccfl-name-row {
	display: flex;
	gap: 16px;
}

.ccfl-name-field,
.ccfl-sobrenome-field {
	flex: 1;
}

.ccfl-name-field label,
.ccfl-sobrenome-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
	.ccfl-name-row {
		flex-direction: column;
		gap: 16px;
	}
}

/* ── Acceptance (LGPD) ──────────────────────────────────────── */

/* Target the outer wrapper that contains both checkbox and text */
.ccfl-form-wrap p > .wpcf7-form-control-wrap {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

/* LGPD consent text color follows Elementor widget label color */
.ccfl-form-wrap .wpcf7-acceptance .wpcf7-list-item-label,
.ccfl-form-wrap .wpcf7-acceptance .wpcf7-list-item-label small {
	/* Inherit from the label color set by Elementor widget */
	color: inherit;
	transition: color 0.2s ease;
}

/* For Form 4 (Escutas Presenciais) and direct CF7 usage - inherit from form labels */
.ccfl-form-wrap .wpcf7-form-control-wrap[data-name="lgpd_consent"],
.ccfl-form-wrap .wpcf7-form-control-wrap[data-name="lgpd_consent"] small {
	/* Use the same color as form labels - will inherit Elementor widget styling */
	color: inherit;
}

/* Target the specific structure for LGPD consent text */
.ccfl-form-wrap p > .wpcf7-form-control-wrap[data-name="lgpd_consent"],
.ccfl-form-wrap p > .wpcf7-form-control-wrap[data-name="lgpd_consent"] small {
	color: inherit;
}

/* Target the sibling small element (privacy link) */
.ccfl-form-wrap p > .wpcf7-form-control-wrap[data-name="lgpd_consent"] + small,
.ccfl-form-wrap p .wpcf7-form-control-wrap[data-name="lgpd_consent"] + small {
	color: inherit;
}

/* More aggressive targeting for small elements */
.ccfl-form-wrap p small,
.ccfl-form-wrap p > small,
.ccfl-form-wrap small {
	color: inherit !important;
}

/* Manual override example - add this CSS to set custom color */
/* .ccfl-form-wrap .wpcf7-form-control-wrap[data-name="lgpd_consent"] {
    color: #your-color !important;
} */

.ccfl-form-wrap .wpcf7-acceptance .wpcf7-list-item {
	display: flex;
	align-items: center;
}

.ccfl-form-wrap .wpcf7-acceptance input[type=checkbox] {
	margin: 0;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	cursor: pointer;
}

/* Submit button styling - not full width */
.ccfl-form-wrap input[type=submit] {
	width: auto;
	min-width: 120px;
	max-width: 100%;
	display: inline-block;
}

/* ── Conditional LGPD sensível ──────────────────────────────── */

.ccfl-lgpd-sensivel-wrap {
	display: none;
}

.ccfl-lgpd-sensivel-wrap.ccfl-visible {
	display: block;
}

/* ── Submit button ──────────────────────────────────────────── */

.ccfl-form-wrap input[type=submit] {
	display: inline-block;
	padding: 12px 28px;
	background-color: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.ccfl-form-wrap input[type=submit]:hover {
	background-color: #1d4ed8;
}

.ccfl-form-wrap input[type=submit]:active {
	transform: scale(0.98);
}

/* ── CF7 response messages ──────────────────────────────────── */

.ccfl-form-wrap .wpcf7-response-output {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 0.9rem;
}

.ccfl-form-wrap .wpcf7-mail-sent-ok {
	background: #ecfdf5;
	border: 1px solid #6ee7b7;
	color: #065f46;
}

.ccfl-form-wrap .wpcf7-mail-sent-ng,
.ccfl-form-wrap .wpcf7-aborted {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
}

.ccfl-form-wrap .wpcf7-spam-blocked {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	color: #92400e;
}

/* ── Validation errors ──────────────────────────────────────── */

.ccfl-form-wrap .wpcf7-not-valid {
	border-color: #ef4444 !important;
}

.ccfl-form-wrap .wpcf7-not-valid-tip {
	display: block;
	margin-top: 4px;
	font-size: 0.8rem;
	color: #ef4444;
}

/* ── Spinner ────────────────────────────────────────────────── */

.ccfl-form-wrap .wpcf7-spinner {
	margin-left: 8px;
	vertical-align: middle;
}

/* ── Modal Button & Popup ───────────────────────────────────── */

.ccfl-modal-trigger {
	display: inline-block;
	padding: 12px 28px;
	background-color: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	text-align: center;
}

.ccfl-modal-trigger:hover {
	background-color: #1d4ed8;
}

.ccfl-modal-trigger:active {
	transform: scale(0.98);
}

.ccfl-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.6);
	z-index: 999999;
	justify-content: center;
	align-items: center;
	padding: 20px;
	/* Ensure modal breaks out of parent stacking contexts */
	transform: translateZ(0);
}

.ccfl-modal-overlay.ccfl-active {
	display: flex;
}

.ccfl-modal-container {
	background: #fff;
	border-radius: 8px;
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	animation: ccfl-modal-in 0.3s ease;
}

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

.ccfl-modal-header {
	padding: 20px 24px 0;
}

.ccfl-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	color: #666;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

.ccfl-modal-close:hover {
	background: #f0f0f0;
	color: #000;
}

.ccfl-modal-content {
	padding: 20px 24px;
}

.ccfl-modal-content .ccfl-form-wrap {
	padding: 0;
}

body.ccfl-modal-open {
	overflow: hidden;
}

/* Saiba mais consent toggle */

/* Override CF7's flex display on the outer acceptance wrap so text + link flow inline */
.ccfl-form-wrap .wpcf7-form p > .wpcf7-form-control-wrap:not([data-name]) {
	display: inline !important;
	flex-direction: unset;
}

.ccfl-consent-extra {
	display: none;
}

.ccfl-consent-extra.ccfl-visible {
	display: inline;
}

.ccfl-saiba-mais {
	cursor: pointer;
	text-decoration: underline;
	white-space: nowrap;
	margin-left: 0.25em;
}

.ccfl-saiba-mais:hover {
	text-decoration: none;
}

