/**
 * Nejat Contact Form 7 Widget Styles
 * Follows Nejat design system with BEM naming and CSS tokens
 * Matches lp.nejatortho.com landing page design
 */

/* ── Root & Layout ──────────────────────────────────────────────────────── */
.nejat-cf7 {
	padding-top: var(--nejat-section-pad-v);
	padding-bottom: var(--nejat-section-pad-v);
}

.nejat-cf7__inner {
	max-width: var(--nejat-max-width);
	margin: 0 auto;
	padding-left: var(--nejat-gutter);
	padding-right: var(--nejat-gutter);
}

.nejat-cf7__content {
	max-width: 720px;
}

/* ── Title & Description ────────────────────────────────────────────────── */
.nejat-cf7__title {
	font-size: clamp(28px, 3vw, 36px);
	font-weight: 600;
	color: #2d2d2d;
	margin: 0 0 12px 0;
	line-height: 1.2;
}

.nejat-cf7__description {
	font-size: 16px;
	color: #7a7a7a;
	margin: 0 0 32px 0;
	line-height: 1.6;
}

/* ── Form Container ─────────────────────────────────────────────────────── */
.nejat-cf7__form .wpcf7-form {
	margin: 0;
}

/* Remove excessive spacing from br tags generated by Contact Form 7 */
.nejat-cf7__form br {
	display: none;
}

.nejat-cf7__form .wpcf7-form-control-wrap {
	display: block;
	position: relative;
	margin-bottom: 0;
}

/* Form row wrapper for 2-column layout */
.nejat-cf7__form p {
	margin: 0 0 20px 0;
}

/* ── Labels ─────────────────────────────────────────────────────────────── */
.nejat-cf7__form label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #4a4a4a;
	margin: 0 0 6px 0;
	line-height: 1.4;
}

/* Small example text inside labels */
.nejat-cf7__form label small {
	display: block;
	font-size: 13px;
	font-weight: normal;
	color: #999999;
	margin: 4px 0 8px 0;
	line-height: 1.3;
}

/* Required asterisk */
.nejat-cf7__form label .required {
	color: #e74c3c;
	margin-left: 2px;
}

.nejat-cf7__form .wpcf7-not-valid-tip {
	color: #e74c3c;
	font-size: 13px;
	margin-top: 6px;
}

/* ── Form Fields ────────────────────────────────────────────────────────── */
.nejat-cf7__form input[type="text"],
.nejat-cf7__form input[type="email"],
.nejat-cf7__form input[type="tel"],
.nejat-cf7__form input[type="url"],
.nejat-cf7__form input[type="number"],
.nejat-cf7__form input[type="date"],
.nejat-cf7__form select,
.nejat-cf7__form textarea {
	width: 100%;
	padding: 14px 18px;
	border: 1px solid #d8d8d8;
	border-radius: 6px;
	background-color: #f8f8f8;
	color: #2d2d2d;
	font-size: 15px;
	font-family: inherit;
	box-sizing: border-box;
	transition: all 0.25s ease;
	outline: none;
}

.nejat-cf7__form input[type="text"]:focus,
.nejat-cf7__form input[type="email"]:focus,
.nejat-cf7__form input[type="tel"]:focus,
.nejat-cf7__form input[type="url"]:focus,
.nejat-cf7__form input[type="number"]:focus,
.nejat-cf7__form input[type="date"]:focus,
.nejat-cf7__form select:focus,
.nejat-cf7__form textarea:focus {
	background-color: #ffffff;
	border-color: #4ab3c8;
	box-shadow: 0 0 0 3px rgba(74, 179, 200, 0.08);
}

.nejat-cf7__form input::placeholder,
.nejat-cf7__form textarea::placeholder {
	color: #b5b5b5;
	opacity: 1;
}

/* Textarea specific */
.nejat-cf7__form textarea {
	min-height: 120px;
	resize: vertical;
}

/* Select dropdown */
.nejat-cf7__form select {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 14px center;
	background-repeat: no-repeat;
	background-size: 18px;
	padding-right: 44px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

/* ── Checkbox & Radio Styling ───────────────────────────────────────────── */
.nejat-cf7__form .wpcf7-list-item {
	display: inline-block;
	margin: 0 24px 12px 0;
	vertical-align: middle;
}

.nejat-cf7__form .wpcf7-list-item-label {
	display: inline-block;
	cursor: pointer;
	font-size: 15px;
	color: #2d2d2d;
	font-weight: 400;
	user-select: none;
	position: relative;
	padding-left: 32px;
	line-height: 22px;
	vertical-align: middle;
}

/* Hide default checkbox/radio */
.nejat-cf7__form input[type="checkbox"],
.nejat-cf7__form input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
}

