* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.6;
	color: #e0e0e0;
	background: #121212;
	min-height: 100vh;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.header {
	text-align: center;
	margin-bottom: 3rem;
}

.title {
	font-size: 2.5rem;
	font-weight: 400;
	color: #ffffff;
	margin-bottom: 0.5rem;
}

.subtitle {
	font-size: 1.1rem;
	color: #b3b3b3;
	font-weight: 300;
}

.main-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3rem;
	align-items: start;
}

.form-section {
	background: #1e1e1e;
	padding: 2.5rem;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.4);
	border: 1px solid #333;
}

.form-title {
	font-size: 1.5rem;
	font-weight: 400;
	margin-bottom: 1.5rem;
	color: #ffffff;
}

.form-group {
	margin-bottom: 1.5rem;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 400;
	color: #b3b3b3;
	font-size: 0.95rem;
}

input[type="number"],
input[type="text"] {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #555;
	border-radius: 4px;
	font-size: 1rem;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	background: #2a2a2a;
	color: #ffffff;
}

input[type="number"]:focus,
input[type="text"]:focus {
	outline: none;
	border-color: #bb86fc;
	box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
	background: #2a2a2a;
}

input[type="text"]:disabled {
	background: #1a1a1a;
	color: #666;
	border-color: #333;
	cursor: not-allowed;
}

.generate-btn {
	width: 100%;
	padding: 1rem;
	background: #bb86fc;
	color: #000000;
	border: none;
	border-radius: 4px;
	font-size: 1.1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.generate-btn:hover {
	background: #a370f7;
	box-shadow: 0 4px 16px rgba(187, 134, 252, 0.3);
}

.generate-btn:active {
	background: #9c5cf2;
}

.preview-section {
	background: #1e1e1e;
	padding: 2.5rem;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.4);
	text-align: center;
	border: 1px solid #333;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.preview-title {
	font-size: 1.5rem;
	font-weight: 400;
	margin-bottom: 1.5rem;
	color: #ffffff;
}

.preview-frame-container {
	width: 100%;
	max-width: 100%;
	background: #2a2a2a;
	border-radius: 8px;
	border: 1px solid #555;
	overflow: hidden;
	transition: all 0.3s ease;
	position: relative;
	aspect-ratio: 297 / 210;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.preview-frame-container:hover {
	border-color: #bb86fc;
	box-shadow: 0 8px 24px rgba(187, 134, 252, 0.3);
}

.preview-image {
	width: 100%;
	height: auto;
	display: none;
	border-radius: 6px;
	background: #1a1a1a;
	cursor: pointer;
	border: 1px solid #444;
}

.preview-image.is-visible {
	display: block;
}

.preview-image:focus {
	outline: 2px solid #bb86fc;
	outline-offset: 2px;
}

.preview-placeholder {
	width: 100%;
	max-width: 520px;
	height: 100%;
	min-height: 200px;
	background: #2a2a2a;
	border-radius: 8px;
	border: 1px solid #555;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b3b3b3;
	font-weight: 400;
	margin: 0 auto;
	position: relative;
	text-align: center;
	padding: 1.5rem;
}

.preview-placeholder.is-hidden {
	display: none;
}

.preview-placeholder::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 10px,
		rgba(187, 134, 252, 0.1) 10px,
		rgba(187, 134, 252, 0.1) 20px
	);
	border-radius: 8px;
	pointer-events: none;
}

.preview-status {
	margin-top: 1rem;
	color: #b3b3b3;
	font-size: 0.95rem;
	min-height: 1.2rem;
	text-align: center;
}

.preview-status.loading {
	color: #bb86fc;
}

.preview-spinner {
	border: 3px solid #2a2a2a;
	border-top: 3px solid #bb86fc;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	animation: spin 1s linear infinite;
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	pointer-events: none;
}

