/* ============================================
   Titanet Gamified Quiz - Frontend Styles
   ============================================ */

:root {
	--primary-color: #6366f1;
	--primary-dark: #4f46e5;
	--primary-light: #a5b4fc;
	--secondary-color: #f3f4f6;
	--success-color: #10b981;
	--text-primary: #111827;
	--text-secondary: #6b7280;
	--border-color: #e5e7eb;
	--shadow-sm: 0 4px 14px rgba(99, 102, 241, 0.15);
	--shadow-md: 0 10px 40px rgba(0, 0, 0, 0.08);
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
	box-sizing: border-box;
}

/* ============================================
   Container Principale
   ============================================ */

#titanet-quiz-container,
.titanet-quiz-wrapper {
	max-width: 600px;
	margin: 40px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--text-primary);
	padding: 0 20px;
}

/* ============================================
   Card Principale
   ============================================ */

.t-quiz-card {
	background: #ffffff;
	border-radius: 20px;
	padding: 50px 40px;
	box-shadow: var(--shadow-md);
	text-align: center;
	animation: slideUp 0.5s ease-out;
}

@media (max-width: 480px) {
	.t-quiz-card {
		padding: 30px 20px;
		border-radius: 16px;
	}
}

/* ============================================
   Icone e Header
   ============================================ */

.t-quiz-icon {
	font-size: 80px;
	margin-bottom: 25px;
	display: block;
	animation: bounce 2s infinite ease-in-out;
	line-height: 1;
}

.t-quiz-card h2 {
	font-size: 32px;
	font-weight: 800;
	margin: 0 0 15px;
	color: var(--text-primary);
	letter-spacing: -0.5px;
}

.t-quiz-card h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 25px;
	color: var(--text-primary);
	text-align: left;
	line-height: 1.4;
}

.t-quiz-card p {
	font-size: 16px;
	color: var(--text-secondary);
	line-height: 1.6;
	margin: 0 0 30px;
}

.t-quiz-card strong {
	color: var(--primary-color);
	font-weight: 700;
}

/* ============================================
   Progress Bar
   ============================================ */

.t-progress-wrapper {
	margin-bottom: 35px;
	text-align: left;
}

.t-progress-bar {
	background: var(--border-color);
	height: 8px;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 12px;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.t-progress-fill {
	background: linear-gradient(90deg, #3b82f6, #8b5cf6);
	height: 100%;
	width: 0%;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 10px;
}

.t-discount-badge {
	font-size: 14px;
	color: var(--primary-color);
	font-weight: 700;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.t-discount-badge strong {
	font-size: 18px;
}

/* ============================================
   Pulsanti
   ============================================ */

.t-btn-primary,
.t-btn-secondary {
	border: none;
	border-radius: 10px;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition);
	display: inline-block;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.t-btn-primary {
	background: var(--primary-color);
	color: #ffffff;
	width: 100%;
	box-shadow: var(--shadow-sm);
}

.t-btn-primary:hover,
.t-btn-primary:focus {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
	outline: none;
}

.t-btn-primary:active {
	transform: translateY(0);
}

.t-btn-secondary {
	background: var(--secondary-color);
	color: var(--text-primary);
	width: auto;
}

.t-btn-secondary:hover,
.t-btn-secondary:focus {
	background: var(--border-color);
	outline: none;
}

/* ============================================
   Input Fields
   ============================================ */

.t-inputs-wrapper {
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 25px;
}

.t-input,
.t-textarea {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid var(--border-color);
	border-radius: 10px;
	font-size: 16px;
	font-family: inherit;
	transition: var(--transition);
	background: #ffffff;
	color: var(--text-primary);
}

.t-input::placeholder,
.t-textarea::placeholder {
	color: var(--text-secondary);
	opacity: 0.7;
}

.t-input:focus,
.t-textarea:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
	background: #ffffff;
}

.t-textarea {
	resize: vertical;
	min-height: 100px;
	font-size: 15px;
	line-height: 1.5;
}

/* ============================================
   Radio & Checkbox
   ============================================ */

.t-radio-checkbox {
	display: flex;
	align-items: center;
	padding: 14px 16px;
	border: 2px solid var(--border-color);
	border-radius: 10px;
	cursor: pointer;
	transition: var(--transition);
	background: #ffffff;
	margin: 0;
	position: relative;
}

.t-radio-checkbox:hover {
	border-color: var(--primary-light);
	background: #fafbff;
}

.t-radio-checkbox input {
	margin: 0;
	margin-right: 12px;
	cursor: pointer;
	width: 20px;
	height: 20px;
	accent-color: var(--primary-color);
	flex-shrink: 0;
}

.t-radio-checkbox span {
	flex: 1;
	font-weight: 500;
	color: var(--text-primary);
	user-select: none;
}

.t-radio-checkbox input:checked + span {
	font-weight: 700;
}

/* ============================================
   Coupon Box
   ============================================ */

.t-coupon-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border: 2px dashed var(--border-color);
	padding: 20px 24px;
	border-radius: 12px;
	margin: 25px 0;
	flex-wrap: wrap;
}

#t-coupon-code {
	font-size: 28px;
	font-weight: 900;
	color: var(--text-primary);
	letter-spacing: 3px;
	font-family: 'Monaco', 'Courier New', monospace;
	text-transform: uppercase;
	flex: 1;
	min-width: 150px;
}

