/**
 * DOWYT Studio Application Form — front-end styles.
 *
 * Mobile-first. Scoped entirely under .dst-form-wrap so theme styles
 * are not affected. Brand colors arrive as CSS custom properties set
 * inline from plugin settings:
 *   --dst-primary  (text / brand)
 *   --dst-accent   (buttons / highlights)
 *
 * Palette and type pulled from the Dowyt Interior site: warm charcoal
 * ink, terracotta accent, greige canvas, clean geometric sans — no
 * serif, no heavy letter-spacing.
 */

.dst-form-wrap {
	/* Design tokens */
	--dst-primary: #2b2520;
	--dst-accent: #a7401e;
	--dst-accent-soft: #c87a51;
	--dst-ink-soft: #756b60;
	--dst-surface: #ffffff;
	--dst-canvas: #f3efe7;
	--dst-line: #e4ddd0;
	--dst-error: #a7401e;
	--dst-radius: 18px;
	--dst-radius-sm: 12px;
	--dst-shadow: 0 24px 60px -30px rgba(43, 37, 32, 0.22);
	--dst-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--dst-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	max-width: 860px;
	margin: 0 auto;
	padding: 16px;
	font-family: var(--dst-font);
	color: var(--dst-primary);
	-webkit-font-smoothing: antialiased;
}

.dst-form-wrap *,
.dst-form-wrap *::before,
.dst-form-wrap *::after {
	box-sizing: inherit;
}

.dst-form {
	background: var(--dst-surface);
	border: 1px solid var(--dst-line);
	border-radius: var(--dst-radius);
	box-shadow: var(--dst-shadow);
	padding: 32px 22px 26px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.dst-header {
	text-align: center;
	margin-bottom: 28px;
}

.dst-logo {
	max-height: 48px;
	width: auto;
	display: inline-block;
}

.dst-wordmark {
	font-family: var(--dst-font);
	font-weight: 700;
	font-size: 25px;
	letter-spacing: 0.06em;
	color: var(--dst-primary);
	display: block;
}

.dst-tagline {
	margin: 10px 0 0;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--dst-ink-soft);
}

/* ------------------------------------------------------------------ */
/* Progress indicator                                                  */
/* ------------------------------------------------------------------ */

.dst-progress {
	margin-bottom: 30px;
}

.dst-progress-track {
	height: 3px;
	background: var(--dst-line);
	border-radius: 999px;
	overflow: hidden;
}

.dst-progress-fill {
	height: 100%;
	width: 12.5%;
	background: var(--dst-accent);
	border-radius: 999px;
	transition: width 0.55s var(--dst-ease);
}

.dst-progress-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 10px;
	gap: 12px;
}

.dst-progress-step-title {
	font-family: var(--dst-font);
	font-weight: 600;
	font-size: 15px;
	color: var(--dst-primary);
}

.dst-progress-count {
	font-size: 12px;
	letter-spacing: 0.06em;
	color: var(--dst-ink-soft);
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Steps + transitions                                                 */
/* ------------------------------------------------------------------ */

.dst-steps {
	position: relative;
}

.dst-step {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.dst-step.is-active {
	animation: dst-step-in 0.45s var(--dst-ease) both;
}

.dst-step.is-leaving {
	animation: dst-step-out 0.28s ease both;
}

@keyframes dst-step-in {
	from { opacity: 0; transform: translateX(24px); }
	to   { opacity: 1; transform: translateX(0); }
}

@keyframes dst-step-out {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(-18px); }
}

.dst-step[data-direction="back"].is-active {
	animation-name: dst-step-in-back;
}

@keyframes dst-step-in-back {
	from { opacity: 0; transform: translateX(-24px); }
	to   { opacity: 1; transform: translateX(0); }
}

.dst-step-legend {
	display: block;
	margin-bottom: 26px;
	padding: 0;
}

.dst-step-eyebrow {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--dst-accent);
	margin-bottom: 8px;
}

.dst-step-title {
	display: block;
	font-family: var(--dst-font);
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--dst-primary);
}