/* Custom checkbox box */
.nejat-cf7__form .wpcf7-list-item-label::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	border: 2px solid #d0d0d0;
	border-radius: 4px;
	background-color: #ffffff;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

/* Checkbox hover state */
.nejat-cf7__form .wpcf7-list-item-label:hover::before {
	border-color: #4ab3c8;
}

/* Checkbox checked state */
.nejat-cf7__form input[type="checkbox"]:checked + .wpcf7-list-item-label::before {
	background-color: #4ab3c8;
	border-color: #4ab3c8;
}

/* Checkbox checkmark */
.nejat-cf7__form input[type="checkbox"]:checked + .wpcf7-list-item-label::after {
	content: '';
	position: absolute;
	left: 7px;
	top: 50%;
	margin-top: -6px;
	width: 6px;
	height: 11px;
	border: solid white;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

/* Custom radio button */
.nejat-cf7__form input[type="radio"] + .wpcf7-list-item-label::before {
	border-radius: 50%;
}

/* Radio checked state */
.nejat-cf7__form input[type="radio"]:checked + .wpcf7-list-item-label::before {
	background-color: #4ab3c8;
	border-color: #4ab3c8;
	box-shadow: inset 0 0 0 4px #ffffff;
}

/* ── Submit Button ──────────────────────────────────────────────────────── */
/* Input elements don't support ::before/::after, so we use background transitions */
.nejat-cf7__form input[type="submit"],
.nejat-cf7__form .wpcf7-submit,
.nejat-cf7__form .wpcf7-form-control.wpcf7-submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	background: #1a1a1a !important;
	color: #ffffff !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	padding: 12px 22px !important;
	border: none !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	font-family: inherit !important;
	text-align: center !important;
	white-space: nowrap !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	margin-top: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
	position: relative !important;
	overflow: hidden !important;
	transition: all 0.55s ease !important;
}

.nejat-cf7__form input[type="submit"]:hover,
.nejat-cf7__form .wpcf7-submit:hover,
.nejat-cf7__form .wpcf7-form-control.wpcf7-submit:hover {
	background: #4ab3c8 !important;
	color: #ffffff !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.nejat-cf7__form input[type="submit"]:active {
	transform: translateY(1px);
}

/* ── Response Messages ──────────────────────────────────────────────────── */
.nejat-cf7__form .wpcf7-response-output {
	border: 1px solid #d0d0d0;
	background-color: #f8f8f8;
	color: #2d2d2d;
	padding: 16px 20px;
	margin: 24px 0 0 0;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.5;
}

.nejat-cf7__form .wpcf7-mail-sent-ok {
	border-color: #4ab3c8;
	background-color: #eef9fb;
	color: #2d2d2d;
}

.nejat-cf7__form .wpcf7-validation-errors,
.nejat-cf7__form .wpcf7-acceptance-missing {
	border-color: #e74c3c;
	background-color: #fef5f5;
	color: #e74c3c;
}

.nejat-cf7__form .wpcf7-spam-blocked {
	border-color: #f39c12;
	background-color: #fef9f5;
	color: #d68910;
}

/* Field-level validation errors */
.nejat-cf7__form .wpcf7-not-valid-tip {
	display: block;
	font-size: 13px;
	color: #e74c3c;
	margin-top: 6px;
	font-weight: 400;
}

.nejat-cf7__form .wpcf7-not-valid {
	border-color: #e74c3c !important;
	background-color: #fef5f5 !important;
}

/* ── Loading State ──────────────────────────────────────────────────────── */
.nejat-cf7__form .wpcf7-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(74, 179, 200, 0.2);
	border-top-color: #4ab3c8;
	border-radius: 50%;
	animation: nejat-cf7-spin 0.7s linear infinite;
	margin-left: 12px;
	vertical-align: middle;
}

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

/* ── File Upload ────────────────────────────────────────────────────────── */
.nejat-cf7__form input[type="file"] {
	font-size: 14px;
	padding: 10px 0;
	cursor: pointer;
	color: #2d2d2d;
}