.t-copy-btn-wrapper {
	display: flex;
	gap: 8px;
}

#t-copy-btn {
	padding: 10px 16px;
	font-size: 14px;
	white-space: nowrap;
}

/* ============================================
   Utilità
   ============================================ */

.mt-2 {
	margin-top: 8px;
}

.mt-4 {
	margin-top: 24px;
}

.mb-2 {
	margin-bottom: 8px;
}

.mb-4 {
	margin-bottom: 24px;
}

.t-hidden {
	display: none !important;
}

.fade-in {
	animation: fadeIn 0.5s ease-out forwards;
}

.block-btn {
	width: 100%;
	display: block;
}

/* ============================================
   Loader
   ============================================ */

.t-loader {
	border: 4px solid #f3f3f3;
	border-top: 4px solid var(--primary-color);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
	margin: 0 auto 25px;
}

/* ============================================
   Success State
   ============================================ */

.success-step {
	text-align: center;
}

.success-step .t-quiz-icon {
	animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-step p {
	font-size: 18px;
	line-height: 1.7;
}

/* ============================================
   Already Completed Message
   ============================================ */

.titanet-quiz-already-completed {
	background: var(--secondary-color);
	border-left: 4px solid var(--success-color);
	padding: 20px;
	border-radius: 8px;
	margin: 20px 0;
}

.titanet-quiz-already-completed p {
	margin: 0;
	color: var(--text-primary);
	font-weight: 500;
}

/* ============================================
   Animazioni
   ============================================ */

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

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

@keyframes bounce {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-15px);
	}
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 480px) {
	#titanet-quiz-container,
	.titanet-quiz-wrapper {
		margin: 20px auto;
		padding: 0 15px;
	}

	.t-quiz-card h2 {
		font-size: 24px;
	}

	.t-quiz-card h3 {
		font-size: 18px;
		margin-bottom: 20px;
	}

	.t-quiz-icon {
		font-size: 64px;
	}

	.t-btn-primary,
	.t-btn-secondary {
		padding: 12px 20px;
		font-size: 15px;
	}

	.t-coupon-box {
		flex-direction: column;
		text-align: center;
	}

	#t-coupon-code {
		font-size: 24px;
		letter-spacing: 2px;
	}
}

@media (max-width: 320px) {
	.t-quiz-card {
		padding: 20px 15px;
	}

	.t-quiz-card h2 {
		font-size: 20px;
	}

	#t-coupon-code {
		font-size: 20px;
	}
}