.dst-step-subtitle {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	color: var(--dst-ink-soft);
}

/* ------------------------------------------------------------------ */
/* Fields                                                              */
/* ------------------------------------------------------------------ */

.dst-field {
	margin-bottom: 24px;
}

.dst-field:last-of-type {
	margin-bottom: 8px;
}

.dst-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 10px;
	color: var(--dst-primary);
	line-height: 1.5;
}

.dst-req {
	color: var(--dst-accent);
	margin-left: 3px;
}

.dst-input {
	display: block;
	width: 100%;
	padding: 14px 16px;
	font: inherit;
	font-size: 15px;
	color: var(--dst-primary);
	background: var(--dst-canvas);
	border: 1px solid var(--dst-line);
	border-radius: var(--dst-radius-sm);
	transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
	appearance: none;
}

.dst-input::placeholder {
	color: #a89c8c;
}

.dst-input:focus {
	outline: none;
	background: var(--dst-surface);
	border-color: var(--dst-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--dst-accent) 16%, transparent);
}

.dst-textarea {
	resize: vertical;
	min-height: 110px;
	line-height: 1.6;
}

/* Option cards (radios & checkboxes) --------------------------------- */

.dst-options {
	display: grid;
	gap: 10px;
}

.dst-option {
	display: block;
	cursor: pointer;
}

.dst-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.dst-option-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--dst-primary);
	background: var(--dst-canvas);
	border: 1px solid var(--dst-line);
	border-radius: var(--dst-radius-sm);
	transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--dst-ease);
}

.dst-option:hover .dst-option-card {
	border-color: color-mix(in srgb, var(--dst-accent) 50%, var(--dst-line));
}

.dst-option-indicator {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 1.5px solid #cfc4b3;
	border-radius: 50%;
	position: relative;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.dst-option input[type="checkbox"] + .dst-option-card .dst-option-indicator {
	border-radius: 5px;
}

.dst-option-indicator::after {
	content: "";
	position: absolute;
	inset: 3.5px;
	border-radius: inherit;
	background: #ffffff;
	transform: scale(0);
	transition: transform 0.2s var(--dst-ease);
}

.dst-option input:checked + .dst-option-card {
	background: var(--dst-surface);
	border-color: var(--dst-accent);
	box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--dst-accent) 55%, transparent);
}

.dst-option input:checked + .dst-option-card .dst-option-indicator {
	background: var(--dst-accent);
	border-color: var(--dst-accent);
}

.dst-option input:checked + .dst-option-card .dst-option-indicator::after {
	transform: scale(1);
}

.dst-option input:focus-visible + .dst-option-card {
	outline: 2px solid var(--dst-accent);
	outline-offset: 2px;
}

/* Conditional reveal -------------------------------------------------- */

.dst-conditional {
	animation: dst-reveal 0.35s var(--dst-ease) both;
}

@keyframes dst-reveal {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Validation ----------------------------------------------------------- */

.dst-field.has-error .dst-input,
.dst-field.has-error .dst-option-card {
	border-color: var(--dst-error);
}

.dst-error {
	margin: 8px 2px 0;
	font-size: 13px;
	color: var(--dst-error);
}

.dst-form-error {
	margin: 0 0 16px;
	padding: 12px 16px;
	font-size: 14px;
	color: var(--dst-error);
	background: color-mix(in srgb, var(--dst-error) 8%, #ffffff);
	border: 1px solid color-mix(in srgb, var(--dst-error) 28%, #ffffff);
	border-radius: var(--dst-radius-sm);
}

/* Honeypot — visually removed, still present for bots ------------------ */

.dst-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Navigation                                                          */
/* ------------------------------------------------------------------ */

.dst-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 30px;
	padding-top: 22px;
	border-top: 1px solid var(--dst-line);
}

/*
 * Themes (Elementor/Axiom global button styles in particular) often ship
 * a `button { ... }` reset with enough specificity or source-order
 * priority to strip our background, color, and padding — leaving the
 * browser's bare default button. `all: unset` wipes any inherited theme
 * declaration on the element itself before we rebuild it from scratch,
 * so the widget renders identically regardless of host theme.
 */
.dst-form-wrap button.dst-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--dst-font) !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	line-height: 1.3 !important;
	letter-spacing: 0.01em;
	padding: 13px 26px !important;
	border-radius: 999px !important;
	border: 1px solid transparent !important;
	cursor: pointer;
	text-decoration: none !important;
	text-indent: 0 !important;
	text-align: center;
	white-space: nowrap;
	transition: transform 0.2s var(--dst-ease), box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.dst-btn:active {
	transform: scale(0.98);
}

.dst-form-wrap button.dst-btn-solid {
	background: var(--dst-accent) !important;
	color: #ffffff !important;
	margin-left: auto;
	box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--dst-accent) 75%, transparent);
}

