/* Marketstal Wyceny - formularz front-end (motyw pomaranczowo-czerwony) */
.mks-form-wrap {
	--mks-brand: #e8590c;
	--mks-brand-dark: #c0390b;
	--mks-red: #c92a2a;
	--mks-line: #ecdfd6;
	--mks-line2: #d9c7ba;
	--mks-text: #2b2018;
	--mks-muted: #8a7b70;
	max-width: 820px;
	margin: 0 auto;
	font-size: 15px;
	color: var(--mks-text);
	font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.mks-form-wrap *,
.mks-form-wrap *::before,
.mks-form-wrap *::after { box-sizing: border-box; }

.mks-head {
	display: flex;
	gap: 0;
	border: 1px solid var(--mks-line);
	border-top: 4px solid var(--mks-brand);
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 20px;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}
.mks-head-col { padding: 18px; flex: 1; }
.mks-head-profil {
	background: #fff4ec;
	border-right: 1px solid var(--mks-line);
	max-width: 230px;
	text-align: center;
}
.mks-head-col h3 {
	margin: 0 0 10px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--mks-brand-dark);
}
.mks-head-img { display: block; max-width: 100%; border-radius: 6px; }
.mks-head-img--ph { min-height: 90px; border: 2px dashed var(--mks-line2); border-radius: 6px; background: #fff; }
.mks-head-info p { margin: 0; line-height: 1.5; }

/* Komunikaty */
.mks-notice { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.mks-notice-ok { background: #e8f8ec; border: 1px solid #8ce0a0; color: #1b6e2c; }
.mks-notice-err { background: #fdecea; border: 1px solid #f3a9a0; color: #a3271b; }

/* Pola */
.mks-field { margin-bottom: 16px; }
.mks-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.mks-req { color: var(--mks-red); }
.mks-opt { color: var(--mks-muted); font-weight: 400; font-size: 13px; }
.mks-field-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--mks-muted); font-weight: 400; line-height: 1.4; }
.mks-form input[type="text"],
.mks-form input[type="email"],
.mks-form input[type="tel"],
.mks-form input[type="number"],
.mks-form input[type="file"],
.mks-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--mks-line2);
	border-radius: 8px;
	font-size: 15px;
	background: #fff;
	font-family: inherit;
}
.mks-form input:focus,
.mks-form textarea:focus {
	outline: none;
	border-color: var(--mks-brand);
	box-shadow: 0 0 0 3px rgba(232, 89, 12, .16);
}

fieldset.mks-positions,
fieldset.mks-klient {
	border: 1px solid var(--mks-line);
	border-radius: 12px;
	padding: 18px;
	margin: 0 0 18px;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}
.mks-form legend { font-weight: 800; padding: 0 10px; color: var(--mks-brand-dark); }

