/* =========================================================
   LOGIN PAGE V2 — nowy layout strony logowania
   Wszystkie selektory pod #loginV2 — separacja od starego CSS
   i wyzsza specyficznosc niz legacy globalne reguly
   (np. input[type="text"] { width: 185px }).
   ========================================================= */
#loginV2 {
	/* Brand */
	--lv2-brand-primary: #b8191f;
	--lv2-brand-primary-700: #91000f;
	--lv2-brand-primary-50: #fdecee;

	/* Neutrals */
	--lv2-bg: #f6f7f9;
	--lv2-surface: #ffffff;
	--lv2-border: #e4e7ec;
	--lv2-border-strong: #cbd2db;
	--lv2-text: #101828;
	--lv2-text-muted: #475467;
	--lv2-text-subtle: #667085;

	/* Radii */
	--lv2-radius-input: 8px;
	--lv2-radius-button: 8px;
	--lv2-radius-card: 14px;

	/* Layout */
	--lv2-left-col: 40%;
	--lv2-right-col: 60%;
	--lv2-content-max: 1440px;

	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--lv2-text);
	background: var(--lv2-bg);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
#loginV2 *, #loginV2 *::before, #loginV2 *::after { box-sizing: border-box; }
#loginV2 button { font-family: inherit; cursor: pointer; }
#loginV2 img { max-width: 100%; }
#loginV2 :focus-visible {
	outline: 2px solid var(--lv2-brand-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

/* =========================================================
   TOP NAV
   ========================================================= */
#loginV2 .lv2-topnav {
	background: var(--lv2-surface);
	border-bottom: 1px solid var(--lv2-border);
}
#loginV2 .lv2-topnav__inner {
	max-width: var(--lv2-content-max);
	margin: 0 auto;
	padding: 0 24px;
	height: 56px;
	display: flex;
	align-items: center;
	gap: 24px;
}
#loginV2 .lv2-topnav__tabs { display: flex; gap: 24px; }
#loginV2 .lv2-topnav__tab {
	display: inline-flex;
	align-items: center;
	height: 56px;
	padding: 0 2px;
	text-decoration: none;
	color: var(--lv2-text-muted);
	font-size: 14px;
	font-weight: 500;
	border-bottom: 2px solid transparent;
}
#loginV2 .lv2-topnav__tab:hover { color: var(--lv2-text); text-decoration: none; }
#loginV2 .lv2-topnav__tab--active,
#loginV2 .lv2-topnav__tab--active:hover {
	color: var(--lv2-brand-primary);
	border-bottom-color: var(--lv2-brand-primary);
}
#loginV2 .lv2-topnav__spacer { flex: 1; }
#loginV2 .lv2-topnav__langs { display: flex; gap: 4px; }
#loginV2 .lv2-topnav__lang {
	display: inline-flex;
	align-items: center;
	color: var(--lv2-text-muted);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	padding: 6px 8px;
	border-radius: 6px;
}
#loginV2 .lv2-topnav__lang:hover { background: var(--lv2-bg); color: var(--lv2-text); text-decoration: none; }

/* =========================================================
   MAIN GRID: LEWY LOGIN / PRAWE BANERY
   ========================================================= */
#loginV2 .lv2-main {
	max-width: var(--lv2-content-max);
	margin: 0 auto;
	width: 100%;
	flex: 1;
	display: grid;
	grid-template-columns: var(--lv2-left-col) var(--lv2-right-col);
}

/* =========================================================
   LEWY PANEL LOGOWANIA
   ========================================================= */
#loginV2 .lv2-login-panel {
	padding: 56px clamp(32px, 5vw, 72px) 48px;
	background: var(--lv2-surface);
	border-right: 1px solid var(--lv2-border);
	display: flex;
	flex-direction: column;
}
#loginV2 .lv2-login-panel__brand { margin-bottom: 40px; }
#loginV2 .lv2-login-panel__logo { height: 44px; width: auto; display: block; }

#loginV2 .lv2-login-box__title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--lv2-text);
}
#loginV2 .lv2-login-box__subtitle {
	margin: 0 0 28px;
	color: var(--lv2-text-muted);
	font-size: 14px;
}

