/* ── EBK Auth Popup ───────────────────────────────────────────── */

.ebk-auth-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, .55);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}
.ebk-auth-overlay.is-open {
	opacity: 1;
	pointer-events: all;
}

/* Modal */
.ebk-auth-modal {
	background: #fff;
	border-radius: 20px;
	width: 100%;
	max-width: 520px;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 24px 80px rgba(0,0,0,.35);
	transform: translateY(20px) scale(.97);
	transition: transform .3s cubic-bezier(.34,1.56,.64,1);
	scrollbar-width: thin;
	scrollbar-color: #e0c0e0 transparent;
}
.ebk-auth-overlay.is-open .ebk-auth-modal {
	transform: translateY(0) scale(1);
}

/* Header */
.ebk-auth-modal__head {
	background: linear-gradient(135deg, #7c007c 0%, #2F002F 100%);
	padding: 24px 24px 0;
	border-radius: 20px 20px 0 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.ebk-auth-modal__logo {
	height: 44px;
	width: auto;
	filter: brightness(0) invert(1);
}
.ebk-auth-modal__close {
	background: rgba(255,255,255,.15);
	border: none;
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s;
	flex-shrink: 0;
	line-height: 1;
}
.ebk-auth-modal__close:hover { background: rgba(255,255,255,.3); }

/* Tabs */
.ebk-auth-tabs {
	background: linear-gradient(135deg, #7c007c 0%, #2F002F 100%);
	display: flex;
	padding: 16px 24px 0;
	gap: 4px;
}
.ebk-auth-tab {
	flex: 1;
	background: rgba(255,255,255,.15);
	border: none;
	color: rgba(255,255,255,.7);
	padding: 12px 16px;
	border-radius: 12px 12px 0 0;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, color .2s;
	letter-spacing: .02em;
}
.ebk-auth-tab.is-active {
	background: #fff;
	color: #7c007c;
}

/* Body */
.ebk-auth-body {
	padding: 28px 28px 32px;
}

/* Panels */
.ebk-auth-panel { display: none; }
.ebk-auth-panel.is-active { display: block; }

/* Error */
.ebk-auth-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 14px;
	margin-bottom: 20px;
}

/* Success */
.ebk-auth-success {
	background: #f0fdf4;
	border: 1px solid #86efac;
	color: #166534;
	border-radius: 10px;
	padding: 16px;
	font-size: 15px;
	text-align: center;
	margin-bottom: 20px;
}

/* Account type switcher */
.ebk-type-switcher {
	display: flex;
	background: #f3e6f3;
	border-radius: 12px;
	padding: 4px;
	margin-bottom: 24px;
}
.ebk-type-opt {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 9px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #6b0070;
	transition: background .2s, color .2s, box-shadow .2s;
}
.ebk-type-opt input[type="radio"] { display: none; }
.ebk-type-opt.is-active {
	background: #fff;
	color: #7c007c;
	box-shadow: 0 2px 8px rgba(124,0,124,.18);
}
.ebk-type-opt svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Section divider */
.ebk-auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0 16px;
	color: #9c4fa0;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.ebk-auth-divider::before,
.ebk-auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e8c0e8;
}

/* Fields */
.ebk-field {
	margin-bottom: 14px;
}
.ebk-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #4a2b4a;
	margin-bottom: 6px;
}
.ebk-field input[type="text"],
.ebk-field input[type="email"],
.ebk-field input[type="password"],
.ebk-field input[type="tel"] {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e5d0e5;
	border-radius: 10px;
	font-size: 15px;
	color: #1a1a1a;
	background: #faf5fa;
	transition: border-color .2s, box-shadow .2s, background .2s;
	outline: none;
	box-sizing: border-box;
}
.ebk-field input:focus {
	border-color: #b00b;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(176,0,176,.12);
}
.ebk-field input.is-error {
	border-color: #ef4444;
	background: #fff5f5;
}
.ebk-field .ebk-hint {
	font-size: 12px;
	color: #9c4fa0;
	margin-top: 4px;
}

/* Password wrap */
.ebk-pass-wrap {
	position: relative;
}
.ebk-pass-wrap input { padding-right: 44px; }
.ebk-eye-btn {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #9c4fa0;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	line-height: 1;
}
.ebk-eye-btn svg { width: 20px; height: 20px; }

/* 2-column grid */
.ebk-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* Remember + forgot row */
.ebk-auth-extras {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 8px;
}
.ebk-remember {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #555;
	cursor: pointer;
}
.ebk-remember input { accent-color: #b00b; }
.ebk-forgot {
	font-size: 13px;
	color: #9c4fa0;
	text-decoration: none;
	font-weight: 500;
}
.ebk-forgot:hover { text-decoration: underline; }

/* Submit button */
.ebk-submit-btn {
	width: 100%;
	padding: 15px 24px;
	background: linear-gradient(135deg, #b00b 0%, #a200d6 100%);
	color: #fff;
	border: none;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	cursor: pointer;
	margin-top: 8px;
	box-shadow: 0 4px 16px rgba(176,0,176,.3);
	transition: transform .15s, box-shadow .2s, background .2s;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
}
.ebk-submit-btn:hover:not(:disabled) {
	background: linear-gradient(135deg, #9a009a 0%, #8c00b8 100%);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(176,0,176,.38);
}
.ebk-submit-btn:disabled {
	opacity: .7;
	cursor: not-allowed;
	transform: none;
}

/* Spinner */
.ebk-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255,255,255,.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ebk-spin .7s linear infinite;
	display: none;
}
.is-loading .ebk-spinner { display: block; }
.is-loading .ebk-btn-label { display: none; }

@keyframes ebk-spin {
	to { transform: rotate(360deg); }
}

/* Switch panel link */
.ebk-switch {
	text-align: center;
	margin-top: 18px;
	font-size: 14px;
	color: #666;
}
.ebk-switch button {
	background: none;
	border: none;
	color: #9c00a0;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
	text-decoration: underline;
}

/* Reset fieldset defaults */
#ebk-individual,
#ebk-company {
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
}

/* NIP helper */
.ebk-field input[name="nip"] { letter-spacing: .08em; }

/* Mobile */
@media (max-width: 520px) {
	.ebk-auth-body { padding: 20px 18px 24px; }
	.ebk-row-2 { grid-template-columns: 1fr; gap: 0; }
	.ebk-auth-modal { border-radius: 16px; }
}
