/* FD Form Pro - frontend. Override the custom properties in your theme to restyle. */

.fdfp-wrap {
	--fdfp-accent: #2563eb;
	--fdfp-text: #1f2937;
	--fdfp-muted: #6b7280;
	--fdfp-border: #d1d5db;
	--fdfp-error: #dc2626;
	--fdfp-radius: 8px;
	--fdfp-gap: 18px;

	color: var(--fdfp-text);
	font-size: 16px;
	line-height: 1.5;
	max-width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

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

.fdfp-wrap [hidden] {
	display: none !important;
}

.fdfp-title {
	margin: 0 0 6px;
	font-size: 1.5rem;
}

.fdfp-description {
	margin: 0 0 var(--fdfp-gap);
	color: var(--fdfp-muted);
}

.fdfp-notice {
	padding: 12px 16px;
	border-radius: var(--fdfp-radius);
	background: #fef3c7;
	color: #92400e;
}

/* Progress (multi-step) */
.fdfp-progress {
	height: 6px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.fdfp-progress-bar {
	height: 100%;
	width: 0;
	background: var(--fdfp-accent);
	transition: width .3s ease;
}

.fdfp-progress-text {
	margin: 6px 0 var(--fdfp-gap);
	font-size: .875rem;
	color: var(--fdfp-muted);
}

/* Form layout */
.fdfp-form {
	display: block;
}

.fdfp-page {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.fdfp-page-title:empty {
	display: none;
}

.fdfp-page-title {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 var(--fdfp-gap);
	padding: 0;
}

.fdfp-field {
	margin: 0 0 var(--fdfp-gap);
}

.fdfp-field.fdfp-is-hidden {
	display: none;
}

.fdfp-field.fdfp-type-consent {
	margin-top: 4px;
}

.fdfp-w-half {
	display: inline-block;
	width: calc(50% - 8px);
	vertical-align: top;
}

.fdfp-w-half:nth-child(odd) {
	margin-right: 8px;
}

.fdfp-w-full {
	display: block;
	width: 100%;
}

.fdfp-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.fdfp-req {
	color: var(--fdfp-error);
}

.fdfp-desc,
.fdfp-hint {
	display: block;
	margin: 6px 0 0;
	font-size: .875rem;
	color: var(--fdfp-muted);
}

.fdfp-field input[type="text"],
.fdfp-field input[type="email"],
.fdfp-field input[type="url"],
.fdfp-field input[type="tel"],
.fdfp-field input[type="number"],
.fdfp-field input[type="date"],
.fdfp-field select,
.fdfp-field textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--fdfp-border);
	border-radius: var(--fdfp-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.fdfp-field input:focus,
.fdfp-field select:focus,
.fdfp-field textarea:focus {
	outline: none;
	border-color: var(--fdfp-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.fdfp-field textarea {
	resize: vertical;
	min-height: 96px;
}

.fdfp-field input[type="file"] {
	display: block;
	width: 100%;
}

.fdfp-field:has(input:disabled) {
	opacity: .6;
}

.fdfp-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fdfp-choice,
.fdfp-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
	font-weight: normal;
}

.fdfp-choice input,
.fdfp-check input {
	margin-top: 4px;
}

/* Errors */
.fdfp-error {
	display: none;
	margin-top: 6px;
	font-size: .875rem;
	color: var(--fdfp-error);
}

.fdfp-field.has-error .fdfp-error {
	display: block;
}

.fdfp-field.has-error input,
.fdfp-field.has-error select,
.fdfp-field.has-error textarea {
	border-color: var(--fdfp-error);
}

.fdfp-alert {
	padding: 12px 16px;
	margin-bottom: var(--fdfp-gap);
	border-radius: var(--fdfp-radius);
	background: #fee2e2;
	color: #991b1b;
}

/* Honeypot: visually hidden but present in the DOM for bots */
.fdfp-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Navigation & buttons */
.fdfp-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 8px;
}

.fdfp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--fdfp-accent);
	border: 0;
	border-radius: var(--fdfp-radius);
	cursor: pointer;
	transition: filter .15s ease, opacity .15s ease;
}

.fdfp-btn:hover {
	filter: brightness(.95);
}

.fdfp-btn:disabled {
	opacity: .6;
	cursor: wait;
}

.fdfp-btn-secondary {
	background: #e5e7eb;
	color: var(--fdfp-text);
}

.fdfp-success {
	padding: 16px 18px;
	border-radius: var(--fdfp-radius);
	background: #dcfce7;
	color: #166534;
}

.fdfp-success p:first-child {
	margin-top: 0;
}

@media (max-width: 600px) {
	.fdfp-w-half {
		display: block;
		width: 100%;
		margin-right: 0 !important;
	}

	.fdfp-nav .fdfp-btn {
		flex: 1 1 auto;
	}
}

/* ---- v1.2.0: name / address, star rating, payment ---- */
.fdfp-subfields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.fdfp-sub {
	display: block;
	min-width: 0;
}
.fdfp-sub > span {
	display: block;
	font-size: 0.9em;
	margin-bottom: 4px;
}
.fdfp-sub input {
	width: 100%;
	box-sizing: border-box;
}
@media (max-width: 480px) {
	.fdfp-subfields {
		grid-template-columns: 1fr;
	}
}

.fdfp-rating {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 4px;
	font-size: 28px;
	line-height: 1;
}
.fdfp-star-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}
.fdfp-star {
	cursor: pointer;
	color: #cfd3da;
	user-select: none;
}
.fdfp-star-input:checked ~ .fdfp-star {
	color: #f5b301;
}
.fdfp-star-input:focus-visible + .fdfp-star {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 4px;
}
.fdfp-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.fdfp-amount {
	font-size: 1.15em;
	margin: 4px 0 8px;
}
.fdfp-notice {
	padding: 12px 14px;
	margin: 0 0 16px;
	border: 1px solid #b6d4fe;
	border-radius: 6px;
	background: #eef6ff;
}

