/*
 * Dalebrook Contact — frontend styles.
 * Reuses the theme's own global-style custom properties (as emitted by
 * theme.json / --wp--preset--*) so the form stays in sync with the site's
 * branding automatically. Fallback values match the current Dalebrook
 * (bizboost) theme: dark background, Poppins, blue→teal gradient buttons.
 */

.db-contact {
	--db-bg: var(--wp--preset--color--background, #0a0c11);
	--db-panel: var(--wp--preset--color--secondary, #1a1d24);
	--db-field-bg: var(--wp--preset--color--tertiary, #0f1116);
	--db-text: var(--wp--preset--color--foreground, #ffffff);
	--db-text-soft: var(--wp--preset--color--body-text, #abadb3);
	--db-text-faint: #7d8087;
	--db-border: var(--wp--preset--color--border-default-color, #323438);
	--db-accent: var(--wp--preset--color--blue-green, #25c5c9);
	--db-accent-2: var(--wp--preset--color--patrick-blue, #1b3385);
	--db-btn-text: var(--wp--preset--color--color-light, #fbfbfb);
	--db-gradient: var(--wp--preset--gradient--horizontal-patrick-blue-to-blue-green, linear-gradient(to right, var(--db-accent-2) 0%, var(--db-accent) 100%));
	--db-radius: 12px;
	--db-font: var(--wp--preset--font-family--poppins, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);

	max-width: 720px;
	margin-inline: auto;
	font-family: var(--db-font);
	color: var(--db-text);
}

.db-contact * {
	box-sizing: border-box;
}

.db-contact__head {
	text-align: center;
	margin-bottom: 32px;
}

.db-contact__title {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 8px;
	color: var(--db-text);
}

.db-contact__subtitle {
	color: var(--db-text-soft);
	margin: 0;
}

.db-contact__form {
	background: var(--db-panel);
	border: 1px solid var(--db-border);
	border-radius: calc(var(--db-radius) * 1.4);
	padding: clamp(24px, 4vw, 40px);
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.db-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 22px;
}

@media (max-width: 560px) {
	.db-grid {
		grid-template-columns: 1fr;
	}
}

.db-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.db-field__label,
.db-field label:not(.db-checkbox):not(.db-tile) {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--db-text);
}

.db-field input[type="text"],
.db-field input[type="email"],
.db-field input[type="tel"],
.db-field select,
.db-field textarea {
	width: 100%;
	font: inherit;
	font-size: 15px;
	color: var(--db-text);
	background: var(--db-field-bg);
	border: 1px solid var(--db-border);
	border-radius: var(--db-radius);
	padding: 12px 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.db-field input::placeholder,
.db-field textarea::placeholder {
	color: var(--db-text-faint);
	opacity: 1;
}

.db-field select {
	color-scheme: dark;
}

.db-field textarea {
	resize: vertical;
	min-height: 110px;
}

.db-field input:focus,
.db-field select:focus,
.db-field textarea:focus {
	outline: none;
	border-color: var(--db-accent);
	box-shadow: 0 0 0 3px rgba(37, 197, 201, 0.25);
}

.db-field--honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Service tiles ------------------------------------------------------ */

.db-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
}

.db-tile {
	position: relative;
	cursor: pointer;
}

.db-tile input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.db-tile__box {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 13.5px;
	font-weight: 600;
	padding: 12px 10px;
	border: 1.5px solid var(--db-border);
	border-radius: var(--db-radius);
	background: var(--db-field-bg);
	color: var(--db-text-soft);
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.db-tile input:checked + .db-tile__box {
	border-color: var(--db-accent);
	background: rgba(37, 197, 201, 0.12);
	color: var(--db-text);
}

.db-tile input:focus-visible + .db-tile__box {
	outline: 2px solid var(--db-accent);
	outline-offset: 2px;
}

/* Dropzone ------------------------------------------------------------ */

.db-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-align: center;
	padding: 28px 16px;
	border: 1.5px dashed var(--db-border);
	border-radius: var(--db-radius);
	background: var(--db-field-bg);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.db-dropzone:hover,
.db-dropzone:focus-visible,
.db-dropzone.is-dragover {
	border-color: var(--db-accent);
	background: rgba(37, 197, 201, 0.08);
	outline: none;
}

.db-dropzone__icon {
	font-size: 22px;
}

.db-dropzone__text {
	font-size: 13.5px;
	color: var(--db-text-soft);
	line-height: 1.5;
}

.db-previews {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 10px;
}

.db-previews:empty {
	display: none;
}

.db-preview {
	position: relative;
	border: 1px solid var(--db-border);
	border-radius: var(--db-radius);
	overflow: hidden;
	aspect-ratio: 1;
	background: var(--db-field-bg);
	animation: db-fade-in 0.2s ease;
}

.db-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.db-preview__file {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 11px;
	color: var(--db-text-soft);
	padding: 6px;
	text-align: center;
	word-break: break-word;
}

.db-preview__remove {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 20px;
	height: 20px;
	line-height: 18px;
	text-align: center;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 12px;
}

/* Consent + submit ------------------------------------------------------ */

.db-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	color: var(--db-text-soft);
	cursor: pointer;
}

.db-checkbox input {
	margin-top: 3px;
	accent-color: var(--db-accent);
}

.db-checkbox a {
	color: var(--db-accent);
	text-decoration: underline;
}

.db-field--submit {
	margin-top: 6px;
}

.db-submit {
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: clamp(12px, 2.5vw, 16px) clamp(21px, 2.5vw, 35px);
	font: inherit;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--db-btn-text);
	background: var(--db-gradient);
	border: none;
	border-radius: 30px;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.db-submit:hover {
	opacity: 0.88;
}

.db-submit:disabled {
	opacity: 0.55;
	cursor: wait;
}

.db-message {
	font-size: 14px;
	text-align: center;
	min-height: 1px;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.db-message.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.db-message.is-success {
	color: #6fe0a0;
}

.db-message.is-error {
	color: #ff8a80;
}

@keyframes db-fade-in {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.db-contact * {
		transition: none !important;
		animation: none !important;
	}
}
