/* Confirm & Masks for Contact Form 7: public styles. Kept light so the theme's own styles win. */

/* --- Confirmation screen ------------------------------------------------ */

.wpcf7-form.hvcm-confirming > :not(.hvcm-confirm-panel):not(.hidden-fields-container):not(.wpcf7-response-output):not(.hvcm-steps-live) {
	display: none;
}

.hvcm-confirm-panel {
	margin: 0 0 1em;
}

.hvcm-confirm-panel:focus {
	outline: none;
}

.hvcm-confirm-title {
	margin: 0 0 0.5em;
}

/* The title receives focus programmatically so screen readers announce it; no ring needed. */
.hvcm-confirm-title:focus {
	outline: none;
}

/* Buttons: block themes style them through .wp-element-button; classic themes get this fallback. */
.hvcm-button {
	cursor: pointer;
	font: inherit;
}

.hvcm-button:not(.wp-element-button) {
	padding: 0.6em 1.4em;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	line-height: 1.2;
}

.hvcm-button:not(.wp-element-button).hvcm-send,
.hvcm-button:not(.wp-element-button).hvcm-next {
	background: #1e1e1e;
	border-color: #1e1e1e;
	color: #fff;
}

.hvcm-button:disabled {
	opacity: 0.6;
	cursor: default;
}

.hvcm-confirm-intro {
	margin: 0 0 1em;
}

.hvcm-confirm-list {
	margin: 0 0 1.5em;
	padding: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.hvcm-confirm-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 1em;
	padding: 0.6em 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	margin: 0;
}

.hvcm-confirm-row dt {
	flex: 0 0 32%;
	max-width: 32%;
	margin: 0;
	font-weight: 600;
	word-break: break-word;
}

.hvcm-confirm-row dd {
	flex: 1 1 60%;
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.hvcm-confirm-empty {
	opacity: 0.6;
}

@media (max-width: 600px) {
	.hvcm-confirm-row dt,
	.hvcm-confirm-row dd {
		flex-basis: 100%;
		max-width: none;
	}
}

.hvcm-confirm-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em;
}

.hvcm-confirm-actions .wpcf7-spinner {
	visibility: hidden;
}

.wpcf7-form.submitting .hvcm-confirm-actions .wpcf7-spinner {
	visibility: visible;
}

/* Legacy [confirm] templates: the old [submit] button is only used by the confirmation screen now. */
.wpcf7-form.hvcm-legacy-confirm .wpcf7-submit:not(.hvcm-confirm-button):not(.hvcm-send) {
	display: none;
}

/* Pop-up mode */
.hvcm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1em;
	background: rgba(0, 0, 0, 0.55);
	box-sizing: border-box;
}

.hvcm-modal .hvcm-confirm-panel {
	background: #fff;
	color: #1e1e1e;
	max-width: 640px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	padding: 1.5em;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	box-sizing: border-box;
}

body.hvcm-modal-open {
	overflow: hidden;
}

/* --- Multi-step ---------------------------------------------------------- */

.hvcm-step-break {
	display: none;
}

.hvcm-step[hidden] {
	display: none;
}

.hvcm-steps-progress {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	list-style: none;
	margin: 0 0 1.5em;
	padding: 0;
	counter-reset: hvcm-step;
}

.hvcm-steps-progress li {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin: 0;
	opacity: 0.55;
}

.hvcm-steps-progress li::before {
	counter-increment: hvcm-step;
	content: counter(hvcm-step);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8em;
	height: 1.8em;
	border-radius: 50%;
	border: 2px solid currentColor;
	font-size: 0.85em;
	font-weight: 700;
}

.hvcm-steps-progress li[aria-current="step"] {
	opacity: 1;
	font-weight: 600;
}

.hvcm-steps-progress li.hvcm-step-done {
	opacity: 0.8;
}

.hvcm-steps-progress li.hvcm-step-done::before {
	content: "\2713";
}

.hvcm-steps-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin-top: 1em;
}

.hvcm-steps-nav .hvcm-next {
	margin-left: auto;
}

.hvcm-steps-live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}
