/* Dream Forms — frontend styles. BEM-style with df- prefix, minimal and theme-friendly. */

.df-form {
	max-width: 640px;
	margin: 0 auto;
	font-family: inherit;
}

.df-field {
	margin: 0 0 1.25rem;
}

.df-label {
	display: block;
	font-weight: 600;
	margin: 0 0 0.35rem;
}

.df-required {
	color: #c0392b;
	margin-left: 2px;
}

.df-input,
.df-form input[type="text"],
.df-form input[type="email"],
.df-form input[type="number"],
.df-form input[type="date"],
.df-form select,
.df-form textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1px solid #cfd4dc;
	border-radius: 6px;
	font: inherit;
	background: #fff;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	box-sizing: border-box;
}

.df-input:focus,
.df-form input:focus,
.df-form select:focus,
.df-form textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Own the dropdown chevron explicitly. Without this, the browser/theme select
   arrow (or an inherited background-image) can tile across the control. We reset
   appearance and paint a single, pinned SVG chevron. Multi-selects keep the
   native list UI. */
.df-form select:not([multiple]) {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	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='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 0.7rem auto;
	padding-right: 2.25rem;
}

.df-field--has-error .df-input,
.df-field--has-error input,
.df-field--has-error select,
.df-field--has-error textarea {
	border-color: #c0392b;
}

.df-choices {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.df-choice {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

.df-description {
	font-size: 0.875em;
	color: #6b7280;
	margin: 0.35rem 0 0;
}

.df-errors {
	list-style: none;
	padding: 0;
	margin: 0.35rem 0 0;
	color: #c0392b;
	font-size: 0.875em;
}

.df-section-title {
	margin: 1.5rem 0 0.25rem;
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 0.25rem;
}

.df-actions {
	margin-top: 1.5rem;
}

.df-submit {
	background: #2563eb;
	color: #fff;
	border: none;
	padding: 0.75rem 1.5rem;
	font: inherit;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	transition: background 120ms ease;
}

.df-submit:hover { background: #1d4ed8; }
.df-submit:disabled { background: #94a3b8; cursor: wait; }

.df-message {
	padding: 0.85rem 1rem;
	border-radius: 6px;
	margin: 0 0 1rem;
}

.df-message--success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.df-message--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.df-page { display: none; }
.df-page.is-active { display: block; }

.df-page-nav {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.df-prev, .df-next {
	background: #fff;
	color: #2563eb;
	border: 1px solid #2563eb;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	font: inherit;
	cursor: pointer;
}

.df-next { background: #2563eb; color: #fff; }

.df-progress {
	list-style: none;
	padding: 0;
	margin: 0 0 1.5rem;
	display: flex;
	gap: 0.5rem;
	counter-reset: df-step;
}

.df-progress__step {
	flex: 1;
	padding: 0.6rem 0.5rem;
	background: #f3f4f6;
	border-radius: 6px;
	font-size: 0.875em;
	color: #6b7280;
	text-align: center;
	border: 1px solid #e5e7eb;
	transition: all 150ms;
}

.df-progress__step.is-active {
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
}

.df-progress__step.is-done {
	background: #d1fae5;
	color: #065f46;
	border-color: #a7f3d0;
}

.df-progress__num {
	display: inline-block;
	font-weight: 700;
	margin-right: 0.35rem;
}

.df-file-help {
	font-size: 0.8em;
	color: #6b7280;
	margin: 0.2rem 0 0;
}

.df-file-existing {
	font-size: 0.85em;
	margin: 0.3rem 0 0;
}

.df-stripe-element {
	padding: 0.75rem;
	border: 1px solid #cfd4dc;
	border-radius: 6px;
	background: #fff;
}

.df-signature-pad {
	border: 1px solid #cfd4dc;
	border-radius: 6px;
	background: #fff;
	touch-action: none;
}

.df-signature-actions {
	margin-top: 0.4rem;
}

/* Address grid */
.df-address-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}
.df-address-cell--street,
.df-address-cell--street2 { grid-column: 1 / -1; }
.df-address-cell label {
	display: block;
	font-size: 0.85em;
	color: #6b7280;
	margin-bottom: 0.15rem;
}
.df-address-cell input,
.df-name-cell input {
	width: 100%;
	padding: 0.55rem 0.75rem;
	border: 1px solid #cfd4dc;
	border-radius: 6px;
	font: inherit;
	box-sizing: border-box;
}

/* Name grid */
.df-name-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.5rem;
}
.df-name-cell label {
	display: block;
	font-size: 0.85em;
	color: #6b7280;
	margin-bottom: 0.15rem;
}

/* List / repeater */
.df-list-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.df-list-row {
	display: flex;
	gap: 0.4rem;
	align-items: center;
}
.df-list-row input { flex: 1; }
.df-list-add,
.df-list-remove {
	background: #fff;
	color: #2563eb;
	border: 1px solid #2563eb;
	padding: 0.35rem 0.7rem;
	border-radius: 6px;
	font: inherit;
	cursor: pointer;
	line-height: 1;
}
.df-list-add {
	align-self: flex-start;
	margin-top: 0.25rem;
}
.df-list-remove {
	color: #c0392b;
	border-color: #c0392b;
	padding: 0.25rem 0.55rem;
}

/* Consent */
.df-field--consent .df-label { display: none; }
.df-consent {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	padding: 0.6rem 0.85rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
}
.df-consent input { margin-top: 0.2rem; }
.df-consent__text {
	flex: 1;
	font-size: 0.95em;
	line-height: 1.4;
}

/* Save & continue */
.df-save-continue {
	background: transparent;
	color: #2563eb;
	border: 1px solid #2563eb;
	padding: 0.65rem 1rem;
	margin-left: 0.5rem;
	border-radius: 6px;
	font: inherit;
	cursor: pointer;
}

/* Calculation field */
.df-calculation {
	background: #f9fafb;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

/* Payment summary */
.df-payment-summary {
	margin: 0 0 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #ecfdf5;
	border-radius: 6px;
	color: #065f46;
}

/* Pricing suite */
.df-product {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.65rem 0.85rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}
.df-product__name { font-weight: 600; }
.df-product__price { font-variant-numeric: tabular-nums; color: #065f46; }

.df-options {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.df-option-choice {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	cursor: pointer;
}

.df-total {
	display: flex;
	gap: 0.4rem;
	align-items: baseline;
	padding: 0.65rem 0.85rem;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 6px;
	font-size: 1.1em;
	font-weight: 700;
	color: #065f46;
}
.df-total__amount { font-variant-numeric: tabular-nums; }
.df-total__currency { font-size: 0.8em; opacity: 0.75; }

/* Multi-select */
.df-field--multiselect select[multiple] {
	min-height: 6rem;
}

/* Turnstile / CAPTCHA */
.df-field--captcha .df-label { display: none; }
.df-captcha-missing {
	color: #c0392b;
	font-style: italic;
}
.cf-turnstile { margin: 0.25rem 0; }

/* Choices editor with price column (builder admin only — leaks in via build/) */
.dream-forms-choices__row--priced {
	grid-template-columns: 1fr 1fr 100px auto;
}
