/* ==========================================================================
   Visiting Apartments — formularz kontaktowy (design-spec §5.8, XD „kontakt”)
   ========================================================================== */

.va-content .wp-block-post-content > .va-contact-form-section { margin-top: 64px; }
.va-contact-form-section > .va-label { margin-bottom: 20px; }
.va-contact-form-section.is-sent > .va-label,
.va-contact-form-section:has(.va-form-success) > .va-label { display: none; }

.va-form,
.va-form-success { max-width: 950px; }

.va-form > * { margin: 0; }
.va-form > * + * { margin-top: 20px; }

.va-form__row {
	display: grid;
	gap: 20px;
}
.va-form__row--3 { grid-template-columns: 3fr 3fr 1.6fr; }
.va-form__row--2 { grid-template-columns: 1fr 1.6fr; }

.va-field { position: relative; min-width: 0; }
.va-form__row > .va-field { margin: 0; }

/* Pola: białe, bez obrysu (XD) */
.va-field input:not([type="checkbox"]),
.va-field select,
.va-field textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 32px;
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-radius: 0;
	background: var(--va-field);
	color: var(--va-contrast);
	font-family: var(--va-font);
	font-stretch: var(--va-stretch);
	font-size: var(--va-fs-small);
	letter-spacing: var(--va-ls);
	box-shadow: inset 0 -1px 0 transparent;
	transition: box-shadow var(--va-t-fast) var(--va-ease);
	-webkit-appearance: none;
	appearance: none;
}
.va-field textarea {
	height: 220px;
	padding: 10px;
	line-height: 1.6;
	resize: vertical;
}
.va-field ::placeholder { color: var(--va-muted); opacity: 1; }
.va-field input:focus,
.va-field select:focus,
.va-field textarea:focus {
	outline: none;
	box-shadow: inset 0 -1px 0 var(--va-contrast);
}
.va-field input:focus-visible,
.va-field select:focus-visible,
.va-field textarea:focus-visible {
	outline: 2px solid var(--va-contrast);
	outline-offset: 2px;
}

/* Select z grotem „v” */
.va-field--select select {
	padding-right: 32px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%23141414' stroke-width='1.2'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.va-field--select select:invalid { color: var(--va-muted); }
.va-field--select option { color: var(--va-contrast); }

/* Błędy */
.va-field.has-error input:not([type="checkbox"]),
.va-field.has-error select,
.va-field.has-error textarea { box-shadow: inset 0 -1px 0 var(--va-error); }
.va-field__error {
	margin: 6px 0 0;
	color: var(--va-error);
	font-size: 12px;
	line-height: 1.4;
}
.va-form__alert {
	padding: 12px 16px;
	border-left: 2px solid var(--va-error);
	background: rgba(155, 44, 44, .06);
	font-size: var(--va-fs-small);
}

/* Zgoda RODO */
.va-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	max-width: 640px;
	font-size: 12px;
	line-height: 1.5;
	cursor: pointer;
}
.va-check input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 1px 0 0;
	accent-color: var(--va-contrast);
	cursor: pointer;
}

/* Lista załączników */
.va-form__files:empty { display: none; }
.va-form__files {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	list-style: none;
}
.va-form__files li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 12px;
	background: var(--va-field);
	font-size: 12px;
}
.va-form__file-remove {
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--va-contrast);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.va-form__file-remove:hover { color: var(--va-error); }

/* Stopka: „* pola wymagane” + Załączniki / Wyślij */
.va-form__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding-top: 24px;
}
.va-form__required {
	margin: 0;
	font-size: var(--va-fs-small);
	letter-spacing: var(--va-ls-caps);
	text-transform: uppercase;
}
.va-form__actions { display: flex; gap: 16px; }
.va-form__actions .va-btn { min-width: 172px; }

.va-form__attach { position: relative; }
.va-form__attach:focus-within { outline: 2px solid var(--va-contrast); outline-offset: 3px; }
.va-form__file-input {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	opacity: 0;
}
.va-form__submit[disabled] { opacity: .6; cursor: progress; }

.va-form__files-hint {
	font-size: 12px;
	color: var(--va-muted);
	text-align: right;
}
.va-form__files-hint.is-error { color: var(--va-error); }

/* Honeypot */
.va-form__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Stan po wysłaniu (XD „kontakt – 5”) */
.va-form-success { outline: none; }
.va-form-success > * { margin: 0; }
.va-form-success > * + * { margin-top: 24px; }
.va-form-success > .va-label + p { margin-top: 64px; }
.va-form-success p { max-width: 760px; }
.va-form-success__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 160px !important;
}
.va-btn--done .va-icon { margin-right: 2px; }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
	.va-form__row--3,
	.va-form__row--2 { grid-template-columns: minmax(0, 1fr); }
	.va-field input:not([type="checkbox"]),
	.va-field select { height: 44px; font-size: 16px; }
	.va-field textarea { font-size: 16px; }
	.va-form__footer { flex-direction: column-reverse; align-items: stretch; }
	.va-form__actions { flex-direction: column; }
	.va-form__actions .va-btn { width: 100%; }
	.va-form__files-hint { text-align: left; }
	.va-form-success > .va-label + p { margin-top: 32px; }
	.va-form-success__footer { margin-top: 64px !important; flex-direction: column-reverse; align-items: stretch; }
}
