/* ══════════════════════════════════════════════════════════════════
   FORM UPDATE — formularz kontaktowy
   Pływające etykiety, stany pól, komunikaty pod przyciskiem.
   ══════════════════════════════════════════════════════════════════ */

.ns-form {
	--f-gold: var(--gold, #c9ab6e);
	--f-err: #f2726f;
	--f-ok: #5fd39a;
	--f-line: rgba(255, 255, 255, .1);
	--f-bg: rgba(255, 255, 255, .035);
	position: relative;
	display: grid;
	gap: 16px;
}

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

.ns-form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .ns-form-grid { grid-template-columns: 1fr 1fr; } }

/* ── Pole ─────────────────────────────────────────────────────────── */
.ns-field { position: relative; }

.ns-input {
	display: block;
	width: 100%;
	height: 58px;
	padding: 24px 46px 8px 18px;
	background: var(--f-bg);
	border: 1px solid var(--f-line);
	border-radius: 10px;
	color: #fff;
	font: 500 15px/1.4 'DM Sans', system-ui, sans-serif;
	outline: none;
	transition: border-color .25s, box-shadow .25s, background-color .25s;
	-webkit-appearance: none;
	appearance: none;
}
textarea.ns-input { height: auto; min-height: 150px; padding-top: 30px; padding-bottom: 30px; resize: vertical; line-height: 1.6; }
.ns-input::placeholder { color: transparent; }
.ns-input:hover { border-color: rgba(255, 255, 255, .18); }
.ns-input:focus {
	border-color: rgba(201, 171, 110, .65);
	background: rgba(201, 171, 110, .045);
	box-shadow: 0 0 0 4px rgba(201, 171, 110, .12);
}
/* Autouzupełnianie przeglądarki nie może wybielić pola. */
.ns-input:-webkit-autofill {
	-webkit-text-fill-color: #fff;
	-webkit-box-shadow: 0 0 0 40px #141210 inset;
	caret-color: #fff;
}

/* ── Pływająca etykieta ───────────────────────────────────────────── */
.ns-label {
	position: absolute;
	left: 18px;
	top: 19px;
	color: rgba(255, 255, 255, .58);
	font: 500 15px/1.2 'DM Sans', system-ui, sans-serif;
	pointer-events: none;
	transform-origin: left top;
	transition: transform .22s cubic-bezier(.2, .7, .2, 1), color .22s, top .22s;
	white-space: nowrap;
}
.ns-field--area .ns-label { top: 20px; }
.ns-input:focus + .ns-label,
.ns-input:not(:placeholder-shown) + .ns-label,
.ns-input:-webkit-autofill + .ns-label {
	transform: translateY(-11px) scale(.76);
	color: var(--f-gold);
	letter-spacing: .02em;
}
.ns-field--area .ns-input:focus + .ns-label,
.ns-field--area .ns-input:not(:placeholder-shown) + .ns-label { transform: translateY(-10px) scale(.76); }
.ns-req { color: var(--f-gold); margin-left: 1px; }
.ns-opt { color: rgba(255, 255, 255, .38); font-size: .86em; margin-left: 2px; }

