/*
 * Vzhled podle skautského vizuálního stylu (Junák – český skaut).
 * Písma: SKAUT Bold (nadpisy, jen verzálky) a TheMix (texty).
 * Pokud soubory písem nejsou ve složce fonts/, použije se Nunito Sans.
 */
@font-face {
	font-family: "SKAUT Bold";
	src: local("SKAUT Bold"), local("SKAUT-Bold"), url("fonts/skaut-bold.woff2") format("woff2");
	font-display: swap;
}
@font-face {
	font-family: "TheMix";
	src: local("TheMix C5 SemiLight"), local("TheMixC5-SemiLight"), url("fonts/themix-semilight.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "TheMix";
	src: local("TheMix C5 Bold"), local("TheMixC5-Bold"), url("fonts/themix-bold.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	/* Paleta */
	--forest: #536B4C;      /* primární */
	--forest-dark: #435A3D; /* hover primární */
	--dark: #344A36;        /* nadpisy a texty */
	--sage: #D8DFC9;        /* sekundární plochy */
	--beige: #F1EBDD;       /* pozadí */
	--cream: #FAF8F1;       /* světlé plochy */
	--terracotta: #C77B57;  /* akcenty */
	--blue: #D5E3E2;        /* informační prvky */
	--yellow: #F5E4C5;      /* zvýraznění */

	--text: var(--dark);
	--muted: #5E6E5A;
	--border: #DDD6C4;
	--danger: #A4442F;
	--danger-soft: #F6E1D8;

	--font-head: "SKAUT Bold", "Nunito Sans", system-ui, sans-serif;
	--font-body: "TheMix", "Nunito Sans", system-ui, sans-serif;

	--radius: 24px;
	--radius-md: 18px;
	--radius-sm: 14px;
	--shadow: 0 1px 2px rgba(52, 74, 54, .05), 0 6px 20px rgba(52, 74, 54, .05);
	--focus: 0 0 0 4px rgba(83, 107, 76, .25);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--beige);
	padding-bottom: 120px;
	overflow-x: hidden;
}

[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; position: relative; }

h1, h2, h3 { margin: 0; line-height: 1.15; color: var(--dark); }
h1, h2 {
	font-family: var(--font-head);
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: .01em;
}
.muted { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.accent { color: var(--terracotta); }

/* ---------- Hlavička s organickými tvary ---------- */
.hero { position: relative; padding: 40px 0 36px; isolation: isolate; overflow: hidden; overflow: clip; }
.hero::before, .hero::after {
	content: ""; position: absolute; z-index: -1; pointer-events: none;
}
.hero::before {
	width: 420px; height: 340px; right: -120px; top: -90px;
	background: var(--sage);
	border-radius: 58% 42% 63% 37% / 45% 55% 45% 55%;
	opacity: .75;
}
.hero::after {
	width: 180px; height: 150px; right: 22%; top: 170px;
	background: var(--yellow);
	border-radius: 42% 58% 38% 62% / 55% 40% 60% 45%;
	opacity: .9;
}
.brand {
	display: inline-flex; align-items: center; gap: 12px;
	color: var(--dark); text-decoration: none; font-weight: 700; font-size: 15px;
	margin-bottom: 36px;
}
.brand img { border-radius: 14px; object-fit: cover; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); }
.lead { color: var(--muted); font-size: 18px; max-width: 540px; margin: 14px 0 0; }

/* ---------- Panely ---------- */
.panel {
	background: var(--cream);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px 28px;
	margin-bottom: 22px;
}
.panel__head { display: flex; gap: 16px; align-items: center; margin-bottom: 26px; }
.panel__head h2 { font-size: 22px; }
.step {
	flex: none; width: 44px; height: 42px;
	display: grid; place-items: center;
	background: var(--sage); color: var(--dark);
	font-family: var(--font-head); font-weight: 900; font-size: 18px;
	border-radius: 55% 45% 52% 48% / 48% 55% 45% 52%;
}
section:nth-of-type(2) .step { background: var(--blue); border-radius: 46% 54% 42% 58% / 56% 44% 56% 44%; }
section:nth-of-type(3) .step { background: var(--yellow); border-radius: 60% 40% 55% 45% / 45% 58% 42% 55%; }

.grid2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) {
	.grid2 { grid-template-columns: 1fr 1fr; }
	.grid2:has(> .m-date-wrap[hidden]) { grid-template-columns: 1fr; }
}

