/**
 * FlowRegister — skórka formularza rejestracji B2B.
 * Źródło wizualne: projekt „Flowhurt Rejestracja B2B" (Claude Design, ekrany 1a–1e).
 * Wszystko pod .flowreg — zero wpływu na resztę motywu.
 */

.flowreg {
	--fr-ink: #111;
	--fr-text: #333;
	--fr-muted: #666;
	--fr-faint: #8a8a8a;
	--fr-line: #ececec;
	--fr-line-input: #dcdcdc;
	--fr-green: #1b9e55;
	--fr-green-bg: #e9f9f0;
	--fr-red: #e74c3c;
	--fr-amber: #b26a00;
	--fr-amber-bg: #fff7e8;
	--fr-amber-line: #f3ddb0;

	max-width: 560px;
	margin: 0 auto;
	padding: 8px 0 48px;
	font-family: "Quicksand", -apple-system, "Segoe UI", Arial, sans-serif;
	color: var(--fr-ink);
	font-size: 13.5px;
	line-height: 1.6;
}

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

/* Nasze klasy z display:* nie mogą wygrywać z atrybutem hidden. */
.flowreg [hidden] { display: none !important; }

/* ------------------------------------------------------------------ karty */

.flowreg-card {
	background: #fff;
	border: 1px solid var(--fr-line);
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.06);
	padding: 26px;
	margin-top: 18px;
}

.flowreg-card--form { padding: 36px 40px; }
.flowreg-card--done { padding: 40px; text-align: center; }

.flowreg-title {
	margin: 0;
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: var(--fr-ink);
}

.flowreg-subtitle { margin: 0 0 4px; font-size: 15px; font-weight: 700; }

.flowreg-lead { margin: 8px 0 0; font-size: 13.5px; color: var(--fr-muted); line-height: 1.65; text-wrap: pretty; }
.flowreg-lead a { color: var(--fr-ink); font-weight: 700; }

.flowreg-hint { margin: 9px 0 0; font-size: 11.5px; color: var(--fr-faint); line-height: 1.6; }
.flowreg-kicker { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9a9a9a; }
.flowreg-mt { margin-top: 14px; }

/* ------------------------------------------------------------- pasek kroków */

.flowreg-stepper {
	display: flex;
	justify-content: center;
	list-style: none;
	margin: 0 0 8px;
	padding: 24px 0 0;
}

.flowreg-stepper li {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 150px;
	position: relative;
}

.flowreg-stepper li + li::before {
	content: "";
	position: absolute;
	top: 15px;
	right: calc(50% + 24px);
	width: calc(100% - 48px);
	height: 2px;
	background: #e0e0e0;
}

.flowreg-stepper li.is-done + li::before { background: var(--fr-green); }

.flowreg-stepper-dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--fr-line-input);
	color: #9a9a9a;
	font-weight: 700;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	z-index: 1;
}

