/* NOVA medical – Formuláre
 * Farby sa dajú prispôsobiť v téme, napr.:
 *   .nmf { --nmf-primary: #89508a; --nmf-accent: #c24683; }
 */

.nmf {
	--nmf-primary: #89508a;
	--nmf-primary-hover: #6f3f70;
	--nmf-primary-soft: #f6eff6;
	--nmf-accent: #c24683;
	--nmf-accent-soft: #fbeef4;
	--nmf-ring: rgba(137, 80, 138, .24);
	--nmf-text: #2a2230;
	--nmf-muted: #6b6172;
	--nmf-border: #e6dfe8;
	--nmf-border-strong: #c9bccd;
	--nmf-surface: #fff;
	--nmf-surface-alt: #faf7fb;
	--nmf-error: #b92a31;
	--nmf-error-soft: #fcefef;
	--nmf-success: #167a4a;
	--nmf-success-soft: #e8f6ee;
	--nmf-radius: 16px;
	--nmf-radius-sm: 10px;

	max-width: 760px;
	margin: 0 auto;
	color: var(--nmf-text);
	font-size: 16px;
	line-height: 1.5;
}

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

.nmf [hidden] { display: none !important; }

/* ── Kontajner ───────────────────────────────────────────── */

.nmf .nmf-form,
.nmf .nmf-success {
	background: var(--nmf-surface);
	border: 1px solid var(--nmf-border);
	border-radius: var(--nmf-radius);
	box-shadow: 0 1px 2px rgba(20, 40, 60, .04), 0 12px 32px -12px rgba(20, 40, 60, .12);
	padding: clamp(20px, 4.5vw, 40px);
	margin: 0;
}

.nmf .nmf-header {
	margin: 0 0 28px;
	padding: 0 0 24px;
	border-bottom: 1px solid var(--nmf-border);
}

.nmf .nmf-title {
	margin: 0 0 8px;
	font-size: clamp(1.35rem, 2.6vw, 1.7rem);
	line-height: 1.25;
	color: var(--nmf-text);
}

.nmf .nmf-intro {
	margin: 0;
	max-width: 60ch;
	color: var(--nmf-muted);
	white-space: pre-line;
}

/* Termín */

.nmf .nmf-event {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 0;
	padding: 10px 18px 10px 14px;
	border-radius: 12px;
	background: var(--nmf-accent-soft);
	color: var(--nmf-accent);
	line-height: 1.25;
}

.nmf .nmf-event svg { flex: none; }
.nmf .nmf-event__label { display: block; font-size: .8rem; color: var(--nmf-muted); }
.nmf .nmf-event__value { display: block; font-size: 1.05rem; font-weight: 700; color: var(--nmf-text); }

.nmf .nmf-closed {
	padding: 24px 28px;
	border: 1px solid var(--nmf-border);
	border-radius: var(--nmf-radius);
	background: var(--nmf-surface-alt);
	color: var(--nmf-muted);
	text-align: center;
	white-space: pre-line;
}

/* ── Sekcie ──────────────────────────────────────────────── */

.nmf .nmf-section + .nmf-section { margin-top: 32px; }

.nmf .nmf-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
}

.nmf .nmf-section__title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--nmf-text);
}

.nmf .nmf-section__intro {
	margin: -6px 0 16px;
	font-size: .93rem;
	color: var(--nmf-muted);
	white-space: pre-line;
}

.nmf .nmf-counter {
	font-size: .85rem;
	color: var(--nmf-muted);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.nmf .nmf-section--consent {
	padding-top: 24px;
	border-top: 1px solid var(--nmf-border);
}

/* ── Osoby ───────────────────────────────────────────────── */

.nmf .nmf-people {
	display: grid;
	gap: 14px;
}

.nmf .nmf-person {
	background: var(--nmf-surface-alt);
	border: 1px solid var(--nmf-border);
	border-radius: 12px;
	padding: 18px 20px 20px;
}

.nmf .nmf-person.is-new { animation: nmf-in .22s ease-out; }

@keyframes nmf-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.nmf .nmf-person__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
}

.nmf .nmf-person__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--nmf-accent);
	color: #fff;
	font-size: .85rem;
	font-weight: 700;
	line-height: 1;
}

.nmf .nmf-person__title {
	flex: 1;
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--nmf-text);
}

.nmf .nmf-person__remove {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--nmf-muted);
	font: inherit;
	font-size: .875rem;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.nmf .nmf-person__remove:hover,
.nmf .nmf-person__remove:focus-visible {
	background: var(--nmf-error-soft);
	color: var(--nmf-error);
}