/* Responsive design */
@media (max-width: 900px) {
	.main-content {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.title {
		font-size: 2rem;
	}

	.form-section,
	.preview-section {
		padding: 1.5rem;
	}

	.container {
		padding: 1rem;
	}
}

@media (max-width: 480px) {
	.title {
		font-size: 1.75rem;
	}

	.form-section,
	.preview-section {
		padding: 1rem;
	}
}

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

/* Focus indicators for better accessibility */
.generate-btn:focus {
	outline: 2px solid #bb86fc;
	outline-offset: 2px;
}

/* Helper text styling */
.help-text {
	color: #888 !important;
	font-size: 0.85rem !important;
}

/* Card count controls styling */
.card-count-container {
	display: flex;
	align-items: center;
	gap: 0;
	max-width: 250px;
	margin: 0 auto;
	background: #2a2a2a;
	border: 2px solid #444;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.card-count-container:hover {
	border-color: #bb86fc;
	box-shadow: 0 4px 12px rgba(187, 134, 252, 0.2);
}

.card-count-container:focus-within {
	border-color: #bb86fc;
	box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
}

.count-btn {
	background: #2a2a2a;
	border: none;
	color: #e0e0e0;
	font-size: 1.5rem;
	font-weight: bold;
	width: 50px;
	height: 50px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	user-select: none;
}

.count-btn:hover {
	background: #bb86fc;
	color: #000;
}

.count-btn:active {
	background: #9c5cf2;
	transform: scale(0.95);
}

.count-btn:focus {
	outline: 2px solid #bb86fc;
	outline-offset: -2px;
}

.minus-btn {
	border-right: 1px solid #444;
}

.plus-btn {
	border-left: 1px solid #444;
}

.card-count-input {
	flex: 1;
	text-align: center;
	background: transparent;
	border: none !important;
	color: #ffffff;
	font-size: 1.1rem;
	font-weight: 500;
	padding: 0 1rem;
	height: 50px;
	min-width: 80px;
}

.card-count-input:focus {
	outline: none;
	background: rgba(187, 134, 252, 0.1);
}

/* Hide spinner arrows */
.card-count-input::-webkit-outer-spin-button,
.card-count-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.card-count-input {
	appearance: textfield;
	-moz-appearance: textfield; /* Firefox */
}

/* Checkbox styling */
.checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.checkbox-option {
	position: relative;
	background: rgba(32, 32, 32, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 0.85rem 1rem;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.checkbox-option:hover {
	background: rgba(45, 45, 45, 0.92);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
	border-color: rgba(187, 134, 252, 0.3);
	transform: translateY(-1px);
}

.checkbox-option:focus-within {
	box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.25);
	border-color: rgba(187, 134, 252, 0.6);
}

.checkbox-option:hover .checkbox-title,
.checkbox-option:focus-within .checkbox-title {
	color: #ffffff;
}

.checkbox-option:hover .checkbox-description,
.checkbox-option:focus-within .checkbox-description {
	color: #bdbdbd;
}

/* Color swatch picker */
.color-swatch-fieldset {
	border: none;
	margin: 0 0 1rem 0;
	padding: 0;
}
.swatch-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
	gap: 0.75rem;
	align-items: center;
}
.swatch-option {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0.5rem;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.05);
	background: rgba(32, 32, 32, 0.85);
	cursor: pointer;
	user-select: none;
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
	outline: none;
}
.swatch-option:focus-within,
.swatch-option:focus {
	box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.25);
	border-color: rgba(187, 134, 252, 0.6);
}
.swatch {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.15);
	flex: 0 0 auto;
	position: relative;
}
.swatch-label {
	font-size: 0.9rem;
	color: #e8e8e8;
}
.swatch-option:hover {
	background: rgba(42, 42, 42, 0.9);
	transform: translateY(-1px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.swatch-option input[type="radio"]:checked + .swatch {
	box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.18), 0 0 0 4px rgba(187, 134, 252, 0.3), 0 10px 20px rgba(0, 0, 0, 0.45);
	border-color: rgba(187, 134, 252, 0.7);
}

.swatch-option input[type="radio"]:checked + .swatch::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(0, 0, 0, 0.35);
	background: rgba(255, 255, 255, 0.35);
}

/* Visually hidden utility */
.visually-hidden {
	position: absolute !important;
	height: 1px; width: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.checkbox-option input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
	cursor: pointer;
	color: #e0e0e0;
	font-size: 1rem;
	font-weight: 400;
	transition: color 0.3s ease;
	user-select: none;
}

.checkbox-label:hover {
	color: #ffffff;
}

.checkbox-custom {
	width: 20px;
	height: 20px;
	border: 2px solid #555;
	border-radius: 4px;
	background: #2a2a2a;
	position: relative;
	transition: all 0.3s ease;
	flex-shrink: 0;
}

.checkbox-text {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.checkbox-title {
	font-size: 1rem;
	font-weight: 500;
	color: #f0f0f0;
}

.checkbox-description {
	font-size: 0.85rem;
	color: #9d9d9d;
	line-height: 1.4;
}

.checkbox-custom::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 6px;
	width: 6px;
	height: 10px;
	border: solid #000;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-label .checkbox-custom {
	background: #bb86fc;
	border-color: #bb86fc;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-label .checkbox-custom::after {
	opacity: 1;
}

.checkbox-option input[type="checkbox"]:focus + .checkbox-label .checkbox-custom {
	outline: 2px solid #bb86fc;
	outline-offset: 2px;
}

