/* Generátor kupní smlouvy – autoprodano.cz */

.ap-gen { margin: 24px 0; }
.ap-gen [hidden] { display: none !important; }

.ap-gen__form fieldset {
	border: 1px solid #dde2e8;
	border-radius: 10px;
	padding: 14px 16px 6px;
	margin: 0 0 18px;
}
.ap-gen__form legend { font-weight: 700; padding: 0 6px; }

.ap-gen__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px 16px;
	margin-bottom: 10px;
}
.ap-gen__full { grid-column: 1 / -1; }

.ap-gen__form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.92rem;
	font-weight: 600;
}
.ap-gen__form input,
.ap-gen__form select,
.ap-gen__form textarea {
	font: inherit;
	font-weight: 400;
	font-size: 16px; /* bez zoomu na iPhonu */
	padding: 9px 10px;
	border: 1px solid #b9c2cc;
	border-radius: 8px;
	background: #fff;
	width: 100%;
}
.ap-gen__form input:focus,
.ap-gen__form select:focus,
.ap-gen__form textarea:focus {
	outline: 2px solid #0b6e4f;
	outline-offset: 1px;
}
.ap-gen__form .is-invalid { border-color: #c62828; background: #fff6f6; }

.ap-gen__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	align-items: center;
	margin: 4px 0 12px;
	font-size: 0.92rem;
}
.ap-gen__checks label { flex-direction: row; align-items: center; font-weight: 400; gap: 6px; }
.ap-gen__checks input { width: auto; }

.ap-gen__hint { font-weight: 400; font-size: 0.82rem; color: #5b6675; min-height: 1em; }
.ap-gen__hint.is-warn { color: #a15c00; }
.ap-gen__hint.is-ok { color: #0b6e4f; }

.ap-gen__note { font-size: 0.92rem; color: #5b6675; }

.ap-gen__errors:not(:empty) {
	background: #fff6f6;
	border: 1px solid #e3b4b4;
	color: #8e1f1f;
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0 0 12px;
}

.ap-gen__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.ap-gen__actions .ap-gen__note { flex-basis: 100%; margin: 0; }

.ap-gen__disclaimer { font-size: 0.82rem; color: #5b6675; margin-top: 18px; }

/* ---------- Dokument ---------- */
.ap-doc {
	background: #fff;
	border: 1px solid #dde2e8;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	padding: 32px 36px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 14px;
	line-height: 1.5;
	color: #000;
}
.ap-doc h2 { text-align: center; font-size: 20px; margin: 0 0 2px; letter-spacing: 0.02em; }
.ap-doc .ap-doc__sub { text-align: center; margin: 0 0 20px; font-size: 13px; }
.ap-doc h3 { font-size: 15px; margin: 18px 0 6px; text-align: center; }
.ap-doc p, .ap-doc li { margin: 0 0 6px; }
.ap-doc ol { padding-left: 20px; margin: 0 0 6px; }
.ap-doc table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.ap-doc td { border: 1px solid #999; padding: 4px 8px; vertical-align: top; }
.ap-doc td:first-child { width: 42%; }
.ap-doc .ap-doc__strana { margin: 0 0 10px; }
.ap-doc .ap-doc__podpisy {
	display: flex;
	justify-content: space-between;
	gap: 40px;
	margin-top: 48px;
}
.ap-doc .ap-doc__podpis { flex: 1; text-align: center; border-top: 1px solid #000; padding-top: 4px; }
.ap-doc .ap-doc__paticka { margin-top: 28px; font-size: 10px; color: #666; text-align: center; }

@media (max-width: 600px) {
	.ap-doc { padding: 18px 14px; font-size: 13px; }
}

/* ---------- Tisk: jen smlouva ---------- */
@media print {
	body * { visibility: hidden !important; }
	.ap-doc, .ap-doc * { visibility: visible !important; }
	.ap-doc {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		border: 0;
		box-shadow: none;
		padding: 0;
		font-size: 11.5pt;
	}
	.ap-doc .ap-doc__podpisy { break-inside: avoid; }
	@page { margin: 18mm 16mm; }
}
