:root {
	--simplyin-primary: #3b82f6;
	--simplyin-primary-light: #60a5fa;
	--simplyin-primary-dark: #2563eb;
	--simplyin-surface: #ffffff;
	--simplyin-surface-alt: #f8fafc;
	--simplyin-border: #e5e7eb;
	--simplyin-border-light: #f3f4f6;
	--simplyin-text: #1f2937;
	--simplyin-text-muted: #6b7280;
	--simplyin-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	--simplyin-radius: 8px;
	--simplyin-transition: all 0.2s ease;
}

.simplyin-blik-field-container {
	display: block;
	padding: 0 16px 16px;
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	animation: simplyin-fadeIn 0.3s ease;

	&.active {
		display: block;
		animation: simplyin-fadeIn 0.3s ease;
	}
}

.simplyin-blik-input-wrapper {
	transition: var(--simplyin-transition);
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}

.simplyin-blik-label {
	display: block;
	font-size: 0.9em;
	font-weight: 500;
	color: var(--simplyin-text);
	margin-bottom: 16px;
	text-align: center;
}

.simplyin-blik-inputs-grid {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 0 !important;
	width: 100%;
	max-width: 280px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.simplyin-blik-digit-input {
	width: calc((100% - 40px) / 6);
	max-width: 44px;
	height: 48px;
	border: 2px solid #e1e1e1 !important;
	border-radius: var(--simplyin-radius);
	font-size: 16px;
	padding: 0 !important;
	font-weight: 600;
	text-align: center;
	color: var(--simplyin-text);
	background: var(--simplyin-surface) !important;
	transition: var(--simplyin-transition);
	outline: none;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	flex-grow: 0;
	box-shadow: unset !important;

	&:focus,
	&:focus-visible,
	&:focus-within {
		border-color: var(--simplyin-primary) !important;
		box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
		z-index: 1;
		position: relative;
	}

	&:hover:not(:focus) {
		border-color: var(--simplyin-primary-light);
	}

	&.error {
		border-color: #ef4444;
		background: #fef2f2;
		color: #dc2626;
		animation: simplyin-shake 0.4s ease;
	}

	&.valid {
		border-color: #22c55e;
		background: #f0fdf4;
		color: #166534;
	}
}

.simplyin-blik-error {
	color: #ef4444;
	font-size: 0.85em;
	text-align: center;
	margin-top: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.4;

	&::before {
		content: "⚠️";
		font-size: 1em;
		flex-shrink: 0;
	}
}

.simplyin-blik-info {
	color: var(--simplyin-text-muted);
	font-size: 0.85em;
	text-align: center;
	margin-top: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.4;

	&::before {
		content: "ℹ️";
		font-size: 1em;
		flex-shrink: 0;
	}
}

// Animacje
@keyframes simplyin-fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes simplyin-shake {
	0%,
	100% {
		transform: translateX(0);
	}
	20% {
		transform: translateX(-2px);
	}
	40% {
		transform: translateX(2px);
	}
	60% {
		transform: translateX(-2px);
	}
	80% {
		transform: translateX(2px);
	}
}

// Responsive design
@media only screen and (max-width: 480px) {
	.simplyin-blik-field-container {
		padding: 0 12px 12px;
	}

	.simplyin-blik-input-wrapper {
		padding: 16px 12px;
	}

	.simplyin-blik-inputs-grid {
		gap: 6px;
		max-width: 240px;
	}

	.simplyin-blik-digit-input {
		width: calc((100% - 30px) / 6);
		max-width: 38px;
		height: 44px;
		font-size: 16px;
		padding: 0 !important;
	}
}

@media only screen and (max-width: 380px) {
	.simplyin-blik-input-wrapper {
		padding: 14px 10px;
	}

	.simplyin-blik-inputs-grid {
		gap: 4px;
		max-width: 220px;
	}

	.simplyin-blik-digit-input {
		width: calc((100% - 20px) / 6);
		max-width: 35px;
		height: 42px;
		font-size: 16px;
		padding: 0 !important;
	}
}

@media only screen and (max-width: 320px) {
	.simplyin-blik-input-wrapper {
		padding: 12px 8px;
	}

	.simplyin-blik-inputs-grid {
		gap: 3px;
		max-width: 200px;
	}

	.simplyin-blik-digit-input {
		width: calc((100% - 15px) / 6);
		max-width: 32px;
		height: 40px;
		font-size: 16px;
		padding: 0 !important;
	}
}

@media only screen and (max-width: 280px) {
	.simplyin-blik-inputs-grid {
		gap: 2px;
		max-width: 180px;
	}

	.simplyin-blik-digit-input {
		width: calc((100% - 10px) / 6);
		max-width: 29px;
		height: 38px;
		font-size: 16px;
		padding: 0 !important;
	}
}

// Accessibility
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

.simplyin-block-payment-item {
	&.simplyin-blik {
		.simplyin-blik-field-container {
			padding: 16px 0;
		}

		input.blik-input {
			display: none;
		}
	}
}