/* ---------- Formulářová pole ---------- */
.field { margin-bottom: 18px; position: relative; min-width: 0; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field input, .select select {
	width: 100%;
	height: 52px;
	padding: 0 18px;
	font: inherit;
	color: var(--text);
	background: #fff;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color .15s, box-shadow .15s;
	appearance: none;
}
.field input::placeholder { color: #9A9F8E; }
.field input:hover, .select select:hover { border-color: #C6CDB4; }
.field input:focus, .select select:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.field.is-invalid input, .field.is-invalid select { border-color: var(--danger); }
.field__hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field__error { display: none; font-size: 13px; color: var(--danger); margin: 6px 0 0; font-weight: 700; }
.field.is-invalid .field__error { display: block; }

.select { position: relative; }
.select::after {
	content: ""; position: absolute; right: 20px; top: 50%;
	width: 8px; height: 8px; margin-top: -6px;
	border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
	border-radius: 0 0 2px 0;
	transform: rotate(45deg); pointer-events: none;
}
.select select { padding-right: 46px; cursor: pointer; }
.select select:invalid { color: #9A9F8E; }

/* ---------- Našeptávač ---------- */
.combo__list {
	position: absolute; z-index: 20; left: 0; right: 0; top: 82px;
	margin: 0; padding: 6px; list-style: none;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: 0 14px 34px rgba(52, 74, 54, .14);
	max-height: 300px; overflow-y: auto;
}
.combo__list li {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.combo__list li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.combo__list li[aria-selected="true"], .combo__list li:hover { background: var(--sage); }
.combo__list .combo__empty { color: var(--muted); cursor: default; font-size: 14px; }
.combo__list .combo__empty:hover { background: none; }
.m-status.is-ok { color: var(--forest); font-weight: 700; }

/* ---------- Karta člena ---------- */
.members { display: grid; gap: 16px; }
.member {
	background: #fff;
	border: 1.5px solid transparent;
	border-radius: var(--radius-md);
	padding: 22px 22px 20px;
	box-shadow: 0 1px 2px rgba(52, 74, 54, .04);
	transition: border-color .2s;
	animation: rise .25s ease-out;
}
.member:focus-within { border-color: var(--sage); }
.member.has-error { border-color: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.member__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.member__title { font-size: 17px; font-weight: 700; }
.badge {
	font-size: 13px; font-weight: 700;
	padding: 4px 12px; border-radius: 999px;
	background: var(--sage); color: var(--dark);
	white-space: nowrap;
}
.badge.is-award { background: var(--yellow); color: #7A4A2E; }
.member__remove { margin-left: auto; }

.icon-btn {
	width: 38px; height: 38px; border-radius: 50%; border: 0;
	background: transparent; color: var(--muted); cursor: pointer;
	display: grid; place-items: center;
	transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }

/* Přepínač */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
	position: relative; width: 44px; height: 26px; flex: none;
	background: #D3D2C3; border-radius: 999px; transition: background .2s;
}
.switch__track::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 20px; height: 20px; border-radius: 50%;
	background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
	transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--forest); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }

/* ---------- Tlačítka ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	height: 54px; padding: 0 28px;
	font: inherit; font-weight: 700; font-size: 16px;
	border: 0; border-radius: 999px; cursor: pointer;
	transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn--primary { background: var(--forest); color: #fff; }
.btn--primary:hover { background: var(--forest-dark); }
.btn--ghost { background: transparent; color: var(--muted); margin-top: 8px; }
.btn--ghost:hover { background: var(--sage); color: var(--dark); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }

.spinner {
	display: none; width: 18px; height: 18px; border-radius: 50%;
	border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
	animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-add {
	width: 100%; margin-top: 16px; height: 58px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	font: inherit; font-weight: 700; color: var(--forest);
	background: transparent; border: 2px dashed #BFC8AE; border-radius: var(--radius-md);
	cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-add:hover { background: var(--sage); border-color: var(--forest); }
.btn-add:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-add svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }

/* ---------- Nápověda ---------- */
.tip { background: var(--blue); border-radius: var(--radius-md); margin-bottom: 20px; }
.tip summary {
	cursor: pointer; padding: 15px 20px; font-weight: 700; font-size: 15px;
	list-style: none; display: flex; align-items: center; gap: 12px;
	border-radius: var(--radius-md);
}
.tip summary:focus-visible { outline: none; box-shadow: var(--focus); }
.tip summary::-webkit-details-marker { display: none; }
.tip summary::before {
	content: "?"; width: 26px; height: 24px; flex: none;
	display: grid; place-items: center;
	background: var(--dark); color: var(--cream); font-size: 14px; font-weight: 800;
	border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%;
}
.tip summary::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--dark); font-weight: 400; line-height: 1; }
.tip[open] summary::after { content: "–"; }
.tip__body { padding: 0 20px 18px; font-size: 15px; color: var(--dark); }
.tip__body ul { margin: 0 0 14px; padding-left: 20px; }
.tip__body li { margin-bottom: 4px; }
.pricelist { width: 100%; border-collapse: collapse; }
.pricelist td { padding: 9px 0; border-top: 1px solid rgba(52, 74, 54, .14); }
.pricelist td:last-child { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 12px; }

/* ---------- Chyby ---------- */
.alert {
	margin: 14px 0 0; padding: 12px 16px;
	background: var(--danger-soft); color: var(--danger);
	border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
}

/* ---------- Souhrn ---------- */
.summary { scroll-margin-top: 16px; }
.summary__list { list-style: none; margin: 0; padding: 0; }
.summary__list li {
	display: flex; align-items: center; gap: 14px;
	padding: 14px 0; border-bottom: 1px solid var(--border);
}
.avatar {
	flex: none; width: 44px; height: 42px;
	display: grid; place-items: center;
	background: var(--sage); color: var(--dark); font-weight: 800; font-size: 14px;
	border-radius: 55% 45% 52% 48% / 48% 55% 45% 52%;
}
.summary__list li:nth-child(3n+2) .avatar { background: var(--blue); border-radius: 46% 54% 42% 58% / 56% 44% 56% 44%; }
.summary__list li:nth-child(3n) .avatar { border-radius: 60% 40% 55% 45% / 45% 58% 42% 55%; }
.avatar.is-award { background: var(--yellow) !important; color: #7A4A2E; }
.summary__who { flex: 1; min-width: 0; }
.summary__who strong { display: block; overflow-wrap: anywhere; }
.summary__who small { color: var(--muted); font-size: 13px; }
.summary__price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary__total {
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
	margin: 22px 0 24px; padding: 20px 22px;
	background: var(--sage); border-radius: var(--radius-md);
}
.summary__total span { font-weight: 700; }
.summary__total strong { font-family: var(--font-head); font-size: 30px; font-weight: 900; color: var(--dark); font-variant-numeric: tabular-nums; }

/* ---------- Spodní lišta ---------- */
.bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
	background: rgba(250, 248, 241, .92);
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-top: 1px solid var(--border);
	padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar__total { min-width: 0; }
.bar__total small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__total strong { display: block; white-space: nowrap; }
.bar .btn { flex: none; white-space: nowrap; }
.bar .btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lbl-short { display: none; }

/* Mobil: cena nahoře, tlačítko přes celou šířku pod ní */
@media (max-width: 560px) {
	body { padding-bottom: 170px; }
	.bar { padding-top: 10px; }
	.bar__inner { flex-direction: column; align-items: stretch; gap: 10px; }
	.bar__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
	.bar__total small { font-size: 14px; }
	.bar__total strong { font-size: 22px; }
	.bar .btn { width: 100%; height: 52px; padding: 0 20px; }
}
.bar__total strong { font-family: var(--font-head); font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------- Patička ---------- */
.footer {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
	padding-top: 24px; padding-bottom: 24px; font-size: 14px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--dark); text-decoration: underline; }

/* ---------- Dialog ---------- */
.modal {
	border: 0; border-radius: var(--radius); padding: 34px 28px 24px;
	width: min(440px, calc(100% - 32px));
	background: var(--cream);
	box-shadow: 0 24px 64px rgba(52, 74, 54, .25);
	text-align: center; color: var(--text);
}
.modal::backdrop { background: rgba(52, 74, 54, .4); backdrop-filter: blur(3px); }
.modal h3 { font-family: var(--font-head); font-weight: 900; text-transform: uppercase; font-size: 22px; margin-bottom: 8px; }
.modal p { color: var(--muted); margin: 0 0 24px; overflow-wrap: anywhere; }
.modal__icon {
	width: 64px; height: 60px; margin: 0 auto 16px;
	display: grid; place-items: center; font-size: 26px; font-weight: 800;
	background: var(--sage); color: var(--forest);
	border-radius: 55% 45% 52% 48% / 48% 55% 45% 52%;
}
.modal__icon.is-error { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 520px) {
	.panel { padding: 24px 18px; }
	.member { padding: 18px 16px; }
	.hero { padding-top: 28px; }
	.hero::before { width: 260px; height: 220px; right: -110px; top: -70px; }
	.hero::after { width: 110px; height: 90px; right: 6%; top: 120px; }
	.brand { margin-bottom: 26px; }
	.lead { font-size: 16px; }
	.bar .btn { padding: 0 20px; font-size: 15px; }
	.summary__total strong { font-size: 24px; }
}

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