
.tgwcfb_form_page_settings {
	#wpwrap {
		background: #FAFAFC;
	}
}

#tgwcfb-settings {
	margin-left: -10px;
	padding-inline: 10px;

	@media (min-width: 782px) {
		margin-left: -20px;
	}

	.components-form-toggle.is-checked .components-form-toggle__track {
		background: #3858e9;
	}

	.components-toggle-group-control {
		border: none !important;

		&:focus {
			border: none !important;
			outline: none;
		}

		&:active {
			border: none !important;
			outline: none;
		}

		&:focus-within {
			box-shadow: 0 0 0 0 var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
			outline: none;
		}
	}

	.components-base-control__help {
		font-style: italic;
	}

	.tgwcfb-container {
		max-width: 780px;
		margin: auto;
		padding: 28px 32px;
		background-color: #fff;
		border: 1px solid #EDF2F7;
		border-radius: 8px;
	}

	.tgwcfb-header {
		background-color: #fff;
		margin-left: -10px;
		margin-right: -10px;
		margin-bottom: 32px;
		border: 1px solid #dcdcde;
		display: flex;
		//justify-content: space-between;
		padding-inline: 24px;
		flex-wrap: wrap;

		@media (max-width: 768px) {
			padding-inline: 16px;
		}

		.tgwcfb-logo {
			display: flex;
			align-items: center;
			padding-right: 24px;
			border-right: 1px solid #EDF2F7;
		}
	}

	.tgwcfb-settings {
		min-height: 150px;
		position: relative;

		.dashicons-info-outline {
			font-size: 16px !important;
		}

		.components-button {
			outline: 0 solid #0000;
		}

		> .components-spinner {
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translate(-50%, -50%);
		}

		.tgwcfb-setting {

			.components-text-control__input, .components-input-control__backdrop {
				min-height: 38px !important;
				max-width: 100%;
				padding: 0 16px;
				-webkit-border-radius: 4px;
				-moz-border-radius: 4px;
				border-radius: 4px;
				font-size: 14px;
				border-color: #E1E1E1;
			}

			.tgwcfb-setting {
				.components-select-control__input,
				.components-text-control__input {
						min-height: 38px !important;
					max-width: 100%;
					padding: 0 16px;
					-webkit-border-radius: 4px;
					-moz-border-radius: 4px;
					border-radius: 4px;
					font-size: 14px;
					border-color: #E1E1E1;
				}

				.components-input-control__backdrop {
					border-color: #E1E1E1;
					border-radius: 4px;
				}
			}

			label:not( .components-checkbox-control__label ),
			.components-base-control__label{
				display: inline-flex;
				align-items: center;
				font-weight: 500;
				text-transform: capitalize;
				font-size: 16px;
				color: #383838;

				&.no-margin {
					margin: 0;
				}
			}
		}

		> .components-base-control {
			margin-bottom: 20px;
			> .components-base-control__field {
				margin-bottom: 0;
			}
			> .components-base-control__help {
				margin: 10px 0 0;
			}
		}

		.is-primary {
			background: #2563EB;
			font-size: 14px;
			-webkit-border-radius: 3px;
			-moz-border-radius: 3px;
			border-radius: 3px;
			margin-top: 20px;
		}
	}

	.tgwcfb-editor-body {
		padding: 20px;
		min-height: 240px;
		width: 100%;
	}

	.tgwcfb-container {
		align-items: center;
		justify-content: space-between;
	}

	.tgwcfb-header {
		nav {
			display: flex;
			margin-left: 24px;
			column-gap: 30px;

			a {
				padding-bottom: 30px;
				padding-top: 30px;
				text-decoration: none;
				color: #383838;
				font-weight: 500;
				position: relative;

				&:focus {
					box-shadow: 0 0 0 0 #2271b1;
				}

				&.active {
					color: #2563EB;
				}

				&.active:after {
					content: '';
					width: 100%;
					height: 2px;
					background-color: #2563EB;
					position: absolute;
					bottom: 0;
					left: 0;
				}
			}
		}
	}

	table {
		.components-base-control__field {
			margin-bottom: 0 !important;
		}

		&.widefat .check {
			width: 40px;
		}
	}
}