/* ── Ikona stanu po prawej ────────────────────────────────────────── */
.ns-field-state { position: absolute; right: 16px; top: 20px; width: 18px; height: 18px; pointer-events: none; }
.ns-field-state svg { position: absolute; inset: 0; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.ns-ico-err { color: var(--f-err); }
.ns-ico-ok { color: var(--f-ok); }

/* ── Licznik znaków ───────────────────────────────────────────────── */
.ns-counter { position: absolute; right: 16px; bottom: 10px; font: 500 11px/1 'DM Sans', system-ui, sans-serif; color: rgba(255, 255, 255, .34); letter-spacing: .04em; pointer-events: none; }
.ns-counter.is-near { color: var(--f-gold); }
.ns-counter.is-over { color: var(--f-err); }

/* ── Stan: błąd ───────────────────────────────────────────────────── */
.ns-field.is-invalid .ns-input {
	border-color: var(--f-err);
	background: rgba(242, 114, 111, .06);
	box-shadow: 0 0 0 4px rgba(242, 114, 111, .14);
}
.ns-field.is-invalid .ns-label { color: var(--f-err); }
.ns-field.is-invalid .ns-ico-err { opacity: 1; transform: scale(1); }
.ns-field.is-invalid.is-shake { animation: ns-shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes ns-shake {
	15%, 85% { transform: translateX(-2px); }
	30%, 70% { transform: translateX(4px); }
	45%, 55% { transform: translateX(-5px); }
}

/* ── Stan: poprawne ───────────────────────────────────────────────── */
.ns-field.is-valid .ns-input { border-color: rgba(95, 211, 154, .38); }
.ns-field.is-valid .ns-ico-ok { opacity: 1; transform: scale(1); }

/* ── Przycisk ─────────────────────────────────────────────────────── */
.ns-submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 58px;
	margin-top: 4px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, #d8bd84 0%, var(--gold, #c9ab6e) 45%, #b08f52 100%);
	color: #0b0a08;
	font: 700 13px/1 'DM Sans', system-ui, sans-serif;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	overflow: hidden;
	box-shadow: 0 10px 30px -12px rgba(201, 171, 110, .55);
	transition: transform .2s, box-shadow .25s, filter .25s;
}
.ns-submit::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
	transform: translateX(-120%);
	transition: transform .7s ease;
}
.ns-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -14px rgba(201, 171, 110, .7); }
.ns-submit:hover::after { transform: translateX(120%); }
.ns-submit:active { transform: translateY(0); }
.ns-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ns-submit-label, .ns-submit-busy { display: inline-flex; align-items: center; gap: 10px; }
.ns-submit svg { width: 16px; height: 16px; }
.ns-submit-busy { display: none; }
.ns-form.is-busy .ns-submit { pointer-events: none; filter: saturate(.7); }
.ns-form.is-busy .ns-submit-label { display: none; }
.ns-form.is-busy .ns-submit-busy { display: inline-flex; }
.ns-form.is-sent .ns-submit { background: linear-gradient(135deg, #6fdca5, #3fae78); box-shadow: 0 10px 30px -12px rgba(95, 211, 154, .55); }
.ns-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); border-top-color: #0b0a08; animation: ns-rot .7s linear infinite; }
@keyframes ns-rot { to { transform: rotate(360deg); } }

/* ── Komunikat pod przyciskiem ────────────────────────────────────── */
.ns-form-msg {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 4px 12px;
	padding: 16px 18px;
	border-radius: 10px;
	font: 500 14px/1.5 'DM Sans', system-ui, sans-serif;
	animation: ns-msg-in .35s cubic-bezier(.2, .7, .2, 1);
}
.ns-form-msg[hidden] { display: none; }
.ns-form-msg::before {
	content: '';
	width: 20px;
	height: 20px;
	margin-top: 1px;
	background: currentColor;
	-webkit-mask: var(--ns-msg-ico) center / contain no-repeat;
	mask: var(--ns-msg-ico) center / contain no-repeat;
}
.ns-form-msg > * { grid-column: 2; margin: 0; }
.ns-form-msg-title { font-weight: 700; }
.ns-form-msg ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.ns-form-msg li { position: relative; padding-left: 14px; }
.ns-form-msg li::before { content: ''; position: absolute; left: 0; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.ns-form-msg a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .3); }
.ns-form-msg a:hover { text-decoration-color: currentColor; }
.ns-form-msg.is-err {
	--ns-msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");
	color: #ffb4b2;
	background: linear-gradient(180deg, rgba(242, 114, 111, .14), rgba(242, 114, 111, .07));
	border: 1px solid rgba(242, 114, 111, .35);
}
.ns-form-msg.is-ok {
	--ns-msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
	color: #9ff0c6;
	background: linear-gradient(180deg, rgba(95, 211, 154, .14), rgba(95, 211, 154, .06));
	border: 1px solid rgba(95, 211, 154, .35);
}
@keyframes ns-msg-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ns-form-note { margin: 0; color: rgba(255, 255, 255, .45); font-size: 13px; line-height: 1.6; text-align: center; }
.ns-form-note a { color: rgba(255, 255, 255, .7); text-decoration: underline; text-underline-offset: 3px; }
.ns-form-note a:hover { color: var(--f-gold); }

@media (prefers-reduced-motion: reduce) {
	.ns-form *, .ns-form *::before, .ns-form *::after { animation: none !important; transition: none !important; }
}

/* ── Stopka: nota reCAPTCHA ───────────────────────────────────────── */
.f-recaptcha { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0; color: rgba(255, 255, 255, .42); font-size: 12px; line-height: 1.6; }
.f-recaptcha svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--gold, #c9ab6e); }
.f-recaptcha a { color: rgba(255, 255, 255, .62); text-decoration: underline; text-underline-offset: 3px; }
.f-recaptcha a:hover { color: #fff; }
