/* Adams WhatsApp Form Builder
   Built on top of the site's own design tokens (Blocksy "theme-palette"
   custom properties) so it stays in sync with the brand colors set in
   Customizer > Colors, rather than hard-coding a separate palette. */

.awfb {
	--awfb-red: var(--theme-palette-color-1, #DA1F30);
	--awfb-grey-light: var(--theme-palette-color-2, #F2F2F2);
	--awfb-black: var(--theme-palette-color-3, #0A0A0A);
	--awfb-white: var(--theme-palette-color-4, #ffffff);
	--awfb-text: var(--theme-palette-color-5, #424242);
	--awfb-grey-lighter: var(--theme-palette-color-6, #F6F6F6);

	--awfb-border: var(--theme-form-field-border-initial-color, #c4c4c4);
	--awfb-border-focus: var(--theme-form-field-border-focus-color, #383838);
	--awfb-radius: var(--theme-button-border-radius, 3px);

	--awfb-font-heading: 'Stack Sans Headline', Arial, sans-serif;
	--awfb-font-body: 'Inter', Arial, sans-serif;

	max-width: 1350px;
	margin: 40px auto;
	padding: 0 16px;
	box-sizing: border-box;
	font-family: var(--awfb-font-body);
	color: var(--awfb-text);
}

.awfb *,
.awfb *::before,
.awfb *::after {
	box-sizing: border-box;
}

/* Desktop: builder on the left, a sticky live preview on the right. */
@media (min-width: 1000px) {
	.awfb:not(.is-fill-mode) {
		display: grid;
		grid-template-columns: 1.15fr 0.85fr;
		gap: 32px;
		align-items: start;
	}

	.awfb__preview-wrap {
		position: sticky;
		top: 20px;
	}
}

.awfb.is-fill-mode .awfb__builder {
	display: none;
}

.awfb.is-fill-mode .awfb__preview-wrap {
	max-width: 640px;
	margin: 0 auto;
}

/* On the standalone "open form" page, show only the form itself --
   the "Preview" section heading (meaningful only inside the builder)
   is hidden; the site header and page banner are hidden via JS since
   they sit outside this shortcode's own markup. */
.awfb.is-fill-mode #awfb-preview-heading {
	display: none;
}

/* Card / section shell, shared by the builder and the preview/fill frame */

.awfb__card,
.awfb__preview-frame {
	background: var(--awfb-white);
	border: 1px solid var(--awfb-grey-light);
	border-radius: 8px;
	box-shadow: 0 2px 20px rgba(10, 10, 10, 0.06);
}

.awfb__card {
	padding: 32px;
}

.awfb__preview-frame {
	padding: 28px;
}

@media (max-width: 480px) {
	.awfb__card,
	.awfb__preview-frame {
		padding: 22px 18px;
	}
}

.awfb__section + .awfb__section {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--awfb-grey-light);
}

.awfb__section-title {
	font-family: var(--awfb-font-heading);
	font-weight: 500;
	font-size: 20px;
	line-height: 1.3;
	color: var(--awfb-black);
	margin: 0 0 18px;
}

.awfb__preview-wrap .awfb__section-title {
	margin-bottom: 14px;
}

/* Form controls */

.awfb__field-group {
	margin-bottom: 18px;
}

.awfb__field-group:last-of-type {
	margin-bottom: 0;
}

.awfb__two-col {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 18px;
}

@media (min-width: 560px) {
	.awfb__two-col {
		grid-template-columns: 1fr 1fr;
	}
}

.awfb__label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--awfb-black);
	margin-bottom: 8px;
}

.awfb__optional {
	font-weight: 400;
	color: var(--awfb-text);
	opacity: 0.65;
}

.awfb__hint {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--awfb-text);
	opacity: 0.7;
}

.awfb__phone-row {
	display: flex;
	gap: 10px;
}

.awfb__select,
.awfb__input,
.awfb__textarea {
	width: 100%;
	font-family: var(--awfb-font-body);
	font-size: 16px;
	color: var(--awfb-black);
	background: var(--awfb-white);
	border: 1px solid var(--awfb-border);
	border-radius: var(--awfb-radius);
	padding: 11px 14px;
	min-height: 46px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
}

.awfb__select {
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23424242' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 30px;
}

#awfb-country.awfb__select {
	flex: 0 0 150px;
}

.awfb__input {
	flex: 1 1 auto;
	min-width: 0;
}

.awfb__textarea {
	resize: vertical;
	min-height: 72px;
	line-height: 1.5;
}

.awfb__select:focus,
.awfb__input:focus,
.awfb__textarea:focus {
	outline: none;
	border-color: var(--awfb-border-focus);
	box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

.awfb__input.is-invalid,
.awfb__select.is-invalid {
	border-color: var(--awfb-red);
}

.awfb__link-output {
	font-family: var(--awfb-font-body);
	font-size: 13px;
	color: var(--awfb-text);
	background: var(--awfb-grey-lighter);
	border: 1px solid var(--awfb-grey-light);
	resize: vertical;
	min-height: 70px;
	line-height: 1.5;
	word-break: break-all;
}

/* Segmented toggle group (Start from: Enquiry / Booking / Order / Feedback) */

.awfb__toggle-group {
	display: flex;
	flex-wrap: wrap;
	border: 1px solid var(--awfb-border);
	border-radius: var(--awfb-radius);
	overflow: hidden;
}

.awfb__toggle-btn {
	appearance: none;
	-webkit-appearance: none;
	border: none;
	border-right: 1px solid var(--awfb-border);
	background: var(--awfb-white);
	color: var(--awfb-text);
	font-family: var(--awfb-font-body);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: 10px 12px;
	cursor: pointer;
	flex: 1 1 auto;
	min-width: 90px;
	transition: background .15s ease, color .15s ease;
}

.awfb__toggle-btn:last-child {
	border-right: none;
}

.awfb__toggle-btn:hover {
	background: var(--awfb-grey-lighter);
}

.awfb__toggle-btn.is-active {
	background: var(--awfb-red);
	color: var(--awfb-white);
}

.awfb__toggle-btn.is-active:hover {
	background: var(--awfb-red);
}

@media (max-width: 480px) {
	.awfb__toggle-btn {
		min-width: 45%;
		border-bottom: 1px solid var(--awfb-border);
	}
}

/* Buttons */

.awfb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--awfb-font-heading);
	font-weight: 500;
	font-size: 15.5px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	border-radius: var(--awfb-radius);
	min-height: 45px;
	padding: 10px 20px;
	border: 2px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
	white-space: nowrap;
}

.awfb__btn:active {
	transform: translateY(1px);
}

.awfb__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.awfb__btn--full {
	width: 100%;
}

.awfb__btn--primary {
	background-color: var(--awfb-red);
	border-color: var(--awfb-red);
	color: var(--awfb-white);
}

.awfb__btn--primary:hover {
	background-color: var(--awfb-black);
	border-color: var(--awfb-black);
	color: var(--awfb-white);
}

.awfb__btn--outline {
	background-color: transparent;
	border-color: var(--awfb-red);
	color: var(--awfb-red);
}

.awfb__btn--outline:hover {
	background-color: var(--awfb-red);
	color: var(--awfb-white);
}

.awfb__btn--dark {
	background-color: var(--awfb-black);
	border-color: var(--awfb-black);
	color: var(--awfb-white);
}

.awfb__btn--dark:hover {
	background-color: var(--awfb-red);
	border-color: var(--awfb-red);
}

.awfb__btn--copied {
	background-color: var(--awfb-black) !important;
	border-color: var(--awfb-black) !important;
}

.awfb__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.awfb__actions .awfb__btn {
	flex: 1 1 auto;
}

/* Questions list */

.awfb__questions {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
}

.awfb__question {
	background: var(--awfb-grey-lighter);
	border: 1px solid var(--awfb-grey-light);
	border-radius: var(--awfb-radius);
	padding: 14px;
}

.awfb__question-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.awfb__question-head .awfb__input {
	min-height: 46px;
}

.awfb__question-icon-btn {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--awfb-white);
	border: 1px solid var(--awfb-border);
	border-radius: var(--awfb-radius);
	color: var(--awfb-text);
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	padding: 0;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.awfb__question-icon-btn:hover:not(:disabled) {
	border-color: var(--awfb-border-focus);
	color: var(--awfb-black);
}

.awfb__question-icon-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.awfb__question-icon-btn--delete:hover:not(:disabled) {
	background: var(--awfb-red);
	border-color: var(--awfb-red);
	color: var(--awfb-white);
}

.awfb__question-controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.awfb__question-controls .awfb__select {
	min-height: 46px;
	width: auto;
	flex: 1 1 160px;
}

.awfb__question-required {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--awfb-black);
	white-space: nowrap;
	cursor: pointer;
}