/* =========================================================
   KOMUNIKATY (ResultMessage divRMs/.RM*) w stylu alertu z projektu.
   Scope #loginV2 - dotyczy TYLKO strony v2; markup ResultMessageModule.tpl
   (wspoldzielony) i globalny CSS pozostaja nietkniete.
   ========================================================= */
#loginV2 #divRMs,
#loginV2 #divAJAXRMs { float: none; width: auto; margin: 0; font-weight: 500; }

#loginV2 #divRMs > div,
#loginV2 #divAJAXRMs > div {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	color: #fff;
	border: none;
	border-radius: var(--lv2-radius-card);
	padding: 18px 44px 18px 18px;
	margin: 0 0 28px 0;
	box-shadow: 0 6px 20px rgba(145,0,15,0.18);
	text-shadow: none;
	font-size: 13.5px;
	line-height: 1.5;
	font-weight: 500;
	float: none;
	width: auto;
	background: linear-gradient(180deg, var(--lv2-brand-primary) 0%, var(--lv2-brand-primary-700) 100%);
}

/* ikona (i) po lewej - pierwszy element flex przez ::before */
#loginV2 #divRMs > div::before,
#loginV2 #divAJAXRMs > div::before {
	content: "";
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* tresc komunikatu */
#loginV2 #divRMs .RMwrap,
#loginV2 #divAJAXRMs .RMwrap {
	float: none;
	padding: 0;
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	font-weight: 500;
}
#loginV2 #divRMs .RMwrap strong,
#loginV2 #divAJAXRMs .RMwrap strong { font-weight: 700; }

/* przycisk zamkniecia - nadpisuje inline style z .tpl (float/padding) */
#loginV2 #divRMs .closeRM,
#loginV2 #divAJAXRMs .closeRM {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	width: 28px !important;
	height: 28px !important;
	padding: 0 !important;
	margin: 0 !important;
	float: none !important;
	display: grid !important;
	place-items: center;
	background: rgba(255,255,255,0.14);
	border-radius: 6px;
	color: #fff;
	font-size: 18px;
	font-weight: 400 !important;
	line-height: 1;
	transition: background .15s;
}
#loginV2 #divRMs .closeRM:hover,
#loginV2 #divAJAXRMs .closeRM:hover { background: rgba(255,255,255,0.28); }

/* wariant SUCCESS (RM1 = OK, np. "Zostales wylogowany") - zielony, BEZ ikony, cienszy */
#loginV2 #divRMs > div.RM1,
#loginV2 #divAJAXRMs > div.RM1 {
	background: linear-gradient(180deg, #5cb85c 0%, #4cae4c 100%);
	box-shadow: 0 6px 20px rgba(60,140,60,0.20);
	align-items: center;
	padding: 9px 44px 9px 18px;
}
#loginV2 #divRMs > div.RM1::before,
#loginV2 #divAJAXRMs > div.RM1::before { display: none; }
#loginV2 #divRMs .RM1 .RMwrap,
#loginV2 #divAJAXRMs .RM1 .RMwrap { font-size: 14px; font-weight: 600; }

/* Formularz */
#loginV2 .lv2-login-form { display: flex; flex-direction: column; gap: 16px; }
#loginV2 .lv2-field { display: flex; flex-direction: column; gap: 6px; }
#loginV2 .lv2-field__label {
	font-size: 13px;
	font-weight: 500;
	color: var(--lv2-text);
	margin: 0;
}
#loginV2 .lv2-field__control {
	position: relative;
	display: flex;
	align-items: center;
}
#loginV2 input.lv2-field__input {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	font-family: inherit;
	font-size: 14px;
	line-height: normal;
	color: var(--lv2-text);
	background: var(--lv2-surface);
	border: 1px solid var(--lv2-border-strong);
	border-radius: var(--lv2-radius-input);
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
#loginV2 input.lv2-field__input:hover { border-color: #98a2b3; }
#loginV2 input.lv2-field__input:focus {
	outline: none;
	border-color: var(--lv2-brand-primary);
	box-shadow: 0 0 0 3px rgba(184, 25, 31, 0.15);
}

