/* EtiudoMaker – wygląd części publicznej (2026). Paleta PBS: czerwień #E40615, granat #13294B. */

:root {
	--red: #E40615;
	--red-dark: #B8040F;
	--navy: #13294B;
	--navy-2: #1F3A66;
	--bg: #F3F5F8;
	--card: #FFFFFF;
	--text: #1E2A3A;
	--muted: #6B7686;
	--line: #DDE2EA;
	--ok: #1E8E4E;
	--warn: #B26A00;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(19, 41, 75, .06), 0 4px 16px rgba(19, 41, 75, .06);
	--font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--navy-2); }
a:hover { color: var(--red); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: .85em; margin: .4em 0 0; }
[hidden] { display: none !important; }

/* --- nagłówek --- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 84px; }
.brand img { display: block; height: 58px; width: auto; }
.brand-text { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 18px; }
.brand-text strong { color: var(--navy); font-size: 1.25em; letter-spacing: .01em; }
.brand-text span { color: var(--muted); font-size: .85em; }
.topbar-link { margin-left: auto; color: var(--navy); text-decoration: none; font-weight: 600; font-size: .9em; }

.steps { background: var(--navy); background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%); color: #c9d3e3; }
.steps ol { list-style: none; display: flex; gap: 6px; margin: 0 auto; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: .88em; white-space: nowrap; padding-right: 22px; position: relative; }
.steps li:not(:last-child)::after { content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 1px; background: #5d7397; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #5d7397; display: inline-grid; place-items: center; font-size: .85em; }
.steps li.current { color: #fff; font-weight: 600; }
.steps li.current span { background: var(--red); border-color: var(--red); color: #fff; }
.steps li.done span { background: #fff; border-color: #fff; color: var(--navy); }

main.wrap { padding-top: 28px; padding-bottom: 40px; }

/* --- karty, komunikaty --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card-title { font-size: 1.05em; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.card-title .num { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-size: .85em; }
.notice { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; line-height: 1.55; }
.notice-error { background: #FDECEE; border-color: #F5B9BF; color: #8A0711; }
.notice-warn { background: #FFF6E5; border-color: #F2D49B; color: #6B4300; }
.notice-ok { background: #E8F6EE; border-color: #A9DCBE; color: #145C33; }
.field-error { color: var(--red-dark); font-weight: 600; }
.empty-state { text-align: center; padding: 48px 24px; }

/* --- przyciski --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; font: 600 .95em var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 6px 12px; font-size: .85em; }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(228, 6, 21, .35); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85em; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* --- formularze --- */
.fl { display: flex; flex-direction: column; gap: 4px; font-size: .85em; font-weight: 600; color: var(--navy); }
.fl small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=search], input[type=password], select {
	font: 15px var(--font); color: var(--text); background: #fff; border: 1px solid #C9D0DB; border-radius: 7px; padding: 9px 11px; width: 100%;
}
select { width: auto; padding-right: 28px; }
input[type=text]:focus, input[type=search]:focus, input[type=password]:focus, select:focus { border-color: var(--navy-2); outline: none; box-shadow: 0 0 0 3px rgba(31, 58, 102, .15); }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fields-grid .full { grid-column: 1 / -1; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.sku-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.upload { display: block; position: relative; border: 2px dashed #C9D0DB; border-radius: 8px; padding: 16px; text-align: center; color: var(--navy); font-weight: 600; cursor: pointer; }
.upload:hover { border-color: var(--navy-2); background: #F7F9FC; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload span { display: inline-flex; gap: 8px; align-items: center; }
.logo-current { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.logo-current img { max-height: 90px; max-width: 70%; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.remember { display: flex; align-items: center; gap: 10px; font-size: .9em; color: var(--muted); }
.back-link { color: var(--muted); text-decoration: none; font-size: .9em; }

.captcha { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 14px 0; }
.captcha img { border: 1px solid var(--line); border-radius: 8px; }
.captcha input { width: 140px; font-size: 22px; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 700; margin-bottom: 6px; display: block; }

/* --- krok 1: galeria --- */
.intro { display: flex; gap: 24px; align-items: center; padding: 26px 28px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='200'%3E%3Cg fill='none' stroke='%2313294B' stroke-opacity='.07'%3E%3Ccircle cx='360' cy='60' r='70'/%3E%3Ccircle cx='300' cy='150' r='50'/%3E%3Ccircle cx='400' cy='170' r='40'/%3E%3C/g%3E%3C/svg%3E") right center no-repeat; }
.intro h1 { margin: 0 0 8px; font-size: 1.6em; }
.intro p { margin: 0 0 6px; max-width: 760px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 30px 0 14px; }
.gallery-head h2 { margin: 0; font-size: 1.2em; display: flex; align-items: center; gap: 10px; }
.count { background: var(--navy); color: #fff; border-radius: 99px; padding: 1px 10px; font-size: .75em; }
.gallery-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { padding-left: 36px; width: 280px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.tpl-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tpl-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(19, 41, 75, .16); border-color: var(--navy-2); color: var(--text); }
.tpl-thumb { position: relative; display: block; aspect-ratio: 300 / 424; background: #EEF1F5; overflow: hidden; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-hover { position: absolute; inset: auto 0 0 0; background: rgba(19, 41, 75, .92); color: #fff; text-align: center; padding: 10px; font-weight: 600; transform: translateY(100%); transition: transform .15s; }
.tpl-card:hover .tpl-hover, .tpl-card:focus .tpl-hover { transform: none; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-size: .72em; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
.tpl-title { padding: 10px 12px 2px; font-weight: 600; font-size: .9em; line-height: 1.35; color: var(--navy); }
.tpl-meta { padding: 0 12px 12px; color: var(--muted); font-size: .78em; margin-top: auto; }
.empty-search { text-align: center; color: var(--muted); padding: 30px; }

/* --- kroki 2–4: dwie kolumny --- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 497px; gap: 28px; align-items: start; }
.em-preview { position: sticky; top: 16px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .85em; color: var(--muted); margin-bottom: 8px; }
.preview-head strong { color: var(--navy); }
.preview-head select { padding: 4px 26px 4px 8px; font-size: .9em; }

/* podgląd – pozycjonowanie jak w oryginale (odwzorowuje makePNG) */
.eMPreview { width: 497px; height: 702px; border: 1px solid var(--line); background: #fff; color: #000; overflow: hidden; line-height: 100%; font-family: Arial, sans-serif; box-shadow: var(--shadow); border-radius: 4px; }
.eMPreview > div > img:first-child { display: block; }
.eMPreview div div { position: absolute; }
.eMPreview table { border-collapse: collapse; }
.eMPreview td { padding: 0; }

.success { text-align: center; padding: 30px 24px; }
.success h1 { font-size: 1.4em; margin: 8px 0; }
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: #E8F6EE; color: var(--ok); display: inline-grid; place-items: center; }
.success-icon .ico { width: 30px; height: 30px; stroke-width: 2.5; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--navy); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--red); transform: translateY(-2px); color: var(--navy); }
.tile .ico { width: 28px; height: 28px; color: var(--red); margin-bottom: 6px; }
.tile span { color: var(--muted); font-size: .85em; }
.copy-row { display: flex; gap: 8px; margin-top: 4px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* --- etiudy wielostronicowe --- */
.preview-pages.multi { max-height: calc(100vh - 90px); overflow-y: auto; overflow-x: hidden; padding-right: 6px; scroll-behavior: smooth; }
.preview-pages .eMPreview + .preview-page-no, .preview-page + .preview-page { margin-top: 18px; }
.preview-page-no { font-size: .8em; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px; }
.page-label { font-size: .85em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.page-label:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.page-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }

/* --- stopka --- */
.footer { background: var(--navy); color: #b8c4d8; font-size: .8em; padding: 26px 0 18px; }
.footer p { margin: 0 0 10px; max-width: 980px; }
.footer a { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; margin-top: 14px !important; color: #8c9bb5; max-width: none !important; }
.footer-bottom strong { color: #fff; }

/* --- logowanie --- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--navy) linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; text-align: center; padding: 32px 30px; display: flex; flex-direction: column; gap: 14px; }
.login-card img { margin: 0 auto; height: 80px; width: auto; }
.login-card h1 { margin: 6px 0 0; font-size: 1.3em; }
.login-card p { margin: 0; }
.login-card .fl { text-align: left; }

/* --- urządzenia mobilne --- */
@media (max-width: 1080px) {
	.two-col { grid-template-columns: 1fr; }
	.preview-pages.multi { max-height: 75vh; }
	.em-preview { position: static; order: -1; overflow-x: auto; }
	.eMPreview { margin: 0 auto; }
}
@media (max-width: 640px) {
	.wrap { padding: 0 14px; }
	.topbar-inner { min-height: 66px; gap: 12px; }
	.brand img { height: 42px; }
	.brand-text { padding-left: 12px; }
	.brand-text span, .topbar-link { display: none; }
	.fields-grid { grid-template-columns: 1fr; }
	.search input { width: 100%; }
	.gallery-tools, .search { width: 100%; }
	.tpl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.tiles { grid-template-columns: 1fr; }
	.intro { padding: 20px; }
	.card { padding: 16px; }
	.actions .btn { flex: 1 1 auto; }
}
@media print { .topbar, .footer { display: none; } }

/* podgląd na wąskich ekranach – pomniejszenie zamiast przewijania */
@media (max-width: 560px) { .em-preview .eMPreview { zoom: .72; } }
@media (max-width: 380px) { .em-preview .eMPreview { zoom: .64; } }
