.ofc-zapis-wrap {
	max-width: 900px;
	font-family: inherit;
}

/* "Dane do umowy" (P4 F2) — gate + state messages. Form fields reuse .ofc-zapis-* styles. */
.ofc-rkr-cdf-message {
	padding: 16px 18px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}
.ofc-rkr-cdf-gate { padding: 4px 0 8px; }
.ofc-rkr-cdf-code { margin-top: 10px; }
.ofc-rkr-cdf-code-input {
	font-size: 18px;
	letter-spacing: 4px;
	width: 8em;
	text-align: center;
	padding: 6px 8px;
}
.ofc-rkr-cdf-gate-status { display: block; margin-top: 8px; font-size: 13px; color: #555; }
/* The input is nested inside its <label>, so stack the label text above the input. */
.ofc-rkr-cdf-form .ofc-zapis-row label {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
/* Read-only value for a locked (already-provided) field — clearly not an input box. */
.ofc-rkr-cdf-display {
	display: inline-block;
	padding: 8px 10px;
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	color: #3c434a;
	min-height: 1.2em;
}
/* Lockable sub-section — clearly bordered, but lighter than the parent fieldset. */
.ofc-rkr-cdf-sub {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 8px 14px 12px;
	margin: 12px 0;
	background: #fcfcfc;
}
.ofc-rkr-cdf-sub-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 4px;
}
.ofc-rkr-cdf-sub-title {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: #646970;
}
/* "Zmień" / "Anuluj" — clear, smaller links, right-aligned. */
.ofc-rkr-cdf-change,
.ofc-rkr-cdf-cancelgroup {
	margin-left: auto;
	background: none;
	border: 0;
	padding: 0;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}
.ofc-rkr-cdf-change { color: #2271b1; }
.ofc-rkr-cdf-change:hover,
.ofc-rkr-cdf-change:focus { color: #135e96; }
.ofc-rkr-cdf-cancelgroup { color: #b32d2e; }
.ofc-rkr-cdf-cancelgroup:hover,
.ofc-rkr-cdf-cancelgroup:focus { color: #8a2424; }
.ofc-rkr-cdf-sub-foot {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 8px;
}
.ofc-rkr-cdf-savegroup {
	background: #2271b1;
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 5px 12px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.ofc-rkr-cdf-savegroup:hover,
.ofc-rkr-cdf-savegroup:focus { background: #135e96; color: #fff; }
.ofc-rkr-cdf-group-status { font-size: 12px; color: #555; }
.ofc-rkr-cdf-group-status.ofc-rkr-error { color: #b32d2e; }
.ofc-rkr-cdf-fee-file { display: block; margin-top: 4px; }

/* Admin-only version badge — gated server-side on `manage_options`. */
.ofc-zapis-version-badge {
	font-size: 11px;
	color: #aaa;
	margin: 0 0 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.02em;
}

/* Defensive: themes commonly style `.button` (and `button`) with display rules
 * that out-specific the UA `[hidden] { display: none }`, leaving JS-hidden
 * elements visible. Scoped to our form so this can't affect anything else. */
.ofc-zapis-form [hidden],
.ofc-zapis-wrap [hidden] {
	display: none !important;
}

.ofc-zapis-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ofc-zapis-fs {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 16px 18px 14px;
	margin: 0;
}

.ofc-zapis-fs > legend {
	font-weight: 600;
	padding: 0 6px;
	font-size: 14px;
	color: #333;
}

.ofc-zapis-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 8px 0;
}

.ofc-zapis-row label {
	font-size: 13px;
	color: #333;
	font-weight: 500;
}

.ofc-zapis-row input[type="text"],
.ofc-zapis-row input[type="email"],
.ofc-zapis-row input[type="tel"],
.ofc-zapis-row input[type="number"],
.ofc-zapis-row select,
.ofc-zapis-row textarea {
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font: inherit;
	box-sizing: border-box;
	width: 100%;
	max-width: 360px;
	background: #fff;
}

.ofc-zapis-row textarea {
	max-width: 100%;
	resize: vertical;
}

.ofc-zapis-row input:focus,
.ofc-zapis-row select:focus,
.ofc-zapis-row textarea:focus {
	outline: 2px solid #2271b1;
	outline-offset: -1px;
}

.ofc-zapis-req {
	color: #d63638;
}

.ofc-zapis-note,
.ofc-zapis-help {
	font-size: 12px;
	color: #555;
	margin: 4px 0 0;
}

/* Inline adnotacja: tighter to the field above, more breathing room before the next. */
.ofc-zapis-note {
	margin-top: -15px;
	margin-bottom: 10px;
}

/* Pomoc pod listą grup sits right above the chip area, so only the top gap gets tightened —
 * keeping bottom at 0 so chips stay visually attached to the picker. */
.ofc-zapis-help {
	margin-top: -15px;
}

/* Customisable HTML block between Uwagi and Zgoda (consent). */
.ofc-zapis-notice {
	margin: 8px 0 12px;
	padding: 10px 14px;
	background: #fafafa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.5;
	color: #333;
}

.ofc-zapis-notice hr {
	border: 0;
	border-top: 1px solid #e0e0e0;
	margin: 6px 0 12px;
}

.ofc-zapis-notice p {
	margin: 6px 0;
}

.ofc-zapis-notice ul {
	margin: 6px 0 6px 20px;
	padding: 0;
	list-style: disc;
}

.ofc-zapis-notice li {
	margin: 2px 0;
}

/* Role selector ("Kim jesteś?") — pill / segmented switch ---------------- */

.ofc-zapis-fs-role .ofc-zapis-role-options {
	display: inline-flex;
	background: #ececec;
	border-radius: 999px;
	padding: 4px;
	gap: 0;
	max-width: 100%;
	flex-wrap: wrap;
}

.ofc-zapis-role-option {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	cursor: pointer;
	padding: 8px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 14px;
	color: #3a3a3a;
	line-height: 1.2;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.ofc-zapis-role-option:hover {
	color: #111;
}

.ofc-zapis-role-option input[type="radio"] {
	/* Visually hidden — the label IS the button. Stays focusable for keyboards. */
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.ofc-zapis-role-option.is-selected {
	background: #111;
	color: #fff;
}

.ofc-zapis-role-option:focus-within {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.ofc-zapis-role-desc {
	margin: 8px 2px 0;
	font-size: 13px;
	color: #555;
	min-height: 1em;
}

.ofc-zapis-role-desc:empty {
	display: none;
}

@media (max-width: 520px) {
	.ofc-zapis-fs-role .ofc-zapis-role-options {
		display: flex;
		width: 100%;
	}
	.ofc-zapis-role-option {
		flex: 1 1 0;
		padding: 8px 10px;
		font-size: 13px;
		white-space: normal;
	}
}

.ofc-zapis-role-hint {
	display: block;
	font-size: 12px;
	color: #555;
	font-weight: normal;
	margin-top: 2px;
}

.ofc-zapis-role-hint:empty {
	display: none;
}

/* Section ordering — flex order keyed off `data-role` on the form. Defaults give
 * the parent flow (Reporter → Kontakt → Student → Age → Uwagi → Notice → Consent).
 * `minor` swaps Student to first and pushes Reporter below it. `adult_student`
 * hides Student entirely. */
.ofc-zapis-after-role {
	display: flex;
	flex-direction: column;
}

.ofc-zapis-fs-reporter   { order: 10; }
.ofc-zapis-fs-contact    { order: 20; }
.ofc-zapis-fs-student    { order: 30; }
.ofc-zapis-fs-age-group  { order: 40; }
.ofc-zapis-fs-uwagi      { order: 50; }
.ofc-zapis-notice        { order: 60; }
.ofc-zapis-rodo          { order: 70; }
.ofc-zapis-errors        { order: 85; }
.ofc-zapis-actions       { order: 90; }
/* .ofc-zapis-turnstile now lives INSIDE .ofc-zapis-actions (no column order). */

.ofc-zapis-form[data-role="minor"] .ofc-zapis-fs-student  { order: 5; }
.ofc-zapis-form[data-role="minor"] .ofc-zapis-fs-reporter { order: 6; }

/* v2 only: the submission notice sits AFTER the RODO consent (between RODO and
   Turnstile/submit), instead of before it. v1 keeps the original order (60). */
.ofc-zapis-form-v2 .ofc-zapis-notice { order: 75; }

/* Submitter-view ("Moje zgłoszenia") shortcode --------------------------- */

.ofc-subview-wrap {
	max-width: 900px;
}

.ofc-subview-status {
	font-size: 13px;
	color: #555;
}

/* Error variant (e.g. "Nie znaleziono zgłoszeń…") — only error states are red;
   neutral states (sending/checking) and success messages stay grey. */
.ofc-subview-status.ofc-subview-status-error {
	color: #d83131;
	font-weight: 600;
}

.ofc-subview-phone-mask {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ofc-subview-card {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 10px 0;
	background: #fff;
}

/* WP-account link offer / success (PR3b-3b). */
.ofc-subview-link-offer {
	border: 1px solid #cfe3ff;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 16px 0 4px;
	background: #f3f8ff;
}

.ofc-subview-link-offer p {
	margin: 0 0 10px;
}

.ofc-subview-link-success {
	border: 1px solid #b7e3b7;
	border-radius: 6px;
	padding: 10px 14px;
	margin: 0 0 14px;
	background: #effaef;
	color: #1d4d1d;
}

.ofc-subview-link-success p {
	margin: 0;
}

.ofc-subview-card-head {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: #555;
	margin-bottom: 6px;
}

.ofc-subview-card-status {
	background: #e7f3ff;
	color: #1d4d1d;
	padding: 1px 8px;
	border-radius: 9px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
}

.ofc-subview-card ul.ofc-rkr-subs-pairs {
	margin: 0 0 8px;
	padding: 0 0 0 20px;
	list-style: disc;
}

/* Per-group LIVE status in "Moje zgłoszenia": muted preliminary text, amber for a
   possible waitlist (group full now), red/bold for an explicit waitlist reservation. */
.ofc-subview-pair-status {
	margin-left: 8px;
	font-size: 12px;
	color: #555;
}
.ofc-subview-pair-status.is-maybe-waitlist { color: #8a6d00; }
.ofc-subview-pair-status.is-waitlist {
	color: #b32d2e;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ofc-subview-uwagi {
	font-size: 13px;
	color: #333;
	margin: 8px 0;
}

.ofc-zapis-group-picker {
	max-width: 100% !important;
}

/* "Wybrane grupy:" header — same size as the field label ("Wybierz grupę kursową"),
   but bold. JS reveals it only while at least one chip is selected. */
.ofc-zapis-selected-label {
	font-size: 13px;
	color: #333;
	font-weight: 700;
	margin: 10px 0 0;
}

.ofc-zapis-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
	min-height: 24px;
}

.ofc-zapis-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #e7f3ff;
	border: 1px solid #b3d8ff;
	color: #103a66;
	border-radius: 14px;
	padding: 3px 4px 3px 10px;
	font-size: 15px;
	font-weight: bold;
	line-height: 1.2;
}

@media (max-width: 600px) {
	.ofc-zapis-chip {
		font-size: 14px;
	}
}

.ofc-zapis-chip-remove {
	background: transparent;
	border: 0;
	color: #103a66;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 50%;
}

.ofc-zapis-chip-remove:hover,
.ofc-zapis-chip-remove:focus {
	background: #b3d8ff;
}

.ofc-zapis-rodo .ofc-zapis-rodo-label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	line-height: 1.4;
}

.ofc-zapis-rodo input[type="checkbox"] {
	margin-top: 2px;
}

.ofc-zapis-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.ofc-zapis-submit {
	background: #2271b1;
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ofc-zapis-submit:hover {
	background: #135e96;
}

.ofc-zapis-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ofc-zapis-status {
	font-size: 13px;
	color: #555;
}

/* Shared "error box" look: the summary errors box AND any invalid field row
   (.ofc-zapis-row-error, added by JS). The row's own label/input keep their
   explicit styles, so only the box framing (red bg + accent border) shows. */
.ofc-zapis-errors,
.ofc-zapis-row.ofc-zapis-row-error {
	color: #b32d2e;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 4px 0 12px;
	padding: 12px 16px;
	background: #fcebea;
	border: 1px solid #d63638;
	border-left-width: 5px;
	border-radius: 6px;
}

/* Keep no empty red box when there are no errors. */
.ofc-zapis-errors:empty {
	display: none;
}

.ofc-zapis-field-error {
	color: #b32d2e;
	font-size: 12px;
	margin-top: 2px;
}

.ofc-zapis-invalid {
	border-color: #b32d2e !important;
}

.ofc-zapis-empty {
	padding: 14px;
	background: #fff8e1;
	border: 1px solid #ffe0a0;
	border-radius: 4px;
	color: #6e4f00;
}

.ofc-zapis-thanks {
	padding: 18px;
	background: #edf7ed;
	border: 1px solid #b6d6b3;
	border-radius: 6px;
	color: #1d4d1d;
}

/* Per-section lock UX (Zmień dane / Zapisz zmiany) ---------------------- */

.ofc-zapis-fs .ofc-zapis-section-edit {
	float: right;
	background: transparent;
	border: 0;
	color: #2271b1;
	font-size: 12px;
	cursor: pointer;
	padding: 2px 4px;
	margin: -2px -4px 0 0;
	text-decoration: underline;
}

.ofc-zapis-fs .ofc-zapis-section-edit:hover {
	color: #135e96;
}

.ofc-zapis-fs.is-locked .ofc-zapis-row,
.ofc-zapis-fs.is-locked .ofc-zapis-role-options,
.ofc-zapis-fs.is-locked .ofc-zapis-role-desc {
	display: none !important;
}

.ofc-zapis-fs.is-locked .ofc-zapis-fs-summary {
	display: block;
	font-size: 14px;
	color: #333;
	padding: 6px 2px 2px;
}

/* Wyczyść cały formularz button ----------------------------------------- */

.ofc-zapis-clear {
	background: transparent;
	border: 0;
	color: #b32d2e;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
	margin-left: auto;
	text-decoration: underline;
}

.ofc-zapis-clear:hover {
	color: #8a2424;
}

/* OTP rows ---------------------------------------------------------------- */

.ofc-zapis-otp-input,
.ofc-zapis-otp-code-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.ofc-zapis-otp-input input {
	flex: 1 1 240px;
}

.ofc-zapis-otp-send,
.ofc-zapis-otp-check {
	white-space: nowrap;
}

.ofc-zapis-otp-code-label {
	margin-top: 8px;
	font-size: 12px;
	color: #555;
}

.ofc-zapis-otp-code {
	width: 120px !important;
	font-size: 16px;
	letter-spacing: 0.2em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.ofc-zapis-otp-resend {
	font-size: 12px;
}

.ofc-zapis-otp-verified {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	padding: 8px 10px;
	background: #edf7ed;
	border: 1px solid #b6d6b3;
	border-radius: 4px;
	color: #1d4d1d;
	font-size: 14px;
}

.ofc-zapis-otp-ok {
	font-weight: 600;
}

.ofc-zapis-otp-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ofc-zapis-otp-change {
	font-size: 12px;
	margin-left: auto;
}

.ofc-zapis-otp-status {
	font-size: 12px;
	color: #555;
	margin-top: 4px;
	min-height: 1em;
}

.ofc-zapis-otp-status.ofc-zapis-otp-status-error {
	color: #d83131;
	font-weight: 600;
}

/* v2: "Kim jesteś?" locked for an existing account — pills non-clickable until
   "Zmień dane" is clicked. Radios stay enabled (so submitter_role still submits);
   only pointer interaction is blocked and non-selected options are dimmed. */
.ofc-zapis-fs-role.ofc-zapis-v2-role-locked .ofc-zapis-role-options {
	pointer-events: none;
}
.ofc-zapis-fs-role.ofc-zapis-v2-role-locked .ofc-zapis-role-option:not(.is-selected) {
	opacity: 0.45;
}

/* Duplicate-submission modal (replaces the native confirm()). */
.ofc-zapis-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 16px;
}
.ofc-zapis-modal {
	background: #fff;
	max-width: 520px;
	width: 100%;
	border-radius: 8px;
	padding: 22px 24px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	font-size: 15px;
	line-height: 1.5;
}
.ofc-zapis-modal-msg {
	margin: 0 0 12px;
	font-weight: 600;
}
.ofc-zapis-modal-existing {
	margin: 0 0 12px;
	padding-left: 18px;
}
.ofc-zapis-modal-existing li {
	margin-bottom: 6px;
}
.ofc-zapis-modal-link {
	margin: 0 0 14px;
}
.ofc-zapis-modal-question {
	margin: 0 0 16px;
}
.ofc-zapis-modal-actions {
	display: flex;
	gap: 14px;
	align-items: center;
	flex-wrap: wrap;
}
.ofc-zapis-modal-actions .ofc-zapis-modal-cancel {
	background: none;
	border: none;
	cursor: pointer;
}

/* v2 logged-out email-first gate. */
.ofc-zapis-v2-gate-result {
	margin-top: 8px;
}
.ofc-zapis-v2-gate-result .ofc-zapis-v2-gate-msg {
	margin: 0 0 12px;
}
.ofc-zapis-v2-gate-result .button-link {
	background: none;
	border: none;
	cursor: pointer;
	margin-top: 8px;
	display: inline-block;
}

.ofc-zapis-readonly {
	background: #f6f7f7 !important;
	color: #555 !important;
}

/* Turnstile widget row ---------------------------------------------------- */

.ofc-zapis-turnstile {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

/* Manual "re-run the human check" button next to the widget. */
.ofc-zapis-turnstile-refresh {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: #2271b1;
	background: transparent;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	cursor: pointer;
}

.ofc-zapis-turnstile-refresh:hover {
	background: #f0f6fc;
	border-color: #2271b1;
}