/* Pokaz/ukryj haslo */
#loginV2 .lv2-field--password input.lv2-field__input { padding-right: 44px; }
#loginV2 .lv2-field__toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px; height: 32px;
	display: grid; place-items: center;
	background: transparent;
	border: none;
	border-radius: 6px;
	color: var(--lv2-text-subtle);
	padding: 0;
}
#loginV2 .lv2-field__toggle:hover { background: var(--lv2-bg); color: var(--lv2-text); }

#loginV2 .lv2-field__row {
	display: flex;
	justify-content: flex-end;
	min-height: 18px;
}
#loginV2 .lv2-field__forgot {
	color: var(--lv2-brand-primary);
	font-size: 12.5px;
	text-decoration: none;
	font-weight: 500;
}
#loginV2 .lv2-field__forgot:hover { text-decoration: underline; color: var(--lv2-brand-primary-700); }

/* Captcha */
#loginV2 .lv2-captcha { display: flex; flex-direction: column; gap: 8px; }
#loginV2 .lv2-captcha img { align-self: flex-start; border-radius: var(--lv2-radius-input); }

/* Przyciski */
#loginV2 .lv2-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 18px;
	font-family: inherit;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.06em;
	border-radius: var(--lv2-radius-button);
	border: 1px solid transparent;
	transition: background .15s, color .15s, border-color .15s, transform .05s;
	text-transform: uppercase;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	width: 100%;
}
#loginV2 .lv2-btn:active { transform: translateY(1px); }
#loginV2 .lv2-btn--primary {
	background: linear-gradient(180deg, var(--lv2-brand-primary) 0%, var(--lv2-brand-primary-700) 100%);
	color: #fff;
	border-color: var(--lv2-brand-primary-700);
}
#loginV2 .lv2-btn--primary:hover {
	background: linear-gradient(180deg, var(--lv2-brand-primary-700) 0%, #6b0009 100%);
	color: #fff;
}
#loginV2 .lv2-btn--secondary {
	background: var(--lv2-surface);
	color: var(--lv2-brand-primary);
	border-color: var(--lv2-brand-primary);
}
#loginV2 .lv2-btn--secondary:hover { background: var(--lv2-brand-primary-50); color: var(--lv2-brand-primary); text-decoration: none; }

#loginV2 .lv2-login-form__actions {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Linki pod formularzem */
#loginV2 .lv2-login-box__mobile,
#loginV2 .lv2-login-box__links {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--lv2-border);
	text-align: center;
	font-size: 13px;
}
#loginV2 .lv2-login-box__mobile a,
#loginV2 .lv2-login-box__links a { color: var(--lv2-text-muted); text-decoration: none; }
#loginV2 .lv2-login-box__mobile a:hover,
#loginV2 .lv2-login-box__links a:hover { color: var(--lv2-brand-primary); text-decoration: underline; }

/* Ikony social na dole panelu */
#loginV2 .lv2-login-panel__icons {
	margin-top: auto;
	padding-top: 40px;
	display: flex;
	justify-content: center;
	gap: 28px;
	color: var(--lv2-text-subtle);
}
#loginV2 .lv2-login-panel__icons a {
	width: 36px; height: 36px;
	display: grid; place-items: center;
	border-radius: 8px;
	color: var(--lv2-text-subtle);
	text-decoration: none;
	transition: background .15s, color .15s;
}
#loginV2 .lv2-login-panel__icons a:hover { background: var(--lv2-bg); color: var(--lv2-brand-primary); }

/* =========================================================
   PRAWA STREFA BANEROW (WidgetMagic: login_top/left/middle/right/bottom)
   ========================================================= */
#loginV2 .lv2-promo {
	padding: 56px clamp(24px, 3vw, 40px) 48px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}
#loginV2 .lv2-bannersection { min-width: 0; }

/* duze banery / rotatory: 2 w rzedzie jak w projekcie */
#loginV2 .lv2-bannersection--top {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	align-items: start;
}