.nmf .nmf-add {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	margin: 14px 0 0;
	padding: 10px 16px;
	border: 1.5px dashed var(--nmf-primary);
	border-radius: 12px;
	background: transparent;
	color: var(--nmf-primary);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	transition: background-color .15s;
}

.nmf .nmf-add:hover { background: var(--nmf-primary-soft); color: var(--nmf-primary-hover); }

.nmf .nmf-add:disabled {
	border-color: var(--nmf-border-strong);
	color: var(--nmf-muted);
	background: transparent;
	cursor: not-allowed;
	opacity: .7;
}

/* ── Mriežka a polia ─────────────────────────────────────── */

.nmf .nmf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 18px;
}

.nmf .nmf-w-full { grid-column: 1 / -1; }

.nmf .nmf-field { min-width: 0; margin: 0; }

.nmf .nmf-label,
.nmf .nmf-fieldset > legend {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--nmf-text);
}

.nmf .nmf-req { color: var(--nmf-error); margin-left: 2px; }

.nmf .nmf-fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.nmf .nmf-input {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--nmf-border-strong);
	border-radius: var(--nmf-radius-sm);
	background: #fff;
	color: var(--nmf-text);
	font: inherit;
	font-size: 16px; /* iOS nezoomuje */
	line-height: 1.2;
	box-shadow: none;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}

.nmf .nmf-input::placeholder { color: #a79dab; opacity: 1; }
.nmf .nmf-input:hover { border-color: #a898ad; }

.nmf .nmf-input:focus {
	border-color: var(--nmf-primary);
	box-shadow: 0 0 0 3px var(--nmf-ring);
}

.nmf select.nmf-input {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 42px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b6172' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 12px 8px;
	cursor: pointer;
}

.nmf input[type=number].nmf-input { -moz-appearance: textfield; }
.nmf input[type=number].nmf-input::-webkit-outer-spin-button,
.nmf input[type=number].nmf-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Radio ako segmentové tlačidlá */

.nmf .nmf-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.nmf .nmf-choice {
	position: relative;
	flex: 1 1 0;
	min-width: 88px;
	margin: 0;
}

.nmf .nmf-choice input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.nmf .nmf-choice span {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--nmf-border-strong);
	border-radius: var(--nmf-radius-sm);
	background: #fff;
	font-weight: 500;
	line-height: 1.2;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.nmf .nmf-choice span::before {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	border: 1.5px solid var(--nmf-border-strong);
	border-radius: 50%;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}

.nmf .nmf-choice:hover span { border-color: #a898ad; }

.nmf .nmf-choice input:checked + span {
	border-color: var(--nmf-primary);
	background: var(--nmf-primary-soft);
	color: var(--nmf-primary-hover);
}

.nmf .nmf-choice input:checked + span::before {
	border-color: var(--nmf-primary);
	box-shadow: inset 0 0 0 3.5px #fff, inset 0 0 0 8px var(--nmf-primary);
}

.nmf .nmf-choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--nmf-ring); }

/* Časové sloty */

.nmf .nmf-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.nmf .nmf-slot {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--nmf-border-strong);
	border-radius: var(--nmf-radius-sm);
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.nmf .nmf-slot input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.nmf .nmf-slot__time {
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}

.nmf .nmf-slot__cap { font-size: .82rem; color: var(--nmf-muted); }

.nmf .nmf-slot:hover { border-color: #a898ad; }

.nmf .nmf-slot:has(input:checked) {
	border-color: var(--nmf-primary);
	background: var(--nmf-primary-soft);
	box-shadow: inset 0 0 0 1px var(--nmf-primary);
}

.nmf .nmf-slot:has(input:checked) .nmf-slot__time { color: var(--nmf-primary-hover); }
.nmf .nmf-slot:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--nmf-ring); }

.nmf .nmf-slot.is-full,
.nmf .nmf-slot.is-insufficient {
	border-style: dashed;
	border-color: var(--nmf-border);
	background: var(--nmf-surface-alt);
	cursor: not-allowed;
}

.nmf .nmf-slot.is-full input,
.nmf .nmf-slot.is-insufficient input { cursor: not-allowed; }

.nmf .nmf-slot.is-full .nmf-slot__time { color: #b3aab6; text-decoration: line-through; }
.nmf .nmf-slot.is-full .nmf-slot__cap { color: var(--nmf-error); }
.nmf .nmf-slot.is-insufficient .nmf-slot__time { color: #9a8f9e; }
.nmf .nmf-slot.is-insufficient .nmf-slot__cap { color: var(--nmf-accent); }

.nmf .nmf-field.is-invalid .nmf-slot:not(.is-full):not(.is-insufficient) { border-color: var(--nmf-error); }

/* Checkbox */

.nmf .nmf-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 14px 16px;
	border: 1px solid var(--nmf-border);
	border-radius: var(--nmf-radius-sm);
	background: #fff;
	font-weight: 400;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}

.nmf .nmf-check input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.nmf .nmf-check__box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 1.5px solid var(--nmf-border-strong);
	border-radius: 6px;
	background: #fff;
	transition: background-color .15s, border-color .15s, box-shadow .15s;
}