.flowreg-stepper li.is-current .flowreg-stepper-dot { background: var(--fr-ink); border-color: var(--fr-ink); color: #fff; }
.flowreg-stepper li.is-done .flowreg-stepper-dot { background: var(--fr-green); border-color: var(--fr-green); color: #fff; }

.flowreg-stepper-label { font-weight: 700; font-size: 11px; margin-top: 7px; color: #9a9a9a; }
.flowreg-stepper li.is-current .flowreg-stepper-label { color: var(--fr-ink); }
.flowreg-stepper li.is-done .flowreg-stepper-label { color: var(--fr-green); }

/* Mobile: segmenty postępu zamiast kółek (ekran 1d). */
.flowreg-progress { display: none; gap: 7px; padding-top: 18px; }
.flowreg-progress span { height: 4px; flex: 1; border-radius: 99px; background: #e2e2e2; }
.flowreg-progress span.is-current { background: var(--fr-ink); }
.flowreg-progress span.is-done { background: var(--fr-green); }
.flowreg-progress-kicker {
	display: none;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #9a9a9a;
	margin-top: 8px;
}

/* ------------------------------------------------------------------- pola */

.flowreg-label { display: block; font-weight: 700; font-size: 11.5px; letter-spacing: 0.03em; margin: 16px 0 7px; color: var(--fr-ink); }
.flowreg-label-note { font-weight: 500; color: #9a9a9a; }
.flowreg-req { color: var(--fr-red); }

.flowreg input[type="text"],
.flowreg input[type="email"],
.flowreg input[type="tel"],
.flowreg input[type="password"] {
	width: 100%;
	height: 46px;
	border: 1px solid var(--fr-line-input);
	border-radius: 8px;
	padding: 0 14px;
	font: inherit;
	font-size: 13.5px;
	color: var(--fr-ink);
	background: #fff;
	outline: none;
}

.flowreg input::placeholder { color: #9b9b9b; opacity: 1; }

.flowreg input:focus {
	border-color: var(--fr-ink);
	outline: 2px solid var(--fr-ink);
	outline-offset: 1px;
}

.flowreg-field.has-error input {
	border-color: var(--fr-red);
	box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.flowreg-field-error { margin: 8px 0 0; font-weight: 700; font-size: 11.5px; color: var(--fr-red); }

/* Duże pole NIP (krok 1). */
.flowreg-nip-field {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1.5px solid var(--fr-ink);
	border-radius: 10px;
	height: 58px;
	padding: 0 18px;
	background: #fff;
}

.flowreg-nip-field input,
.flowreg .flowreg-nip-field input {
	border: none;
	outline: none;
	height: auto;
	padding: 0;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.06em;
	flex: 1;
	background: transparent;
}

.flowreg-nip-field:focus-within { outline: 2px solid var(--fr-ink); outline-offset: 2px; }
.flowreg-nip-field.has-error { border-color: var(--fr-red); box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1); }
.flowreg-nip-field.has-error input { color: var(--fr-red); }

.flowreg-nip-ok {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fr-green);
	font-weight: 700;
	font-size: 11px;
	flex: none;
}

/* Siatki pól. */
.flowreg-grid { display: grid; gap: 0 14px; }
.flowreg-grid--half { grid-template-columns: 1fr 1fr; }
.flowreg-grid--address { grid-template-columns: 2fr 1fr 1.4fr; }

/* --------------------------------------------------------------- przyciski */

.flowreg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border-radius: 8px;
	padding: 16px 22px;
	font: inherit;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.flowreg-btn--block { width: 100%; }
.flowreg-btn--primary { background: var(--fr-ink); color: #fff; border: none; }
.flowreg-btn--primary:hover { background: #2d2d2d; color: #fff; }
.flowreg-btn--ghost { background: #fff; color: var(--fr-ink); border: 1px solid #d9d9d9; }
.flowreg-btn--ghost:hover { border-color: var(--fr-ink); color: var(--fr-ink); }
.flowreg-btn:focus-visible { outline: 2px solid var(--fr-ink); outline-offset: 2px; }
.flowreg-btn[disabled] { background: #c9c9c9; cursor: not-allowed; }
.flowreg-btn-row { display: flex; gap: 10px; margin-top: 16px; }
.flowreg-btn-row .flowreg-btn--primary { flex: 1; }

.flowreg-btn--primary,
.flowreg-btn--ghost { box-shadow: none; }

/* Motyw koloruje każdy <a>; przyciski-linki muszą wygrać tę bitwę. */
.flowreg a.flowreg-btn--primary,
.flowreg a.flowreg-btn--primary:hover,
.flowreg a.flowreg-btn--primary:focus,
.flowreg a.flowreg-btn--whatsapp,
.flowreg a.flowreg-btn--whatsapp:hover,
.flowreg a.flowreg-btn--whatsapp:focus { color: #fff !important; text-decoration: none !important; }
.flowreg a.flowreg-btn--ghost,
.flowreg a.flowreg-btn--ghost:hover,
.flowreg a.flowreg-btn--ghost:focus { color: var(--fr-ink) !important; text-decoration: none !important; }

.flowreg form { margin: 0; }
.flowreg form .flowreg-btn { margin-top: 22px; }

.flowreg-linklike {
	background: none;
	border: none;
	padding: 0;
	margin-top: 12px;
	font: inherit;
	font-weight: 700;
	font-size: 11px;
	color: var(--fr-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.flowreg-back { font-weight: 700; color: var(--fr-ink); }

/* Niewidoczny domyślny submit (Enter = rejestracja, nie „Popraw dane"). */
.flowreg-default-submit {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px; border: 0;
	clip: rect(0 0 0 0); overflow: hidden;
}

/* Pole-pułapka dla botów. */
.flowreg-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------- zaufanie i alerty */

.flowreg-trust { display: flex; gap: 18px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.flowreg-trust span { display: inline-flex; gap: 8px; align-items: flex-start; font-size: 11px; color: var(--fr-muted); line-height: 1.5; }
.flowreg-trust svg { flex: none; margin-top: 1px; }

.flowreg-notice { display: flex; gap: 12px; background: #f6f6f6; border-radius: 10px; padding: 15px 17px; }
.flowreg-card .flowreg-notice { margin: 0; }
.flowreg-card.flowreg-notice { background: #f6f6f6; border: none; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.06); }
.flowreg-notice svg { flex: none; margin-top: 2px; color: #555; }
.flowreg-notice strong { font-size: 13px; }
.flowreg-notice p { margin: 4px 0 0; font-size: 11.5px; color: var(--fr-muted); line-height: 1.6; text-wrap: pretty; }

.flowreg-alert { display: flex; gap: 12px; border-radius: 10px; padding: 14px 16px; margin-top: 18px; font-size: 11.5px; line-height: 1.6; }
.flowreg-alert--warn { background: var(--fr-amber-bg); border: 1px solid var(--fr-amber-line); color: #7a5200; }
.flowreg-alert--warn svg { flex: none; margin-top: 1px; color: var(--fr-amber); }

.flowreg-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 5px;
	padding: 5px 10px;
	font-weight: 700;
	font-size: 10px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.flowreg-badge--ok { background: var(--fr-green-bg); color: var(--fr-green); }
.flowreg-badge--warn { background: var(--fr-amber-bg); color: var(--fr-amber); }

.flowreg-note { background: #f6f6f6; border-radius: 10px; padding: 13px 15px; font-size: 11.5px; color: #444; line-height: 1.65; margin-top: 14px; text-wrap: pretty; }

/* ----------------------------------------------------------- karta firmy */

.flowreg-company { padding: 22px 26px; }
.flowreg-company-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flowreg-company-name { font-weight: 700; font-size: 17px; margin-top: 10px; }
.flowreg-company-address { font-size: 12.5px; color: #555; line-height: 1.7; margin-top: 4px; }
.flowreg-company-ids { display: flex; gap: 22px; font-size: 11.5px; color: #777; margin-top: 8px; }

/* ------------------------------------------------------------------ zgody */

.flowreg-check { display: grid; grid-template-columns: 20px 1fr; gap: 11px; align-items: start; margin-top: 18px; position: relative; }
.flowreg-check input[type="checkbox"] {
	appearance: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	border: 1.5px solid #c9c9c9;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	display: inline-grid;
	place-content: center;
}
.flowreg-check input[type="checkbox"]:checked { background: var(--fr-ink); border-color: var(--fr-ink); }
.flowreg-check input[type="checkbox"]:checked::before {
	content: "";
	width: 11px;
	height: 11px;
	background: no-repeat center / contain
		url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="4.5 12.5 9.5 17.5 19.5 6.5"/></svg>');
}
.flowreg-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--fr-ink); outline-offset: 2px; }
.flowreg-check label { font-size: 12px; line-height: 1.6; color: var(--fr-text); cursor: pointer; }
.flowreg-check label a { color: var(--fr-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.flowreg-check .flowreg-field-error { grid-column: 1 / -1; margin-top: 4px; }
.flowreg-check.has-error input[type="checkbox"] { border-color: var(--fr-red); }
.flowreg-privacy { font-size: 11px; color: var(--fr-faint) !important; font-weight: 500 !important; }

.flowreg-consents { background: #f8f8f8; border-radius: 10px; padding: 15px 17px; margin-top: 16px; }
.flowreg-consents-head { font-weight: 700; font-size: 12.5px; }
.flowreg-consents-head span { font-weight: 500; color: #9a9a9a; }
.flowreg-consents p { margin: 3px 0 0; font-size: 11px; color: #777; line-height: 1.55; text-wrap: pretty; }
.flowreg-consents .flowreg-check { margin-top: 12px; }

/* ---------------------------------------------------------- siła hasła */

.flowreg-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.flowreg-strength span { height: 5px; flex: 1; border-radius: 99px; background: var(--fr-line); }
.flowreg-strength b { font-weight: 700; font-size: 10.5px; flex: none; }
.flowreg-strength[data-level="1"] span:nth-child(-n+1) { background: var(--fr-red); }
.flowreg-strength[data-level="2"] span:nth-child(-n+2) { background: var(--fr-amber); }
.flowreg-strength[data-level="3"] span:nth-child(-n+3) { background: var(--fr-green); }
.flowreg-strength[data-level="4"] span:nth-child(-n+4) { background: var(--fr-green); }
.flowreg-strength[data-level="1"] b { color: var(--fr-red); }
.flowreg-strength[data-level="2"] b { color: var(--fr-amber); }
.flowreg-strength[data-level="3"] b,
.flowreg-strength[data-level="4"] b { color: var(--fr-green); }

/* -------------------------------------------------------- krok 3: sukces */

.flowreg-done-icon {
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: var(--fr-green-bg);
	color: var(--fr-green);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
}

.flowreg-timeline { list-style: none; margin: 26px 0 0; padding: 0; text-align: left; }
.flowreg-timeline li { position: relative; padding: 0 0 18px 37px; font-size: 11.5px; color: #777; }
.flowreg-timeline li b { display: block; font-size: 13px; color: var(--fr-ink); }
.flowreg-timeline li span { display: block; margin-top: 2px; }
.flowreg-timeline li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid var(--fr-line-input);
	background: #fff;
}
.flowreg-timeline li::after {
	content: "";
	position: absolute;
	left: 11px;
	top: 26px;
	bottom: 2px;
	width: 2px;
	background: #e5e5e5;
}
.flowreg-timeline li:last-child { padding-bottom: 0; }
.flowreg-timeline li:last-child::after { display: none; }
.flowreg-timeline li.is-done::before {
	background: var(--fr-green) no-repeat center / 11px
		url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="4.5 12.5 9.5 17.5 19.5 6.5"/></svg>');
	border-color: var(--fr-green);
}
.flowreg-timeline li.is-next::before {
	border-color: var(--fr-ink);
	background: #fff radial-gradient(circle, var(--fr-ink) 0 4px, transparent 4.5px) center / 100% 100% no-repeat;
	animation: flowreg-pulse 1.6s ease-out infinite;
}
.flowreg-now {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 7px;
	border-radius: 99px;
	background: var(--fr-amber-bg);
	color: var(--fr-amber);
	font-style: normal;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: 2px;
}
@keyframes flowreg-pulse {
	0% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.28); }
	70% { box-shadow: 0 0 0 9px rgba(17, 17, 17, 0); }
	100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0); }
}

.flowreg-manager { background: #f6f6f6; border-radius: 12px; padding: 16px 18px; margin-top: 26px; text-align: left; }
.flowreg-manager-head { display: flex; gap: 12px; align-items: center; }
.flowreg-manager-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--fr-ink);
	color: #fff;
	font-weight: 700;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}
.flowreg-manager-head b { font-size: 13px; }
.flowreg-manager-actions { display: flex; gap: 8px; margin-top: 13px; }
.flowreg-manager-actions a {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	border: 1px solid var(--fr-ink);
	border-radius: 7px;
	padding: 11px 8px;
	font-weight: 700;
	font-size: 10px;
	letter-spacing: 0.05em;
	color: var(--fr-ink);
	text-decoration: none;
}
.flowreg-manager-actions a:hover { background: var(--fr-ink); color: #fff; }

/* ------------------------------------------- ruch: podmiana kroków (0.3.0) */

.flowreg {
	transition: opacity 0.17s ease, transform 0.17s ease;
}

.flowreg.flowreg-leave { opacity: 0; transform: translateY(10px); }
.flowreg.flowreg-enter { opacity: 0; transform: translateY(-10px); transition: none; }

/* Stan ładowania: przycisk dostaje kołowrotek, pola lekko gasną. */
.flowreg form.is-loading { opacity: 0.85; }
.flowreg form.is-loading .flowreg-btn--primary {
	color: transparent;
	position: relative;
}
.flowreg form.is-loading .flowreg-btn--primary::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: flowreg-spin 0.7s linear infinite;
}

@keyframes flowreg-spin { to { transform: rotate(360deg); } }

/* --------------------------------------- ruch: celebracja kroku 3 (0.3.0) */

.flowreg-celebrate .flowreg-done-icon {
	animation: flowreg-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.flowreg-celebrate .flowreg-done-icon svg polyline {
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
	animation: flowreg-draw 0.5s ease-out 0.25s forwards;
}
.flowreg-celebrate .flowreg-title,
.flowreg-celebrate .flowreg-lead {
	animation: flowreg-rise 0.4s ease-out both;
	animation-delay: 0.15s;
}
.flowreg-celebrate .flowreg-lead { animation-delay: 0.25s; }
.flowreg-celebrate .flowreg-timeline li { animation: flowreg-rise 0.4s ease-out both; }
.flowreg-celebrate .flowreg-timeline li:nth-child(1) { animation-delay: 0.35s; }
.flowreg-celebrate .flowreg-timeline li:nth-child(2) { animation-delay: 0.5s; }
.flowreg-celebrate .flowreg-timeline li:nth-child(3) { animation-delay: 0.65s; }
.flowreg-celebrate .flowreg-manager,
.flowreg-celebrate .flowreg-fast-approve { animation: flowreg-rise 0.4s ease-out 0.8s both; }
.flowreg-celebrate .flowreg-btn--ghost { animation: flowreg-rise 0.4s ease-out 0.9s both; }

@keyframes flowreg-pop {
	0% { transform: scale(0.4); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}
@keyframes flowreg-draw { to { stroke-dashoffset: 0; } }
@keyframes flowreg-rise {
	0% { transform: translateY(10px); opacity: 0; }
	100% { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.flowreg, .flowreg * { animation: none !important; transition: none !important; }
	.flowreg-celebrate .flowreg-done-icon svg polyline { stroke-dashoffset: 0; }
}

/* -------------------------------- „szybka akceptacja" — WhatsApp (0.3.0) */

.flowreg-fast-approve {
	background: #e9f9f0;
	border-radius: 12px;
	padding: 16px 18px;
	margin-top: 14px;
	text-align: left;
}
.flowreg-fast-approve-title { font-weight: 700; font-size: 13px; color: var(--fr-ink); }
.flowreg-fast-approve p { margin: 3px 0 0; font-size: 11.5px; color: #3c6b52; line-height: 1.6; }

.flowreg-btn--whatsapp {
	background: var(--fr-green);
	color: #fff;
	border: none;
	margin-top: 12px;
	gap: 8px;
}
.flowreg-btn--whatsapp:hover { background: #157f44; color: #fff; }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 639px) {
	.flowreg { padding-left: 2px; padding-right: 2px; }
	.flowreg-card--form { padding: 24px 18px 30px; }
	.flowreg-card--done { padding: 28px 18px; }
	.flowreg-card { padding: 16px; }
	.flowreg-title { font-size: 19px; }
	.flowreg-stepper { display: none; }
	.flowreg-progress { display: flex; }
	.flowreg-progress-kicker { display: block; }
	.flowreg-grid--half,
	.flowreg-grid--address { grid-template-columns: 1fr; }
	.flowreg-trust { flex-direction: column; gap: 10px; }
	.flowreg-nip-field { height: 52px; padding: 0 15px; }
	.flowreg-nip-field input { font-size: 16px; }
	.flowreg-btn-row { flex-direction: column; }
	.flowreg-manager-actions { flex-direction: column; }
}