.nejat-cf7__form input[type="file"]::file-selector-button {
	padding: 10px 18px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	background-color: #f8f8f8;
	color: #2d2d2d;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	margin-right: 12px;
	transition: all 0.25s ease;
}

.nejat-cf7__form input[type="file"]::file-selector-button:hover {
	background-color: #ffffff;
	border-color: #4ab3c8;
}

/* ── Acceptance Checkbox (e.g., Terms & Conditions) ─────────────────────── */
.nejat-cf7__form .wpcf7-acceptance .wpcf7-list-item {
	margin-right: 0;
	display: block;
}

.nejat-cf7__form .wpcf7-acceptance .wpcf7-list-item-label {
	font-size: 14px;
	line-height: 1.6;
	color: #4a4a4a;
}

.nejat-cf7__form .wpcf7-acceptance a {
	color: #4ab3c8;
	text-decoration: none;
	transition: color 0.2s ease;
}

.nejat-cf7__form .wpcf7-acceptance a:hover {
	color: #3ba5ba;
	text-decoration: underline;
}

/* ── Responsive Adjustments ─────────────────────────────────────────────── */
@media (max-width: 768px) {
	.nejat-cf7__title {
		font-size: clamp(24px, 6vw, 32px);
	}

	.nejat-cf7__description {
		font-size: 15px;
		margin-bottom: 28px;
	}

	.nejat-cf7__form input[type="submit"] {
		width: 100%;
		padding: 16px 24px;
	}

	.nejat-cf7__form .wpcf7-list-item {
		margin-right: 20px;
		margin-bottom: 14px;
	}
}

@media (max-width: 480px) {
	.nejat-cf7__content {
		max-width: 100%;
	}

	.nejat-cf7__form input[type="text"],
	.nejat-cf7__form input[type="email"],
	.nejat-cf7__form input[type="tel"],
	.nejat-cf7__form input[type="url"],
	.nejat-cf7__form input[type="number"],
	.nejat-cf7__form input[type="date"],
	.nejat-cf7__form select,
	.nejat-cf7__form textarea {
		font-size: 16px; /* Prevent zoom on iOS */
	}

	.nejat-cf7__form .wpcf7-list-item {
		margin-right: 16px;
	}
}

/* ── Multi-select custom UI ─────────────────────────────────────────────── */

/* Keep native multi-select accessible but visually hidden after JS wraps it */
.nejat-cf7__form select[multiple] {
	min-height: 120px;
	background-image: none;
	padding-right: 16px;
}

/* Custom multi-select container */
.nejat-cf7__form .multi-select-wrapper {
	position: relative;
}