.dst-btn-solid:hover {
	background: color-mix(in srgb, var(--dst-accent) 88%, #000000) !important;
	box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--dst-accent) 85%, transparent);
	transform: translateY(-1px);
}

.dst-form-wrap button.dst-btn-ghost {
	background: transparent !important;
	color: var(--dst-ink-soft) !important;
	border-color: var(--dst-line) !important;
}

.dst-btn-ghost:hover {
	color: var(--dst-primary);
	border-color: #cfc4b3;
}

.dst-btn[disabled] {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

.dst-btn:focus-visible {
	outline: 2px solid var(--dst-accent);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Success state                                                       */
/* ------------------------------------------------------------------ */

.dst-success {
	text-align: center;
	padding: 26px 6px 12px;
}

.dst-success-mark {
	width: 72px;
	height: 72px;
	margin: 0 auto 22px;
	color: var(--dst-accent);
}

.dst-success-circle {
	stroke-dasharray: 208;
	stroke-dashoffset: 208;
	animation: dst-draw 0.9s var(--dst-ease) 0.1s forwards;
}

.dst-success-check {
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: dst-draw 0.5s var(--dst-ease) 0.85s forwards;
}

@keyframes dst-draw {
	to { stroke-dashoffset: 0; }
}

.dst-success-title {
	font-family: var(--dst-font);
	font-weight: 700;
	font-size: 28px;
	letter-spacing: -0.01em;
	margin: 0 0 14px;
	color: var(--dst-primary);
}

.dst-success-message {
	font-size: 15px;
	line-height: 1.7;
	color: var(--dst-primary);
	margin: 0 0 18px;
}

.dst-success-note {
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--dst-ink-soft);
	max-width: 520px;
	margin: 0 auto 30px;
}

.dst-success-brand {
	font-family: var(--dst-font);
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.05em;
	color: var(--dst-primary);
	margin: 0;
}

.dst-success-brand span {
	display: block;
	margin-top: 8px;
	font-family: var(--dst-font);
	font-weight: 400;
	font-size: 10.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--dst-ink-soft);
}

.dst-form.is-complete .dst-nav,
.dst-form.is-complete .dst-progress {
	display: none;
}

/* Submitting state ------------------------------------------------------ */

.dst-form.is-submitting .dst-submit {
	position: relative;
	color: transparent;
}

.dst-form.is-submitting .dst-submit::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: dst-spin 0.7s linear infinite;
}

@keyframes dst-spin {
	to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ */
/* Larger screens                                                      */
/* ------------------------------------------------------------------ */

@media (min-width: 640px) {
	.dst-form-wrap {
		padding: 32px 24px;
	}

	.dst-form {
		padding: 48px 60px 44px;
	}

	.dst-step-title {
		font-size: 32px;
	}

	.dst-wordmark {
		font-size: 28px;
	}

	/* Compact yes/no style questions sit side by side */
	.dst-options {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	}

	.dst-field-textarea .dst-textarea {
		min-height: 130px;
	}
}

@media (min-width: 860px) {
	.dst-form-wrap {
		padding: 40px 16px;
	}
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.dst-form-wrap * {
		animation-duration: 0.01ms !important;
		animation-delay: 0s !important;
		transition-duration: 0.01ms !important;
	}
}
