/* Plinthworks dynamic forms — front end. Inherits the theme palette. */

.pw-form-wrap { max-width: var(--pwf-maxw, 720px); }
.pw-form__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--pwf-gap, 18px) 20px; }
.pw-form__field { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; }
.pw-form__field--half { grid-column: span 3; }
.pw-form__field--third { grid-column: span 2; }
@media (max-width: 600px) {
	.pw-form__field--half, .pw-form__field--third { grid-column: span 6; }
}

.pw-form__section { grid-column: span 6; margin-top: 8px; }
.pw-form__section-title { margin: 0 0 2px; font-size: 1.1rem; color: var(--wp--preset--color--contrast, #515266); }
.pw-form__section-desc { margin: 0; color: var(--wp--preset--color--contrast-2, #6F6F6F); font-size: .9rem; }

.pw-form__label { font-weight: 600; font-size: .92rem; color: var(--pwf-label, var(--wp--preset--color--contrast, #515266)); }
.pw-form__req { color: var(--pwf-required, var(--wp--preset--color--danger, #C02B0A)); }
.pw-form__help { font-size: .82rem; color: var(--wp--preset--color--contrast-3, #727272); }

.pw-form__control {
	width: 100%; box-sizing: border-box; padding: 11px 14px;
	border: 1px solid var(--pwf-border, var(--wp--preset--color--base-3, #C8C8C8));
	border-radius: var(--pwf-radius, 0);
	background: var(--pwf-field-bg, var(--pw-surface, #fff)); font-size: .95rem; font-family: inherit;
	color: var(--wp--preset--color--contrast, #515266);
}
.pw-form__control:focus { outline: 2px solid var(--wp--preset--color--surface-deep, #343877); outline-offset: 1px; border-color: var(--pwf-accent, var(--wp--preset--color--surface-deep, #343877)); }
textarea.pw-form__control { resize: vertical; min-height: 120px; }
select.pw-form__control { appearance: none; -webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a6a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.pw-form__choices { display: flex; flex-direction: column; gap: 8px; }
.pw-form__choice { display: flex; align-items: flex-start; gap: 9px; font-size: .95rem; color: var(--wp--preset--color--contrast-2, #6F6F6F); cursor: pointer; }
.pw-form__choice input { margin-top: 3px; }
.pw-form__consent { font-size: .9rem; }

.pw-form__file { padding: 9px 12px; background: var(--wp--preset--color--base-2, #F9F7F6); }

/* International phone: compact flag + code button + a searchable flag list. */
.pw-form__tel-wrap { display: flex; align-items: stretch; }
.pw-form__dialbox { position: relative; flex: 0 0 auto; }
.pw-form__dial-btn {
	display: inline-flex; align-items: center; gap: 6px; height: 100%;
	padding: 0 8px; cursor: pointer; font-family: inherit; font-size: .95rem; line-height: 1;
	border: 1px solid var(--wp--preset--color--base-3, #C8C8C8); border-right: 0;
	background: var(--wp--preset--color--base-2, #F9F7F6);
	color: var(--wp--preset--color--contrast, #515266); white-space: nowrap;
}
.pw-form__dial-btn:focus-visible { outline: 2px solid var(--wp--preset--color--surface-deep, #343877); outline-offset: 1px; border-color: var(--wp--preset--color--surface-deep, #343877); position: relative; z-index: 1; }
.pw-form__dial-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; display: block; }
.pw-form__dial-code { font-variant-numeric: tabular-nums; }
.pw-form__dial-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentcolor; opacity: .55; }
.pw-form__tel-wrap .pw-form__tel-input { flex: 1 1 auto; border-left: 0; min-width: 0; }

.pw-form__dial-panel {
	position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: 280px; max-width: 78vw;
	background: var(--pw-surface, #fff); border: 1px solid var(--wp--preset--color--base-3, #C8C8C8);
	border-radius: 10px; box-shadow: 0 10px 30px rgba(17, 24, 39, .14); padding: 8px; box-sizing: border-box;
}
.pw-form__dial-search { width: 100%; box-sizing: border-box; padding: 8px 10px; margin-bottom: 6px;
	border: 1px solid var(--wp--preset--color--base-3, #C8C8C8); font-family: inherit; font-size: .9rem; }
.pw-form__dial-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.pw-form__dial-item { display: flex; align-items: center; gap: 9px; padding: 8px 8px; cursor: pointer; border-radius: 6px; font-size: .9rem; }
.pw-form__dial-item:hover { background: var(--wp--preset--color--base-2, #F9F7F6); }
.pw-form__dial-item img { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; }
.pw-form__dial-name { flex: 1 1 auto; color: var(--wp--preset--color--contrast, #515266); }
.pw-form__dial-dial { color: var(--wp--preset--color--contrast-3, #727272); font-variant-numeric: tabular-nums; }

/* Inline field errors. */
.pw-form__field--error .pw-form__control,
.pw-form__field--error .pw-form__dial {
	border-color: var(--wp--preset--color--danger, #C02B0A);
	box-shadow: 0 0 0 1px var(--wp--preset--color--danger, #C02B0A);
}
.pw-form__field-error {
	font-size: .82rem; font-weight: 600;
	color: var(--wp--preset--color--danger, #C02B0A);
}

/* Submit is a theme button — it inherits the theme.json button styling and the
   theme's button block styles (pill / outline / ghost) via the classes it
   carries. We only handle the button-vs-anchor reset and the full-width option;
   colour, radius, padding and hover come from the theme, so it always matches. */
.pw-form__actions { margin-top: 22px; }
.pw-form__submit-wrap { display: inline-block; }
.pw-form__submit {
	appearance: none; -webkit-appearance: none;
	cursor: pointer; font: inherit;
}
.pw-form__submit-wrap--full { display: block; }
.pw-form__submit-wrap--full .pw-form__submit { display: block; width: 100%; }
.pw-form__submit[disabled] { opacity: .6; cursor: default; }

.pw-form__success { padding: 16px 20px; border-radius: 12px; margin-bottom: 20px;
	background: color-mix(in srgb, var(--wp--preset--color--accent-3, #F36F8F) 30%, var(--wp--preset--color--base, #FFF));
	color: var(--wp--preset--color--contrast, #515266); }
.pw-form__error { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px;
	background: color-mix(in srgb, var(--wp--preset--color--accent, #EFC940) 14%, var(--wp--preset--color--base, #FFF));
	color: var(--wp--preset--color--contrast, #515266); font-size: .92rem; }
.pw-form__notice { color: var(--wp--preset--color--contrast-3, #727272); font-style: italic; }

/* Honeypot — visually and semantically removed for real users. */
.pw-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
