/* Portal Lojalnościowy – wygląd portalu kontrahenta.
   Kolor główny ustawiasz w Program lojalnościowy → Ustawienia (zmienna --plp-accent). */

:root {
	--plp-accent: #1d4ed8;
	--plp-ink: #111827;
	--plp-muted: #6b7280;
	--plp-line: #e5e7eb;
	--plp-bg: #f3f4f6;
	--plp-card: #ffffff;
	--plp-plus: #15803d;
	--plp-minus: #b91c1c;
	--plp-radius: 14px;
}

body.plp-body {
	margin: 0;
	background: var(--plp-bg);
	color: var(--plp-ink);
	font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.plp-app {
	max-width: 560px;
	margin: 0 auto;
	padding: 0 16px calc(24px + env(safe-area-inset-bottom));
	color: var(--plp-ink);
	box-sizing: border-box;
}
.plp-app *, .plp-app *::before, .plp-app *::after { box-sizing: border-box; }
.plp-app h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.plp-app h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.plp-app p { margin: 0 0 10px; }
.plp-app a { color: var(--plp-accent); }

/* Górny pasek */
.plp-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(14px + env(safe-area-inset-top)) 0 14px;
}
.plp-brand { font-weight: 700; font-size: 17px; color: var(--plp-ink) !important; text-decoration: none; }
.plp-brand img { display: block; max-height: 36px; max-width: 180px; width: auto; }
.plp-logout { font-size: 14px; color: var(--plp-muted) !important; text-decoration: none; }

/* Karty */
.plp-card {
	background: var(--plp-card);
	border: 1px solid var(--plp-line);
	border-radius: var(--plp-radius);
	padding: 18px;
	margin-bottom: 12px;
}
.plp-muted { color: var(--plp-muted); }
.plp-small { font-size: 13px; }
.plp-empty { color: var(--plp-muted); text-align: center; padding: 16px 0; margin: 0; }

/* Saldo i postęp */
.plp-balance { padding: 20px 18px; }
.plp-company { font-size: 13px; color: var(--plp-muted); margin: 0 0 10px !important; }
.plp-label { font-size: 14px; color: var(--plp-muted); margin: 0 !important; }
.plp-points { font-size: 40px; font-weight: 700; line-height: 1.15; margin: 0 0 14px !important; letter-spacing: -0.02em; }
.plp-points span { font-size: 18px; font-weight: 600; color: var(--plp-muted); }
.plp-goal { background: var(--plp-bg); border-radius: 10px; padding: 12px 14px; }
.plp-goal p { margin: 0; }
.plp-goal-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.plp-goal-pct { font-weight: 600; }
.plp-goal-missing { font-size: 13px; color: var(--plp-muted); margin-top: 6px !important; }
.plp-goal-done { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }

.plp-bar { height: 8px; background: var(--plp-line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.plp-bar span { display: block; height: 100%; background: var(--plp-accent); border-radius: 99px; }

/* Zakładki */
.plp-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.plp-tabs a {
	flex: 1;
	text-align: center;
	padding: 10px 0;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	color: var(--plp-muted);
	background: var(--plp-card);
	border: 1px solid var(--plp-line);
}
.plp-tabs a.is-active { color: #fff; background: var(--plp-accent); border-color: var(--plp-accent); }

/* Listy */
.plp-list { padding-top: 6px; padding-bottom: 6px; }
.plp-rows, .plp-rewards { list-style: none; margin: 0; padding: 0; }
.plp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--plp-line); }
.plp-row:last-child { border-bottom: 0; }
.plp-row-main { display: flex; flex-direction: column; min-width: 0; }
.plp-row-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.plp-row-meta { font-size: 13px; color: var(--plp-muted); }
.plp-amount { font-weight: 700; font-size: 16px; white-space: nowrap; }
.plp-amount.is-plus { color: var(--plp-plus); }
.plp-amount.is-minus { color: var(--plp-minus); }
.plp-more { display: block; text-align: center; padding: 12px 0 8px; font-size: 14px; font-weight: 500; text-decoration: none; }

/* Odznaki statusu */
.plp-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; line-height: 1.6; white-space: nowrap; }
.plp-badge-nowe { background: #fef3c7; color: #92400e; }
.plp-badge-zrealizowane { background: #dcfce7; color: #166534; }
.plp-badge-anulowane { background: #f3f4f6; color: #4b5563; }
.plp-badge-goal { background: color-mix(in srgb, var(--plp-accent) 14%, #fff); color: var(--plp-accent); }

/* Nagrody */
.plp-reward { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--plp-line); }
.plp-reward:last-child { border-bottom: 0; }
.plp-reward-img {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 10px;
	background: var(--plp-bg);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--plp-muted);
}
.plp-reward-img img { width: 100%; height: 100%; object-fit: cover; }
.plp-reward-img svg { width: 30px; height: 30px; }
.plp-reward-body { flex: 1; min-width: 0; }
.plp-reward-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.plp-reward-name { font-weight: 600; font-size: 15px; }
.plp-reward-desc { font-size: 13px; color: var(--plp-muted); margin: 2px 0 0 !important; }
.plp-reward-cost { font-size: 14px; font-weight: 600; margin: 4px 0 0 !important; }
.plp-reward-action { margin-top: 10px; }
.plp-reward-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.plp-reward-foot form { margin: 0; }

/* Przyciski */
.plp-btn {
	display: inline-block;
	appearance: none;
	border: 0;
	border-radius: 10px;
	background: var(--plp-accent);
	color: #fff !important;
	font: inherit;
	font-weight: 600;
	font-size: 15px;
	padding: 10px 18px;
	text-decoration: none;
	cursor: pointer;
}
.plp-btn:disabled { opacity: .5; cursor: not-allowed; }
.plp-btn-secondary { background: var(--plp-bg); color: var(--plp-ink) !important; border: 1px solid var(--plp-line); }
.plp-link-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--plp-accent); cursor: pointer; }
.plp-link-btn:disabled { color: var(--plp-muted); cursor: not-allowed; }
.plp-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.plp-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Konto */
.plp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 10px; font-size: 15px; }
.plp-dl dt { color: var(--plp-muted); }
.plp-dl dd { margin: 0; overflow-wrap: anywhere; }

/* Komunikaty */
.plp-notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.plp-notice-success { background: #dcfce7; color: #14532d; }
.plp-notice-error { background: #fee2e2; color: #7f1d1d; }
.plp-preview { background: #fef3c7; color: #78350f; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }

/* Logowanie */
.plp-login { padding: 24px 20px; margin-top: 12vh; }
.plp-login form p { margin: 0 0 14px; }
.plp-login label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.plp-login input[type="text"], .plp-login input[type="password"], .plp-login input[type="email"], .plp-picker select {
	width: 100%;
	font: inherit;
	padding: 11px 12px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	background: #fff;
}
.plp-login input:focus, .plp-picker select:focus { outline: 2px solid var(--plp-accent); outline-offset: 1px; border-color: var(--plp-accent); }
.plp-login .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.plp-login .login-submit input[type="submit"] {
	width: 100%;
	appearance: none;
	border: 0;
	border-radius: 10px;
	background: var(--plp-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 12px;
	cursor: pointer;
}
.plp-login-links { font-size: 14px; }
.plp-picker { display: flex; gap: 8px; margin: 12px 0; }
.plp-picker select { flex: 1; }

.plp-footer { text-align: center; font-size: 13px; padding: 8px 0; }
.plp-footer a { color: var(--plp-muted); }