.tgwcfb-captcha {
	gap: 12px !important;

	&::before {
		background: none !important;
		border: none !important;
	}

	> div {
		background: #FFFFFF !important;
	}
}

.tgwcfb-recaptcha {
	background: transparent !important;
	color: #424242 !important;
	border: 1px solid #E1E1E1 !important;
	border-radius: 4px !important;
	transition: none !important;
	justify-content: flex-start !important;

	&:hover {
		background: transparent !important;
	}

	&:focus {
		background: transparent !important;
		box-shadow: none !important;
	}

	&[data-active-item="true"] {
		background: transparent !important;
		border: 1px solid #2563EB !important;
		color: #424242 !important;
	}

	&[data-active-item="true"]:hover {
		background: transparent !important;
	}

	&[data-active-item="true"]:focus {
		background: transparent !important;
		box-shadow: none !important;
	}
}

.tgwcfb-tooltip-content {
	display: block;
	white-space: normal;
	padding: 16px;
	font-weight: normal;
}

.tgwcfb-panel {
	margin: 0 0 20px;
	// border: 1px solid #dcdcde;
	transition: all 300ms;

	&.is-opened {
		.components-button {
			// background-color: #f6f7f7;
		}
	}

	.tgwcfb-panel-content {
		// background-color: #f6f7f7;
	}

	.components-button {
		display: flex;
		width: 100%;
		flex-direction: row-reverse;
		justify-content: space-between !important;
		padding: 16px;
		outline: none;
		font-weight: 500;
		text-align: left;
		color: #1e1e1e;
		border: none;
		box-shadow: none;
		transition: 0.1s background ease-in-out;
		height: auto;

		&:hover {
			background-color: #f6f7f7;
		}
		&:focus{
			box-shadow: none;
		}
	}

	.tgwcfb-panel-content-inner {
		padding: 0 16px 16px;
	}
}
.tgwcfb-input-to {
	width: 100%;
	display: block;
	margin-top: 5px;
}

.tgwcfb-input-control-wrapper-to {
	margin-bottom: 10px;
	display: flex;
	direction: row;
	gap: 5px;
}

/* Pro crown badge + popup (matches CMAP design) */
.tgwcfb-pro {
	position: relative;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;

	&:hover .tgwcfb-pro__popup,
	.tgwcfb-pro__popup:hover {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateX(-50%) translateY(0);
	}
}

.tgwcfb-pro__crown {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	background: #ff8c39;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;

	svg {
		width: 12px;
		height: 12px;

		path {
			stroke: #fff;
		}
	}
}

.tgwcfb-pro__popup {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	width: 240px;
	padding: 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
	text-align: left;
	white-space: normal;

	// hover bridge — fills gap between crown and card so cursor can reach the button
	&::before {
		content: "";
		position: absolute;
		top: -10px;
		left: 0;
		right: 0;
		height: 10px;
	}

	// arrow pointing up to the crown
	&::after {
		content: "";
		position: absolute;
		top: -7px;
		left: 50%;
		transform: translateX(-50%);
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 0 7px 7px;
		border-color: transparent transparent #fff;
		filter: drop-shadow(0 -1px 0 #e5e7eb);
	}
}

.tgwcfb-pro__popup-msg {
	display: block;
	font-size: 13px;
	color: #374151;
	margin: 0 0 12px;
	line-height: 1.5;
	font-weight: normal;
	text-transform: none;
}

.tgwcfb-pro__popup-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #ff8c39;
	color: #fff !important;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500 !important;
	text-decoration: none !important;
	text-transform: none;
	line-height: 1;
	transition: background 0.15s ease;

	&:hover {
		background: #e87b2a;
		color: #fff !important;
	}

	svg path {
		stroke: #fff;
	}
}

.tgwcfb-pro__popup-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	flex-shrink: 0;

	svg {
		width: 12px;
		height: 12px;
	}
}