/* ---- v1.3.0: image/icon cards, amount chips, collapsible sections, sidebar summary ---- */

.fdfp-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.fdfp-card-choice {
	display: block;
	cursor: pointer;
	position: relative;
}

.fdfp-card-choice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.fdfp-card-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	height: 100%;
	padding: 18px 12px;
	text-align: center;
	background: #fff;
	border: 1px solid var(--fdfp-border);
	border-radius: var(--fdfp-radius);
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.fdfp-card-choice:hover .fdfp-card-box {
	border-color: var(--fdfp-accent);
}

.fdfp-card-choice input:checked + .fdfp-card-box {
	border-color: var(--fdfp-accent);
	box-shadow: 0 0 0 2px var(--fdfp-accent) inset;
}

.fdfp-card-choice input:focus-visible + .fdfp-card-box {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .35);
}

.fdfp-card-img {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.fdfp-card-emoji {
	font-size: 36px;
	line-height: 1;
}

.fdfp-card-title {
	font-weight: 600;
}

.fdfp-card-sub {
	font-size: .85rem;
	color: var(--fdfp-muted);
}

/* Amount chips */
.fdfp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.fdfp-chip {
	cursor: pointer;
	position: relative;
}

.fdfp-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.fdfp-chip span {
	display: inline-block;
	min-width: 96px;
	padding: 10px 14px;
	text-align: center;
	font-weight: 600;
	background: #fff;
	border: 1px solid var(--fdfp-border);
	border-radius: var(--fdfp-radius);
	transition: all .15s ease;
}

.fdfp-chip:hover span {
	border-color: var(--fdfp-accent);
}

.fdfp-chip input:checked + span {
	background: var(--fdfp-accent);
	border-color: var(--fdfp-accent);
	color: #fff;
}

.fdfp-chip input:focus-visible + span {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .35);
}

.fdfp-other-amount {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 0 12px;
	background: #fff;
	border: 1px solid var(--fdfp-border);
	border-radius: var(--fdfp-radius);
}

.fdfp-other-amount .fdfp-symbol {
	color: var(--fdfp-muted);
	font-weight: 600;
}

.fdfp-other-amount input {
	flex: 1;
	min-width: 0;
	padding: 10px 0;
	border: 0;
	font: inherit;
	background: transparent;
}

.fdfp-other-amount input:focus {
	outline: none;
}

.fdfp-other-amount:focus-within {
	border-color: var(--fdfp-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

/* Collapsible sections */
.fdfp-section {
	margin: 0 0 var(--fdfp-gap);
	border-top: 1px dashed var(--fdfp-border);
	padding-top: 12px;
}

.fdfp-section > summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 1.05rem;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.fdfp-section > summary::-webkit-details-marker {
	display: none;
}

.fdfp-section > summary::after {
	content: '+';
	font-size: 1.4rem;
	line-height: 1;
	color: var(--fdfp-muted);
}

.fdfp-section[open] > summary::after {
	content: '\2212';
}

.fdfp-section-body {
	padding-top: 14px;
}

/* Two-column layout with order summary */
.fdfp-layout-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	align-items: start;
}

.fdfp-layout-sidebar .fdfp-submit {
	display: none !important;
}

.fdfp-summary {
	position: sticky;
	top: 24px;
	padding: 22px;
	background: #fff;
	border: 1px solid var(--fdfp-border);
	border-radius: var(--fdfp-radius);
}

.fdfp-summary-title {
	margin: 0 0 12px;
	font-size: 1.15rem;
}

.fdfp-sum-row,
.fdfp-sum-total {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f1f1;
}

.fdfp-sum-total {
	border-bottom: 0;
	font-size: 1.1rem;
	margin-top: 4px;
}

.fdfp-sum-value,
.fdfp-sum-amount {
	text-align: right;
}

.fdfp-summary-submit {
	display: block;
	width: 100%;
	margin-top: 16px;
}

@media (max-width: 860px) {
	.fdfp-layout-sidebar {
		grid-template-columns: 1fr;
	}

	.fdfp-layout-sidebar .fdfp-summary {
		position: static;
	}

	.fdfp-layout-sidebar .fdfp-submit {
		display: none !important;
	}
}
