/* =========================================================
   DOMOWY OPIEKUN — design system aplikacji
   Wszystko jest scope'owane pod .do-app, żeby motyw i Elementor
   nie wpływały na aplikację i odwrotnie.
   ========================================================= */

.do-app {
	--do-bg: #f5f7f7;
	--do-surface: #ffffff;
	--do-surface-alt: #fbfcfc;
	--do-text: #15211f;
	--do-muted: #6c7a78;
	--do-border: #e2e7e6;
	--do-accent: #1f9a86;
	--do-accent-soft: #e8f5f2;
	--do-success: #2f8f5b;
	--do-warning: #b57314;
	--do-danger: #c0392b;
	--do-radius: 10px;
	--do-radius-sm: 7px;
	--do-shadow: 0 1px 2px rgba(21, 33, 31, .05), 0 6px 18px rgba(21, 33, 31, .04);
	--do-space: 16px;

	box-sizing: border-box;
	max-width: 880px;
	margin: 0 auto;
	padding: 0 var(--do-space) 64px;
	background: var(--do-bg);
	color: var(--do-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.do-app *,
.do-app *::before,
.do-app *::after { box-sizing: inherit; }

.do-app p { margin: 0 0 12px; }
.do-app h1, .do-app h2, .do-app h3, .do-app h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.do-app a { color: var(--do-accent); text-decoration: none; }
.do-app a:hover { text-decoration: underline; }
.do-app :focus-visible { outline: 2px solid var(--do-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------- HEADER */

.do-header {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 calc(var(--do-space) * -1);
	padding: 14px var(--do-space);
	background: var(--do-surface);
	border-bottom: 1px solid var(--do-border);
}

.do-logo { display: flex; align-items: center; justify-content: center; min-width: 0; }
.do-logo img { display: block; height: 90px; width: auto; max-width: 280px; object-fit: contain; }

.do-header__meta { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.do-header__user { color: var(--do-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.do-header__logout { color: var(--do-muted); }
.do-header__logout:hover { color: var(--do-text); }

.do-pagehead { padding: 22px 0 6px; }
.do-pagehead__title { font-size: 25px; }
.do-pagehead__sub { margin: 4px 0 0; color: var(--do-muted); font-size: 15px; }

/* ---------------------------------------------------- STATYSTYKI */

.do-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin: 16px 0 8px;
}

.do-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	background: var(--do-surface);
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius);
}

.do-stat__num { font-size: 26px; font-weight: 600; line-height: 1.1; }
.do-stat__label { font-size: 13px; color: var(--do-muted); }

/* ---------------------------------------------------- SEKCJE */

.do-section { margin-top: 28px; }
.do-section__title { margin-bottom: 10px; font-size: 17px; }

.do-card {
	padding: 16px;
	margin-bottom: 12px;
	background: var(--do-surface);
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius);
	box-shadow: var(--do-shadow);
}

.do-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.do-card__title { font-size: 17px; }
.do-card__meta { margin: 6px 0 0; color: var(--do-muted); font-size: 14px; }
.do-card__note { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--do-border); font-size: 14px; }
.do-card--hero { padding: 20px; }

/* ---------------------------------------------------- TAGI I STATUSY */

.do-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--do-surface-alt);
	border: 1px solid var(--do-border);
	color: var(--do-muted);
	font-size: 12px;
	white-space: nowrap;
}