/* The clickable "display" row that shows chosen tags + caret */
.nejat-cf7__form .multi-select-display {
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #c8c8c8;
	border-radius: 6px;
	background-color: #ffffff;
	cursor: pointer;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: flex-start;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.nejat-cf7__form .multi-select-display:focus,
.nejat-cf7__form .multi-select-display.active {
	outline: none;
	background-color: #ffffff;
	border-color: #4ab3c8;
	box-shadow: 0 0 0 3px rgba(74, 179, 200, 0.08);
}

/* Caret arrow */
.nejat-cf7__form .multi-select-display::after {
	content: '';
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #888;
	margin-left: auto;
	align-self: center;
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

.nejat-cf7__form .multi-select-display.active::after {
	transform: rotate(180deg);
	border-top-color: #4ab3c8;
}

/* Placeholder text */
.nejat-cf7__form .multi-select-placeholder {
	color: #333333;
	flex: 1;
	pointer-events: none;
	line-height: 1.5;
	font-size: 15px;
}

/* Selected value tags */
.nejat-cf7__form .multi-select-tag {
	background-color: #4ab3c8;
	color: #ffffff;
	padding: 4px 8px 4px 10px;
	border-radius: 16px;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	word-break: break-word;
}

/* Remove (×) button on a tag */
.nejat-cf7__form .multi-select-tag-remove {
	background: rgba(255, 255, 255, 0.3);
	border: none;
	color: #ffffff;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	line-height: 1;
	padding: 0;
	flex-shrink: 0;
	pointer-events: auto;
	transition: background 0.2s ease;
}

.nejat-cf7__form .multi-select-tag-remove:hover {
	background: rgba(255, 255, 255, 0.55);
}

/* Dropdown panel */
.nejat-cf7__form .multi-select-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid #4ab3c8;
	border-top: none;
	border-radius: 0 0 6px 6px;
	max-height: 220px;
	overflow-y: auto;
	z-index: 9999;
	display: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nejat-cf7__form .multi-select-dropdown.show {
	display: block;
}

/* Individual option row */
.nejat-cf7__form .multi-select-option {
	padding: 12px 16px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	font-size: 15px;
	color: #2d2d2d;
	transition: background-color 0.15s ease;
}

.nejat-cf7__form .multi-select-option:last-child {
	border-bottom: none;
}

.nejat-cf7__form .multi-select-option:hover {
	background-color: #f0fafb;
}

.nejat-cf7__form .multi-select-option.selected {
	background-color: #e6f7fa;
	color: #3ba5ba;
	font-weight: 500;
}

/* ── Side Info Panel — Two-Column Split Layout ──────────────────────────── */
.nejat-cf7__inner--split {
	display: flex;
	align-items: flex-start;
	gap: 60px;
}

/* Side panel on the left (default) */
.nejat-cf7--side-left .nejat-cf7__side-info {
	order: -1;
}

/* Side panel on the right */
.nejat-cf7--side-right .nejat-cf7__side-info {
	order: 1;
}

/* Both columns take equal width; form column can grow */
.nejat-cf7--split .nejat-cf7__side-info {
	flex: 1 1 0;
	min-width: 0;
}

.nejat-cf7--split .nejat-cf7__content {
	flex: 1 1 0;
	min-width: 0;
	max-width: none; /* override default single-column max-width */
}

/* ── Side Info Panel — Content ──────────────────────────────────────────── */
.nejat-cf7__side-eyebrow {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: #4ab3c8;
	text-transform: uppercase;
	margin: 0 0 10px 0;
	line-height: 1.4;
}

.nejat-cf7__side-headline {
	font-size: clamp(26px, 3vw, 40px);
	font-weight: 800;
	color: #1a1a1a;
	line-height: 1.15;
	margin: 0 0 12px 0;
}

.nejat-cf7__side-subheadline {
	font-size: 16px;
	font-weight: 600;
	color: #4ab3c8;
	margin: 0 0 16px 0;
	line-height: 1.4;
}

.nejat-cf7__side-description {
	font-size: 15px;
	color: #555555;
	line-height: 1.7;
	margin: 0 0 28px 0;
}

.nejat-cf7__side-description p {
	margin: 0 0 12px 0;
}

.nejat-cf7__side-description p:last-child {
	margin-bottom: 0;
}

/* ── Info Groups ────────────────────────────────────────────────────────── */
.nejat-cf7__side-groups {
	display: flex;
	flex-direction: column;
}

.nejat-cf7__side-group + .nejat-cf7__side-group {
	margin-top: 28px;
}

.nejat-cf7__side-group-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.nejat-cf7__side-group-icon {
	display: flex;
	align-items: center;
	font-size: 18px;
	color: #4ab3c8;
	flex-shrink: 0;
}

.nejat-cf7__side-group-icon svg,
.nejat-cf7__side-group-icon i {
	width: 1em;
	height: 1em;
}

.nejat-cf7__side-group-title {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.3;
}

/* ── Group Items ────────────────────────────────────────────────────────── */
.nejat-cf7__side-group-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nejat-cf7__side-group-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
	color: #555555;
	line-height: 1.5;
}

.nejat-cf7__side-group-item + .nejat-cf7__side-group-item {
	margin-top: 10px;
}

.nejat-cf7__side-check {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	color: #4ab3c8;
	margin-top: 2px; /* optical align with text */
}

.nejat-cf7__side-check svg {
	width: 16px;
	height: 16px;
}

/* ── Divider between groups ─────────────────────────────────────────────── */
.nejat-cf7__side-group + .nejat-cf7__side-group {
	padding-top: 28px;
	border-top: 1px solid #eeeeee;
}

/* ── Side Info Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
	.nejat-cf7__inner--split {
		flex-direction: column;
		gap: 40px;
	}

	.nejat-cf7--side-left .nejat-cf7__side-info,
	.nejat-cf7--side-right .nejat-cf7__side-info {
		order: -1; /* always show info panel above form on mobile */
	}

	.nejat-cf7--split .nejat-cf7__side-info,
	.nejat-cf7--split .nejat-cf7__content {
		flex: none;
		width: 100%;
	}

	.nejat-cf7__side-headline {
		font-size: clamp(24px, 6vw, 34px);
	}
}