/* Wiersz pozycji */
.mks-pos {
	display: grid;
	grid-template-columns: 1fr 110px 1fr 36px;
	gap: 12px;
	align-items: end;
	padding: 14px;
	border: 1px dashed var(--mks-line2);
	border-radius: 10px;
	margin-bottom: 12px;
	background: #fdf9f6;
}
.mks-pos.mks-pos-nomat { grid-template-columns: 130px 1fr 36px; }
.mks-pos-field label { font-size: 13px; margin-bottom: 4px; }
.mks-pos-remove {
	height: 40px;
	width: 36px;
	border: 1px solid #f3c2c2;
	background: #fdeaea;
	color: var(--mks-red);
	border-radius: 8px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.mks-pos-remove:hover { background: #f9d5d5; }
.mks-add {
	display: inline-block;
	background: #fff4ec;
	border: 1.5px solid #f3c79f;
	color: var(--mks-brand-dark);
	padding: 9px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
}
.mks-add:hover { background: #ffe8d6; }

/* Combobox */
.mks-combo { position: relative; }
.mks-combo-list {
	position: absolute;
	z-index: 50;
	top: 100%;
	left: 0;
	right: 0;
	max-height: 280px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--mks-line2);
	border-radius: 0 0 10px 10px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, .15);
	margin-top: 2px;
}
.mks-combo-group {
	padding: 7px 12px;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #fff;
	background: var(--mks-brand);
	position: sticky;
	top: 0;
}
.mks-combo-item { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.mks-combo-item:hover,
.mks-combo-item.is-active { background: #fff4ec; }
.mks-combo-empty { padding: 12px; color: var(--mks-muted); }

/* Klient */
.mks-klient-typ { display: flex; gap: 20px; margin-bottom: 16px; }
.mks-klient-typ label { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.mks-klient-grp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Regulamin */
.mks-regulamin label { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.mks-regulamin input { margin-top: 3px; }

/* Honeypot */
.mks-hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* Submit */
.mks-submit {
	background: linear-gradient(135deg, #f59f00 0%, #e8590c 55%, #d9480f 100%);
	color: #fff;
	border: none;
	padding: 15px 26px;
	font-size: 16px;
	font-weight: 800;
	border-radius: 10px;
	cursor: pointer;
	width: 100%;
	box-shadow: 0 6px 18px rgba(217, 72, 15, .28);
}
.mks-submit:hover { filter: brightness(1.05); }
.mks-submit:disabled,
.mks-submit.is-loading { opacity: .7; cursor: progress; }

@media ( max-width: 640px ) {
	.mks-head { flex-direction: column; }
	.mks-head-profil { max-width: none; border-right: none; border-bottom: 1px solid var(--mks-line); }
	.mks-pos { grid-template-columns: 1fr 1fr; }
	.mks-pos.mks-pos-nomat { grid-template-columns: 1fr 1fr; }
	.mks-pos-profil { grid-column: 1 / -1; }
	.mks-pos-remove { grid-column: 2; justify-self: end; }
	.mks-klient-grp { grid-template-columns: 1fr; }
}

/* Konfigurator pod formularzem (MVP2) */
.mks-konfig-details { max-width: 920px; margin: 14px auto 0; }
.mks-konfig-details > summary {
	list-style: none; cursor: pointer; text-align: center;
	background: #fff4ec; border: 1.5px solid #f3c79f; color: #c0390b;
	padding: 12px 18px; border-radius: 10px; font-weight: 700; font-size: 15px;
}
.mks-konfig-details > summary::-webkit-details-marker { display: none; }
.mks-konfig-details > summary:hover { background: #ffe8d6; }
.mks-konfig-intro { color: #8a7b70; font-size: 14px; margin: 14px 0; }

/* ===== MVP2: uklad dwukolumnowy (formularz 75% | konfigurator 25%) ===== */
.mks-form-wrap.mks-mvp2 { max-width: 1500px; }
.mks-photo { margin: 0 0 18px; }
.mks-photo img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; display: block; }
.mks-photo-ph { border: 2px dashed var(--mks-line2); border-radius: 14px; padding: 24px; text-align: center; color: var(--mks-muted); background: #fff; font-size: 14px; }
.mks-twocol { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.mks-lead {
	font-size: 32px; font-weight: 800; line-height: 1.1; margin: 0 0 16px; letter-spacing: -.01em;
	background: linear-gradient(135deg, #f59f00 0%, #e8590c 55%, #d9480f 100%);
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.mks-info-bar { background: #fff4ec; border-left: 4px solid var(--mks-brand); border-radius: 0 8px 8px 0; padding: 12px 16px; margin-bottom: 18px; color: #7a4a2a; font-size: 14px; }
.mks-kf-titlebox h2 { font-size: 22px; font-weight: 800; color: var(--mks-brand-dark); margin: 0 0 2px; }
.mks-kf-titlebox p { color: var(--mks-muted); margin: 0; font-size: 15px; }
.mks-kf-intro { color: var(--mks-muted); font-size: 14px; margin: 6px 0 14px; }
/* konfigurator w waskiej prawej kolumnie: stackuj i ukryj jego wlasny naglowek */
.mks-col-right .mksk-grid { grid-template-columns: 1fr; }
.mks-col-right .mksk-hero { display: none; }
.mks-col-right .mksk { max-width: none; }
@media ( max-width: 980px ) { .mks-twocol { grid-template-columns: 1fr; } }

/* ===================== v1.6/1.7: callout materialu, pole na cala szerokosc, zlecenia zbiorcze, strony info ===================== */

/* Wyrozniona zasada o materiale */
.mks-material-callout {
	display: flex; gap: 12px; align-items: flex-start;
	background: linear-gradient( 135deg, #fff4ec, #ffe6d2 ); border: 1.5px solid #f3a96a; border-left: 6px solid var(--mks-brand);
	border-radius: 12px; padding: 14px 16px; margin: 8px 0 18px; line-height: 1.5; font-weight: 600; color: #7a4a2a;
}
.mks-material-ico {
	flex: 0 0 26px; height: 26px; width: 26px; border-radius: 50%; background: var(--mks-brand);
	color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* Pole materialu (profil/blacha) wieksze i na cala szerokosc wiersza */
.mks-pos-profil-emph { grid-column: 1 / -1; }
.mks-pos-profil-emph label { font-size: 15px; font-weight: 800; color: var(--mks-brand-dark); }
.mks-pos-profil-emph .mks-combo-input { font-size: 16px; padding: 13px 14px; border-width: 2px; }

/* Pozycja zbiorcza: usluga per pozycja (uklad elastyczny) */
.mks-pos-combo { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.mks-pos-combo .mks-pos-field { flex: 1 1 150px; min-width: 120px; }
.mks-pos-combo .mks-pos-typ { flex: 0 0 180px; }
.mks-pos-combo .mks-pos-ilosc { flex: 0 0 110px; }
.mks-pos-combo .mks-pos-profil { flex: 1 1 100%; }
.mks-pos-combo .mks-pos-dxf { flex: 2 1 190px; }
.mks-pos-combo .mks-pos-remove { flex: 0 0 36px; align-self: end; }
.mks-pos-combo .mks-pos-nofile { display: none; }

/* Strony informacyjne (Regulamin / Instrukcja / FAQ) */
.mks-info-page { max-width: 880px; margin: 0 auto; }
.mks-info-card { background: #fff; border: 1px solid var(--mks-line); border-radius: 14px; padding: 6px 28px 24px; box-shadow: 0 4px 16px rgba( 30,50,70,.08 ); }
.mks-info-card h2 { color: var(--mks-brand-dark); border-bottom: 2px solid #f3e7df; padding-bottom: 6px; margin: 24px 0 10px; font-size: 17px; }
.mks-info-card p { line-height: 1.6; color: var(--mks-text); }
.mks-info-card .mks-muted { color: var(--mks-muted); }
.mks-faq-item { border-bottom: 1px solid #f1e8e1; padding: 13px 0; }
.mks-faq-item:last-child { border-bottom: 0; }
.mks-faq dt { font-weight: 800; color: var(--mks-brand-dark); margin-bottom: 4px; }
.mks-faq dd { margin: 0; color: var(--mks-text); line-height: 1.55; }

@media ( max-width: 980px ) {
	.mks-pos-combo .mks-pos-dxf { flex: 1 1 100%; }
}

/* ===================================================================== *
 * Ankieta po wyslaniu zapytania (pop-up). Klasy nie zaleza od .mks-form-wrap
 * (modal jest dopinany do <body>), wiec kolory podane wprost.
 * ===================================================================== */
.mks-survey-overlay {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center;
	padding: 18px;
	background: rgba( 25, 16, 10, .55 );
	-webkit-backdrop-filter: blur( 3px ); backdrop-filter: blur( 3px );
	opacity: 0; transition: opacity .25s ease;
	font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.mks-survey-overlay.is-open { opacity: 1; }
.mks-survey {
	position: relative;
	width: 100%; max-width: 460px;
	background: #fff; border-radius: 18px;
	box-shadow: 0 24px 60px rgba( 30, 20, 10, .35 );
	overflow: hidden;
	transform: translateY( 18px ) scale( .98 );
	transition: transform .28s cubic-bezier( .2, .8, .25, 1 );
	max-height: calc( 100vh - 36px ); overflow-y: auto;
}
.mks-survey-overlay.is-open .mks-survey { transform: translateY( 0 ) scale( 1 ); }
.mks-survey-x {
	position: absolute; top: 10px; right: 12px;
	border: 0; background: none; cursor: pointer;
	font-size: 26px; line-height: 1; color: #fff; opacity: .85;
}
.mks-survey-x:hover { opacity: 1; }
.mks-survey-head {
	background: linear-gradient( 135deg, #f59f00, #e8590c 55%, #d9480f );
	color: #fff; padding: 22px 24px 18px; text-align: center;
}
.mks-survey-emoji { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.mks-survey-head h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: #fff; }
.mks-survey-head p { margin: 0; font-size: 13.5px; line-height: 1.5; opacity: .96; }
.mks-survey-body { padding: 18px 22px 8px; }
.mks-survey-q { font-weight: 700; color: #2b2018; font-size: 14.5px; margin: 6px 0 10px; }
.mks-survey-diff { display: flex; gap: 8px; margin-bottom: 16px; }
.mks-survey-diff-btn {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 12px 6px; border: 1.5px solid #e6d6ca; background: #fff;
	border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: #5f5048;
	transition: border-color .15s, background .15s, transform .1s;
}
.mks-survey-diff-btn:hover { border-color: #e8590c; }
.mks-survey-diff-btn.is-active {
	border-color: #e8590c; background: #fff4ec; color: #c0390b; transform: translateY( -1px );
}
.mks-survey-face { font-size: 26px; line-height: 1; }
.mks-survey-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.mks-survey-chip {
	border: 1.5px solid #e6d6ca; background: #fff; color: #5f5048;
	border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer;
	transition: border-color .15s, background .15s, color .15s;
}
.mks-survey-chip:hover { border-color: #e8590c; }
.mks-survey-chip.is-active { border-color: #e8590c; background: #e8590c; color: #fff; }
.mks-survey-text {
	width: 100%; border: 1.5px solid #e6d6ca; border-radius: 12px;
	padding: 10px 12px; font-size: 14px; font-family: inherit; color: #2b2018; resize: vertical;
}
.mks-survey-text:focus { outline: none; border-color: #e8590c; }
.mks-survey-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 22px 20px;
}
.mks-survey-skip {
	border: 0; background: none; color: #8a7b70; cursor: pointer; font-size: 13.5px; padding: 6px 4px;
}
.mks-survey-skip:hover { color: #5f5048; text-decoration: underline; }
.mks-survey-send {
	border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 14.5px;
	padding: 11px 22px; border-radius: 10px;
	background: linear-gradient( 135deg, #f59f00, #e8590c 60%, #d9480f );
	box-shadow: 0 4px 14px rgba( 192, 57, 11, .35 );
	transition: transform .1s, box-shadow .15s, opacity .15s;
}
.mks-survey-send:hover { transform: translateY( -1px ); box-shadow: 0 6px 18px rgba( 192, 57, 11, .45 ); }
.mks-survey-send.is-loading { opacity: .65; cursor: default; }
.mks-survey-done { padding: 34px 26px 38px; text-align: center; }
.mks-survey-done h3 { margin: 8px 0 0; font-size: 18px; font-weight: 800; color: #c0390b; }
@media ( max-width: 520px ) {
	.mks-survey-diff-btn { font-size: 12px; }
	.mks-survey-head h3 { font-size: 18px; }
}
@media ( prefers-reduced-motion: reduce ) {
	.mks-survey-overlay, .mks-survey { transition: none; }
}

/* --- Wiele plikow (detali) na jedna pozycje/material --- */
.mks-positions .mks-pos { display: block; padding: 14px; }
.mks-pos-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.mks-pos-head .mks-pos-typ { flex: 0 0 180px; }
.mks-pos-head .mks-pos-profil { flex: 1 1 220px; }
.mks-pos-head .mks-pos-remove { flex: 0 0 36px; margin-left: auto; align-self: end; }
.mks-detale { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.mks-detal-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: end;
	padding: 10px 12px;
	border: 1px solid var(--mks-line2);
	border-radius: 8px;
	background: #fff;
}
.mks-detal-row .mks-pos-dxf { flex: 2 1 200px; }
.mks-detal-row .mks-pos-ilosc { flex: 0 0 110px; }
.mks-detal-remove {
	height: 40px;
	width: 36px;
	border: 1px solid #f3c2c2;
	background: #fdeaea;
	color: var(--mks-red);
	border-radius: 8px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	align-self: end;
}
.mks-detal-remove:hover { background: #f9d5d5; }
.mks-add-file {
	display: inline-block;
	margin-top: 10px;
	background: #fff;
	border: 1.5px dashed #f3c79f;
	color: var(--mks-brand-dark);
	padding: 7px 14px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
	font-size: 13px;
}
.mks-add-file:hover { background: #fff4ec; }
@media ( max-width: 560px ) {
	.mks-detal-row .mks-pos-dxf,
	.mks-detal-row .mks-pos-ilosc { flex: 1 1 100%; }
	.mks-pos-head .mks-pos-typ,
	.mks-pos-head .mks-pos-profil { flex: 1 1 100%; }
}
