/* Prosty Formularz — Modern Minimalist (fallback), primarily inherits site styles.
 * Everything hangs on CSS variables with fallbacks, so a theme (or the plugin's
 * Custom CSS box) can retheme the form by redefining --pf-* on .pf-form or :root.
 * Selectors are kept at low specificity on purpose: global theme CSS wins. */

.pf-form {
	/* Palette: falls back to Modern Minimalist greys */
	--pf-ink:     var(--wp--preset--color--contrast, #36454f);
	--pf-muted:   #708090;
	--pf-border:  #d3d3d3;
	--pf-bg:      transparent;
	--pf-accent:  var(--wp--preset--color--primary, #36454f);
	--pf-accent-ink: #ffffff;
	--pf-error:   #b3261e;
	--pf-ok:      #1e8e5a;
	--pf-radius:  6px;
	--pf-gap:     1.1rem;

	font: inherit;              /* typography comes from the theme */
	color: inherit;
	max-width: 44rem;
	background: var(--pf-bg);
}

.pf-form *,
.pf-form *::before,
.pf-form *::after { box-sizing: border-box; }

/* Honeypot — off-screen, not display:none (some bots skip hidden fields) */
.pf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* Layout */
.pf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 var(--pf-gap);
}
.pf-grid .pf-field:first-child { grid-column: 1 / -1; }
@media (max-width: 600px) {
	.pf-grid { grid-template-columns: 1fr; }
}

.pf-field { margin: 0 0 var(--pf-gap); }

.pf-form label,
.pf-form .pf-label {
	display: block;
	margin-bottom: .35em;
	font-weight: 600;
	font-size: .95em;
}
.pf-muted { color: var(--pf-muted); font-weight: 400; }
.pf-req-mark { color: var(--pf-error); }

/* Inputs inherit the page font; borders use the palette */
.pf-form input[type="text"],
.pf-form input[type="email"],
.pf-form input[type="tel"],
.pf-form select,
.pf-form textarea {
	font: inherit;
	color: inherit;
	width: 100%;
	padding: .65em .85em;
	background: #fff;
	border: 1px solid var(--pf-border);
	border-radius: var(--pf-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.pf-form textarea { resize: vertical; }

.pf-form input:focus-visible,
.pf-form select:focus-visible,
.pf-form textarea:focus-visible,
.pf-form .pf-dz-trigger:focus-visible,
.pf-form .pf-add-more-btn:focus-visible,
.pf-form .pf-thumb-x:focus-visible {
	outline: 2px solid var(--pf-accent);
	outline-offset: 2px;
	border-color: var(--pf-accent);
}

.pf-form input[aria-invalid="true"],
.pf-form textarea[aria-invalid="true"] { border-color: var(--pf-error); }

/* Dropzone */
.pf-dropzone {
	display: block;
	min-height: 132px;
	padding: 0;
	text-align: center;
	border: 2px dashed var(--pf-border);
	border-radius: var(--pf-radius);
	color: var(--pf-muted);
	overflow: hidden;
	transition: border-color .15s ease, background-color .15s ease;
}
.pf-dropzone:hover,
.pf-dropzone.pf-dragover {
	border-color: var(--pf-accent);
	background: rgba(54, 69, 79, .04);
	color: inherit;
}
.pf-dz-trigger {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	width: 100%;
	min-height: 128px;
	padding: 1.6rem 1rem;
	font: inherit;
	color: inherit;
	text-align: center;
	background: transparent;
	border: 0;
	border-radius: inherit;
	cursor: pointer;
}
.pf-dz-trigger:focus-visible { outline-offset: -4px; }
.pf-dropzone.pf-has-files {
	min-height: 0;
	padding: .75rem;
}
.pf-dropzone.pf-has-files .pf-dz-trigger { display: none; }
.pf-dz-text { font-size: .95em; font-weight: 400; }
.pf-dz-text strong { font-weight: 600; }

/* Thumbnails */
.pf-thumbs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: .65rem;
	width: 100%;
	margin: 0;
	padding: 0;
}
.pf-thumbs li {
	position: relative;
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
	border: 1px solid var(--pf-border);
	border-radius: var(--pf-radius);
	overflow: hidden;
	background: #fff;
}
.pf-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.pf-thumb-file {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%; height: 100%;
	font-size: .65em;
	padding: .2em;
	word-break: break-all;
	color: var(--pf-muted);
}
.pf-thumb-x {
	position: absolute;
	top: 3px; right: 3px;
	width: 20px; height: 20px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	padding: 0;
}
.pf-thumb-x:hover { background: var(--pf-error); }

.pf-thumbs li.pf-add-more {
	border: 1px dashed var(--pf-border);
	background: transparent;
}
.pf-add-more-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .2rem;
	width: 100%;
	height: 100%;
	padding: .35rem;
	font: inherit;
	color: var(--pf-muted);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.pf-add-more-btn:hover {
	color: var(--pf-accent);
	background: rgba(54, 69, 79, .04);
}
.pf-add-more-plus {
	font-size: 1.7rem;
	font-weight: 300;
	line-height: 1;
}
.pf-add-more-label {
	font-size: .72rem;
	font-weight: 600;
	line-height: 1.15;
}

/* Undo bar */
.pf-undo-bar {
	display: inline-flex;
	align-items: center;
	gap: .6em;
	margin-top: .5rem;
	font-size: .9em;
	color: var(--pf-muted);
}
.pf-undo-bar button {
	font: inherit;
	background: none;
	border: 0;
	padding: 0;
	color: var(--pf-accent);
	text-decoration: underline;
	cursor: pointer;
}

/* Consent */
.pf-consent label {
	display: flex;
	gap: .6em;
	align-items: flex-start;
	font-weight: 400;
	font-size: .9em;
	line-height: 1.45;
}
.pf-consent input { margin-top: .25em; flex: 0 0 auto; }

.pf-choice { display: flex; gap: .5em; align-items: center; font-weight: 400; margin-bottom: .3em; }
.pf-custom fieldset { border: 0; padding: 0; margin: 0; }
.pf-custom legend { font-weight: 600; font-size: .95em; margin-bottom: .35em; padding: 0; }

/* Status */
.pf-status {
	padding: .8em 1em;
	border-radius: var(--pf-radius);
	font-size: .95em;
}
.pf-status.pf-ok  { background: rgba(30, 142, 90, .1);  color: var(--pf-ok); }
.pf-status.pf-err { background: rgba(179, 38, 30, .08); color: var(--pf-error); }

/* Submit + conversion badge */
.pf-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .7rem;
	margin: 0;
}
.pf-submit {
	font: inherit;
	font-weight: 600;
	padding: .8em 2.2em;
	border: 1px solid var(--pf-accent);
	border-radius: var(--pf-radius);
	background: var(--pf-accent);
	color: var(--pf-accent-ink);
	cursor: pointer;
	transition: opacity .15s ease, transform .05s ease;
}
.pf-submit:hover { opacity: .88; }
.pf-submit:active { transform: translateY(1px); }
.pf-submit[disabled] { opacity: .55; cursor: wait; }

.pf-badge {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	font-size: .9em;
	color: var(--pf-muted);
}
.pf-dot {
	width: 9px; height: 9px;
	border-radius: 50%;
	background: var(--pf-ok);
	position: relative;
	flex: 0 0 auto;
}
.pf-dot::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	background: var(--pf-ok);
	opacity: .35;
	animation: pf-pulse 1.8s ease-out infinite;
}
@keyframes pf-pulse {
	0%   { transform: scale(.6); opacity: .45; }
	70%  { transform: scale(1.4); opacity: 0; }
	100% { transform: scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.pf-dot::after { animation: none; opacity: 0; }
	.pf-form * { transition: none !important; }
}