.checkbox-label:hover .checkbox-custom {
	border-color: #bb86fc;
	box-shadow: 0 2px 8px rgba(187, 134, 252, 0.2);
}

/* Progress popup styles */
.progress-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 10000;
}

.progress-popup {
	background: #1e1e1e;
	border-radius: 12px;
	padding: 2rem;
	max-width: 400px;
	width: 90%;
	text-align: center;
	border: 1px solid #333;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.progress-title {
	color: #ffffff;
	font-size: 1.5rem;
	margin-bottom: 1rem;
	font-weight: 400;
}

.progress-status {
	color: #b3b3b3;
	margin-bottom: 1.5rem;
	font-size: 1rem;
	min-height: 1.2rem;
}

.progress-bar-container {
	background: #2a2a2a;
	border-radius: 25px;
	height: 8px;
	margin-bottom: 1rem;
	overflow: hidden;
}

.progress-bar {
	background: linear-gradient(90deg, #bb86fc, #9c5cf2);
	height: 100%;
	width: 0%;
	transition: width 0.3s ease;
	border-radius: 25px;
}

.progress-percentage {
	color: #bb86fc;
	font-size: 1.2rem;
	font-weight: 500;
	margin-bottom: 1rem;
}

.progress-spinner {
	border: 3px solid #2a2a2a;
	border-top: 3px solid #bb86fc;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 1rem;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.progress-success {
	color: #4caf50;
	font-size: 1.1rem;
	margin-bottom: 1rem;
}

.progress-error {
	color: #f44336;
	font-size: 1rem;
	margin-bottom: 1rem;
}

.progress-buttons {
	margin-top: 1.5rem;
}

.progress-btn {
	background: #bb86fc;
	color: #000;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	transition: background-color 0.3s ease;
	margin: 0 0.5rem;
}

.progress-btn:hover {
	background: #a370f7;
}

.progress-btn.secondary {
	background: #555;
	color: #fff;
}

.progress-btn.secondary:hover {
	background: #666;
}

/* Utility */
.centered-content {
	display: flex;
	justify-content: center;
	align-items: center;
	flex: 1;
	width: 100%;
	flex-direction: column;
	text-align: center;
}

.narrow-section {
	width: 100%;
	max-width: 520px;
}

.simple-list {
	text-align: left;
	color: #d0d0d0;
	line-height: 1.8;
}

.simple-list li {
	margin-bottom: 0.5rem;
	list-style: none;
	position: relative;
	padding-left: 1.5rem;
}

.simple-list li::before {
	content: '•';
	position: absolute;
	left: 0;
	color: #bb86fc;
}

.loader {
    position: relative;
    width: 120px;
    height: 55px;
    background-repeat: no-repeat;
    background-image:
    radial-gradient(circle 2.5px , #a370f7  100%, transparent 0),
    linear-gradient(#525252 90px, transparent 0),
    linear-gradient(#ececec 120px, transparent 0),
    linear-gradient(to right, #eee 10%,#333 10%,#333 90%,#eee 90%)
    ;

    background-size: 5px 5px, 90px 10px, 120px 45px , 100px 15px;
    background-position: 110px 15px,center bottom , center bottom , center 0 ;

  }
  .loader:before {
    content: "";
    width: 70px;
    background-color: #fff;
    box-shadow: 0 0 10px #0003;
    position: absolute;
    left: 50%;
    transform: translatex(-50%);
    bottom: calc(100% - 10px);
    animation: printerPaper 2s ease-in infinite;
  }
  .loader:after {
    content: "";
    width: 70px;
    height: 80px;
    background-color: #fff;
    background-image:   linear-gradient(to bottom, #FFF 50%, #a370f7  51%),
                        linear-gradient(to bottom, #bbb 50%, #0000 51%);
    background-size: 60px 20px,  60px 10px;
    background-repeat: no-repeat, repeat-y;
    background-position: center 55px , center 0;
    position: absolute;
    left: 50%;
    transform: translatex(-50%) rotate(180deg);
    box-shadow: 0 10px #fff inset;
    top: calc(100% - 8px);
    animation: PrintedPaper 2s ease-in infinite;
  }

  @keyframes printerPaper {
    0% , 25% { height: 50px}
    75%, 100% { height: 0}
  }

  @keyframes PrintedPaper {
    0%, 30% {
      height: 0px;
      top: calc(100% - 8px);
    }

    80% {
      height: 80px;
      top: calc(100% - 8px);
      opacity: 1;
    }
    100% {
      height: 80px;
      top: calc(100% + 10px);
      opacity: 0;
    }
  }