.awfb__question-required input {
	width: 16px;
	height: 16px;
	accent-color: var(--awfb-red);
}

.awfb__question-options {
	margin-top: 10px;
	min-height: 64px;
	font-size: 14px;
}

/* Preview / fill form fields */

.awfb__preview-business {
	font-family: var(--awfb-font-heading);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--awfb-red);
	margin: 0 0 6px;
}

.awfb__preview-title {
	font-family: var(--awfb-font-heading);
	font-weight: 500;
	font-size: 24px;
	line-height: 1.3;
	color: var(--awfb-black);
	margin: 0 0 8px;
}

.awfb__preview-desc {
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--awfb-text);
	margin: 0 0 22px;
}

.awfb__preview-title:last-of-type {
	margin-bottom: 22px;
}

.awfb__preview-fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.awfb__preview-field-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--awfb-black);
	margin-bottom: 8px;
}

.awfb__preview-empty {
	font-size: 14px;
	color: var(--awfb-text);
	opacity: 0.6;
	font-style: italic;
}

.awfb__preview-footer {
	display: block;
	margin: 18px 0 0;
	text-align: center;
	font-size: 12px;
	color: var(--awfb-text);
	opacity: 0.55;
	text-decoration: none;
}

.awfb__preview-footer:hover {
	opacity: 0.85;
	text-decoration: underline;
}

/* QR code */

.awfb__qr-wrap {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px dashed var(--awfb-grey-light);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.awfb__qr-box {
	background: var(--awfb-white);
	border: 1px solid var(--awfb-grey-light);
	border-radius: var(--awfb-radius);
	padding: 16px;
	display: inline-flex;
}

.awfb__qr-box img,
.awfb__qr-box canvas {
	display: block;
	width: 180px;
	height: 180px;
}

/* Error */

.awfb__error {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: var(--awfb-radius);
	background: rgba(218, 31, 48, 0.08);
	border: 1px solid rgba(218, 31, 48, 0.25);
	color: var(--awfb-red);
	font-size: 14px;
	line-height: 1.5;
}

@media (max-width: 420px) {
	.awfb__phone-row {
		flex-direction: column;
	}
	#awfb-country.awfb__select {
		flex: 1 1 auto;
	}
	.awfb__actions {
		flex-direction: column;
	}
}