.do-tag--plan { background: var(--do-accent-soft); border-color: transparent; color: #14675a; font-weight: 600; }
.do-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.do-card__actions form { margin: 0; }
.do-tag--demo { background: #fdf6e6; border-color: #f0e2c0; color: #8a6415; }
.do-tag--individual { background: var(--do-accent-soft); border-color: transparent; color: #14675a; }

.do-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	text-transform: lowercase;
	background: var(--do-surface-alt);
	color: var(--do-muted);
}

.do-status--zakonczona { background: #e9f5ee; color: var(--do-success); }
.do-status--wymaga_uwagi { background: #fbf2e3; color: var(--do-warning); }
.do-status--wymaga_kontaktu { background: #fbebe9; color: var(--do-danger); }
.do-status--w_toku { background: var(--do-accent-soft); color: #14675a; }

/* ---------------------------------------------------- LISTY */

.do-details { margin-top: 12px; border-top: 1px solid var(--do-border); padding-top: 10px; }
.do-details__summary { cursor: pointer; color: var(--do-accent); font-size: 14px; list-style: none; }
.do-details__summary::-webkit-details-marker { display: none; }
.do-details__summary::before { content: "+ "; }
.do-details[open] .do-details__summary::before { content: "– "; }
.do-details__module { margin: 14px 0 6px; font-size: 13px; text-transform: none; color: var(--do-muted); }
.do-details__text { margin: 8px 0 0; font-size: 14px; }
.do-details--internal .do-details__summary { color: var(--do-muted); }

.do-checklist-preview { margin: 0; padding: 0; list-style: none; }
.do-checklist-preview li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px solid var(--do-border);
	font-size: 14px;
}
.do-checklist-preview li:last-child { border-bottom: 0; }
.do-checklist-preview__code { min-width: 66px; color: var(--do-muted); font-size: 12px; }

.do-facts { margin: 16px 0 0; }
.do-facts__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--do-border);
}
.do-facts__row:last-child { border-bottom: 0; }
.do-facts dt { color: var(--do-muted); font-size: 14px; }
.do-facts dd { margin: 0; text-align: right; font-weight: 600; font-size: 14px; }

.do-history { margin: 0; padding: 0; list-style: none; }
.do-history__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 12px;
	padding: 14px 16px;
	margin-bottom: 8px;
	background: var(--do-surface);
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius-sm);
}
.do-history__item .do-btn { flex-shrink: 0; }
.do-history__date { font-weight: 600; margin-right: 8px; }
.do-history__counts { margin-top: 4px; color: var(--do-muted); font-size: 13px; }

/* ---------------------------------------------------- PUSTE STANY */

.do-empty {
	padding: 22px 18px;
	background: var(--do-surface);
	border: 1px dashed var(--do-border);
	border-radius: var(--do-radius);
	color: var(--do-muted);
}
.do-empty p { margin: 0; }
.do-empty__hint { margin-top: 8px !important; font-size: 14px; }

/* ---------------------------------------------------- PRZYCISKI */

.do-btn { display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px;
	padding: 0 20px;
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius-sm);
	background: var(--do-surface);
	color: var(--do-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
/* Specyficzność ".do-app a" (klasa + element) jest wyższa niż samo ".do-btn"
   (jedna klasa), więc bez tego przedrostka globalny kolor linków cicho
   nadpisywał kolor tekstu przycisku — w wariancie --primary tekst stawał
   się niemal niewidoczny na tle, bo oba kolory pochodzą z tego samego akcentu. */
.do-app .do-btn:hover { background: var(--do-surface-alt); text-decoration: none; color: var(--do-text); }
.do-app .do-btn--primary,
.do-app .do-btn--primary:link,
.do-app .do-btn--primary:visited { background: var(--do-accent); border-color: var(--do-accent); color: #fff; }
.do-app .do-btn--primary:hover { background: #1a8674; border-color: #1a8674; color: #fff; }
.do-btn--block { width: 100%; }

/* ---------------------------------------------------- LOGOWANIE */

.do-app--login { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding-top: 40px; }

.do-login {
	width: 100%;
	max-width: 380px;
	padding: 28px 24px 24px;
	background: var(--do-surface);
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius);
	box-shadow: var(--do-shadow);
	text-align: center;
}

.do-login__logo { height: 44px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: 18px; }
.do-login__title { margin-bottom: 18px; font-size: 20px; }
.do-login__error {
	padding: 10px 12px;
	margin-bottom: 14px;
	background: #fbebe9;
	border-radius: var(--do-radius-sm);
	color: var(--do-danger);
	font-size: 14px;
}
.do-login__form { text-align: left; }
.do-login__help { margin: 14px 0 0; font-size: 14px; }

.do-field { display: block; margin-bottom: 14px; }
.do-field__label { display: block; margin-bottom: 5px; font-size: 14px; color: var(--do-muted); }
.do-field__input {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius-sm);
	background: var(--do-surface);
	color: var(--do-text);
	font: inherit;
	font-size: 16px; /* 16px zapobiega przybliżaniu widoku na iOS */
}
.do-field__input:focus { border-color: var(--do-accent); outline: none; box-shadow: 0 0 0 3px var(--do-accent-soft); }

/* ---------------------------------------------------- STOPKA */

.do-footer {
	margin-top: 36px;
	padding-top: 18px;
	border-top: 1px solid var(--do-border);
	color: var(--do-muted);
	font-size: 13px;
	text-align: center;
}

/* ---------------------------------------------------- TABLET */

@media (min-width: 600px) {
	.do-app { padding: 0 24px 72px; }
	.do-header { margin: 0 -24px; padding: 16px 24px; }
	.do-logo img { height: 108px; max-width: 340px; }
	.do-progress { top: 140px; }
	.do-stats { grid-template-columns: repeat(4, 1fr); }
	.do-pagehead__title { font-size: 29px; }
	.do-card { padding: 20px; }
}

/* ---------------------------------------------------- DESKTOP */

@media (min-width: 1024px) {
	.do-app { max-width: 980px; }
	.do-section { margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
	.do-app * { transition: none !important; }
}

/* =========================================================
   WYKONYWANIE WIZYTY — ekran telefonu (Etap 3)
   ========================================================= */

.do-app--visit { padding-bottom: 96px; }

.do-visit-info { padding: 14px 0 4px; }
.do-visit-info__property { font-size: 20px; }
.do-visit-info__meta { margin: 2px 0 0; color: var(--do-muted); font-size: 14px; }

.do-progress {
	position: sticky;
	top: 118px;
	z-index: 9;
	background: var(--do-bg);
	margin: 0 calc(var(--do-space) * -1);
	padding: 10px var(--do-space);
	border-bottom: 1px solid var(--do-border);
}
.do-progress__bar { height: 6px; border-radius: 999px; background: var(--do-border); overflow: hidden; }
.do-progress__fill { height: 100%; background: var(--do-accent); transition: width .25s ease; }
.do-progress__label { margin-top: 6px; font-size: 13px; color: var(--do-muted); text-align: right; }

.do-module { display: none; padding-top: 16px; }
.do-module.is-active { display: block; }
.do-module__title { display: flex; align-items: baseline; justify-content: space-between; font-size: 16px; color: var(--do-muted); margin-bottom: 6px; }
.do-module__count { font-weight: 400; font-size: 13px; }
.do-module__prev { display: inline-block; margin-bottom: 10px; padding: 0; border: 0; background: none; color: var(--do-accent); font: inherit; font-size: 14px; cursor: pointer; }

.do-point { padding: 16px 0; border-bottom: 1px solid var(--do-border); }
.do-point:last-child { border-bottom: none; }
.do-point__name { font-size: 17px; }
.do-point__desc { margin: 4px 0 12px; color: var(--do-muted); font-size: 14px; }
.do-point.is-touched .do-point__name::before { content: "✓ "; color: var(--do-success); }

.do-point__buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.do-point__btn {
	min-height: 52px;
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius-sm);
	background: var(--do-surface);
	color: var(--do-text);
	font: inherit;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}
.do-point__btn--ok.is-active { background: var(--do-success); border-color: var(--do-success); color: #fff; }
.do-point__btn--attention.is-active { background: var(--do-warning); border-color: var(--do-warning); color: #fff; }
.do-point__btn--problem.is-active { background: var(--do-danger); border-color: var(--do-danger); color: #fff; }

.do-point__na {
	display: block;
	margin: 10px auto 0;
	padding: 6px 4px;
	border: 0;
	background: none;
	color: var(--do-muted);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}
.do-point__na.is-active { color: var(--do-text); font-weight: 600; text-decoration: none; }

.do-point__extra { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--do-border); }
.do-point__comment-field { margin-bottom: 12px; }

.do-point__photo { margin-bottom: 12px; }
.do-point__photo-btn { display: inline-flex; min-height: 44px; padding: 0 16px; cursor: pointer; }
.do-btn--ghost { background: var(--do-surface-alt); }
.do-point__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.do-point__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--do-radius-sm); border: 1px solid var(--do-border); }

.do-point__yesno { margin-bottom: 12px; }
.do-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; max-width: 320px; }
.do-toggle button {
	min-height: 44px;
	border: 1px solid var(--do-border);
	border-radius: var(--do-radius-sm);
	background: var(--do-surface);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.do-toggle button.is-active { background: var(--do-accent); border-color: var(--do-accent); color: #fff; }

.do-visit-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px var(--do-space);
	background: var(--do-surface);
	border-top: 1px solid var(--do-border);
	box-shadow: 0 -4px 14px rgba(21,33,31,.06);
}
.do-visit-bar__status { font-size: 12px; color: var(--do-muted); white-space: nowrap; }
.do-visit-bar__status.is-saving { color: var(--do-accent); }
.do-visit-bar__status.is-offline { color: var(--do-danger); font-weight: 600; }
.do-visit-bar #do-visit-next { flex: 0 0 auto; min-width: 170px; }

.do-summary__counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.do-summary__count { padding: 12px 8px; text-align: center; background: var(--do-surface); border: 1px solid var(--do-border); border-radius: var(--do-radius-sm); }
.do-summary__count span { display: block; font-size: 20px; font-weight: 700; }
.do-summary__count small { color: var(--do-muted); font-size: 12px; }
.do-summary__count--attention span { color: var(--do-warning); }
.do-summary__count--problem span { color: var(--do-danger); }
.do-summary__photos { color: var(--do-muted); font-size: 14px; }
.do-summary__group-title { margin: 16px 0 6px; font-size: 14px; }
.do-summary__list { margin: 0 0 0 18px; padding: 0; font-size: 14px; }
.do-summary__list li { margin-bottom: 8px; }
.do-summary__detail { margin-top: 2px; color: var(--do-muted); font-size: 13px; }
.do-summary__checked { margin: 4px 0 0; font-size: 14px; }
.do-summary__unchecked { margin: 2px 0 0; color: var(--do-warning); font-size: 13px; }
.do-summary__error { margin-top: 14px; padding: 10px 12px; background: #fbebe9; border-radius: var(--do-radius-sm); color: var(--do-danger); font-size: 14px; }

.do-done { text-align: center; padding-top: 40px; }
.do-done .do-btn { margin-top: 20px; }
.do-done .do-empty { text-align: left; }
.do-done__summary { margin: 4px 0 18px; font-size: 18px; font-weight: 600; }
.do-done__section-title { margin: 28px 0 8px; font-size: 15px; color: var(--do-muted); }
.do-report-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.do-report-actions__email { margin: 4px 0 0; font-size: 14px; color: var(--do-muted); }
.do-report-actions__noemail { margin: 4px 0 0; padding: 10px 12px; background: #fbf2e3; border-radius: var(--do-radius-sm); color: var(--do-warning); font-size: 14px; }
.do-report-actions__result { margin: 2px 0 0; font-size: 14px; }
.do-done .do-report-actions { text-align: left; }

@media (min-width: 600px) {
	.do-point__buttons { max-width: 420px; }
}