/* male banery: wspolny grid 4 w rzedzie — display:contents scala
   zawartosc kontenerow login_left/middle/right w jeden przeplyw */
#loginV2 .lv2-bannersection--cols {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	align-items: start;
}
#loginV2 .lv2-bannercol { display: contents; }

/* dopasowanie istniejacych widgetow (inline styles legacy) do siatki */
#loginV2 .lv2-bannersection > a,
#loginV2 .lv2-bannercol > a { display: block; min-width: 0; }

/* male banery: delikatne powiekszenie obrazka na hover (jak w projekcie) */
#loginV2 .lv2-bannercol > a {
	overflow: hidden;
	border-radius: var(--lv2-radius-card);
}
#loginV2 .lv2-bannercol > a img { transition: transform .5s ease; }
#loginV2 .lv2-bannercol > a:hover img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
	#loginV2 .lv2-bannercol > a img { transition: none; }
	#loginV2 .lv2-bannercol > a:hover img { transform: none; }
}
#loginV2 .lv2-promo a > div { float: none !important; display: block !important; width: 100% !important; }
#loginV2 .lv2-promo img { width: 100%; max-width: 100%; height: auto; border-radius: var(--lv2-radius-card); display: block; }
#loginV2 .lv2-promo iframe, #loginV2 .lv2-promo object, #loginV2 .lv2-promo embed { max-width: 100%; }

/* rotator (RotoWidget) — inline width/height z konfiguracji widgetu nadpisujemy,
   zeby skalowal sie do kolumny siatki */
#loginV2 .lv2-promo .rotoWidget { float: none !important; width: 100% !important; min-width: 0; }
/* pojedynczy rotator zajmuje cala szerokosc; dwa rotatory — po polowie */
#loginV2 .lv2-bannersection--top > .rotoWidget:only-of-type { grid-column: 1 / -1; }
#loginV2 .lv2-promo .rotoWidgetWidget { width: 100% !important; height: auto !important; margin: 0 !important; }
#loginV2 .lv2-promo .rotoWidgetWidget a > div { width: 100% !important; }

/* paginacja rotatora (rotoControls/.rotoC) w stylu paskow z makiety (.slider__dots/.slider__dot) */
#loginV2 .rotoControls {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 14px 0 0 0;
	float: none;
	width: 100%;
}
#loginV2 .rotoControls .rotoC {
	flex: 0 0 auto;
	width: 34px;
	height: 4px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: #d3d7dd;
	cursor: pointer;
	display: block;
	transition: background .15s;
}
#loginV2 .rotoControls .rotoC:hover { background: #b3b9c1; }
#loginV2 .rotoControls .rotoC.sel { background: #1a6fd6; }

/* =========================================================
   FOOTER
   ========================================================= */
#loginV2 .lv2-footer {
	background: var(--lv2-surface);
	border-top: 1px solid var(--lv2-border);
	padding: 14px 24px;
	font-size: 11px;
	letter-spacing: 0.06em;
	color: var(--lv2-text-subtle);
	text-transform: uppercase;
}
#loginV2 .lv2-footer__copy {
	max-width: var(--lv2-content-max);
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
}
#loginV2 .lv2-footer__copy img { height: 20px; width: auto; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
	#loginV2 .lv2-main { grid-template-columns: 1fr; }
	#loginV2 .lv2-login-panel { border-right: none; border-bottom: 1px solid var(--lv2-border); }
}
@media (max-width: 720px) {
	#loginV2 .lv2-topnav__inner { padding: 0 16px; gap: 12px; }
	#loginV2 .lv2-topnav__tabs { gap: 16px; }
	#loginV2 .lv2-topnav__tab { font-size: 13px; }
	#loginV2 .lv2-login-panel { padding: 32px 20px; }
	#loginV2 .lv2-promo { padding: 20px 16px; gap: 16px; }
	#loginV2 .lv2-bannersection--top { grid-template-columns: 1fr; }
	#loginV2 .lv2-bannersection--cols { grid-template-columns: 1fr 1fr; }
	#loginV2 .lv2-footer__copy { flex-direction: column; gap: 8px; text-align: center; }
}