.nmf .nmf-check__box::after {
	content: "";
	width: 6px;
	height: 11px;
	margin-top: -2px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
}

.nmf .nmf-check input:checked ~ .nmf-check__box {
	border-color: var(--nmf-primary);
	background: var(--nmf-primary);
}

.nmf .nmf-check input:checked ~ .nmf-check__box::after { opacity: 1; }
.nmf .nmf-check input:focus-visible ~ .nmf-check__box { box-shadow: 0 0 0 3px var(--nmf-ring); }
.nmf .nmf-check:hover { border-color: var(--nmf-border-strong); }
.nmf .nmf-check:has(input:checked) { border-color: var(--nmf-primary); background: var(--nmf-primary-soft); }

.nmf .nmf-check__text { font-size: .95rem; line-height: 1.45; }
.nmf .nmf-check__text a { color: var(--nmf-primary); text-decoration: underline; margin-left: 4px; }

.nmf .nmf-section--consent .nmf-check { border: 0; padding: 0; background: transparent; }

/* Chyby a nápoveda */

.nmf .nmf-help,
.nmf .nmf-error {
	margin: 6px 0 0;
	font-size: .85rem;
	line-height: 1.4;
}

.nmf .nmf-help { color: var(--nmf-muted); }
.nmf .nmf-error { color: var(--nmf-error); font-weight: 500; }
.nmf .nmf-error:empty { display: none; }

.nmf .nmf-field.is-invalid .nmf-input,
.nmf .nmf-field.is-invalid .nmf-choice span,
.nmf .nmf-field.is-invalid .nmf-check__box { border-color: var(--nmf-error); }
.nmf .nmf-field.is-invalid .nmf-check:not(.nmf-section--consent .nmf-check) { border-color: var(--nmf-error); }
.nmf .nmf-field.is-invalid .nmf-input:focus { box-shadow: 0 0 0 3px rgba(185, 42, 49, .16); }

/* ── Odoslanie ───────────────────────────────────────────── */

.nmf .nmf-status {
	margin: 24px 0 0;
	padding: 12px 16px;
	border: 1px solid rgba(185, 42, 49, .25);
	border-radius: var(--nmf-radius-sm);
	background: var(--nmf-error-soft);
	color: var(--nmf-error);
	font-size: .93rem;
}

.nmf .nmf-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	margin: 28px 0 0;
}

.nmf .nmf-submit {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 240px;
	min-height: 54px;
	margin: 0;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--nmf-radius-sm);
	background: var(--nmf-primary);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	transition: background-color .15s;
}

.nmf .nmf-submit:hover { background: var(--nmf-primary-hover); color: #fff; }
.nmf .nmf-submit:focus-visible { outline: 3px solid var(--nmf-ring); outline-offset: 2px; }
.nmf .nmf-submit:disabled { cursor: progress; opacity: .8; }

.nmf .nmf-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: nmf-spin .7s linear infinite;
}

.nmf .nmf-form.is-busy .nmf-spinner { display: inline-block; }

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

.nmf .nmf-note { margin: 0; font-size: .85rem; color: var(--nmf-muted); }

/* ── Úspech ──────────────────────────────────────────────── */

.nmf .nmf-success { text-align: center; outline: none; }

.nmf .nmf-success__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--nmf-success-soft);
	color: var(--nmf-success);
}

.nmf .nmf-success__title { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.3; color: var(--nmf-text); }
.nmf .nmf-success__text { max-width: 46ch; margin: 0 auto 24px; color: var(--nmf-muted); white-space: pre-line; }

.nmf .nmf-again {
	appearance: none;
	margin: 0;
	padding: 12px 20px;
	border: 1px solid var(--nmf-border-strong);
	border-radius: var(--nmf-radius-sm);
	background: #fff;
	color: var(--nmf-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
}

.nmf .nmf-again:hover { border-color: var(--nmf-primary); color: var(--nmf-primary); background: #fff; }

/* Honeypot */
.nmf .nmf-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── Mobil ───────────────────────────────────────────────── */

@media (max-width: 600px) {
	.nmf .nmf-grid { grid-template-columns: 1fr; }
	.nmf .nmf-person { padding: 16px; }
	.nmf .nmf-submit { width: 100%; min-width: 0; }
	.nmf .nmf-actions { flex-direction: column-reverse; align-items: stretch; }
	.nmf .nmf-note { text-align: center; }
}

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