/*!
 * Modal de Certificação - Versão Modular
 * Criado para reutilização em múltiplos projetos
 * Compatível com WCAG 2.1 AA
 */

/* ========================================
   MODAL BASE STYLES
   ======================================== */
.cert-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cert-modal.show {
	opacity: 1;
	visibility: visible;
}

/* ========================================
   OVERLAY & BACKDROP
   ======================================== */
.cert-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* ========================================
   MODAL CONTENT CONTAINER
   ======================================== */
.cert-modal-content {
	position: relative;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 
		0 25px 50px -12px rgba(0, 0, 0, 0.25),
		0 0 0 1px rgba(255, 255, 255, 0.1);
	max-width: 650px;
	max-height: 85vh;
	width: 100%;
	overflow: hidden;
	transform: scale(0.9) translateY(40px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	margin: auto;
}

.cert-modal.show .cert-modal-content {
	transform: scale(1) translateY(0);
}

/* ========================================
   MODAL HEADER
   ======================================== */
.cert-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2rem 2.5rem;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	position: relative;
}

.cert-modal-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
	backdrop-filter: blur(20px);
}

.cert-modal-title {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0;
	font-size: 1.375rem;
	font-weight: 700;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	letter-spacing: -0.025em;
	position: relative;
	z-index: 1;
}

.cert-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cert-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: white;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	z-index: 1;
}

.cert-modal-close:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.05);
}

.cert-modal-close:active {
	transform: scale(0.95);
}

.cert-modal-close svg {
	width: 20px;
	height: 20px;
}

/* ========================================
   MODAL BODY
   ======================================== */
.cert-modal-body {
	padding: 2.5rem !important;
	max-height: 55vh !important;
	overflow-y: auto !important;
	scroll-behavior: smooth !important;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Custom Scrollbar */
.cert-modal-body::-webkit-scrollbar {
	width: 8px;
}

.cert-modal-body::-webkit-scrollbar-track {
	background: #f8fafc;
	border-radius: 4px;
}

.cert-modal-body::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
	border-radius: 4px;
	border: 1px solid #e2e8f0;
}

.cert-modal-body::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

/* ========================================
   INFO COMPONENT (TEXTO NORMAL)
   ======================================== */
.cert-modal .cert-info {
	padding: 1.5rem !important;
	background: #ffffff !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 12px !important;
	margin-bottom: 2rem !important;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.cert-modal .cert-info div {
	font-size: 1.1rem !important;
	line-height: 1.7 !important;
	color: #374151 !important;
	font-weight: 400 !important;
	text-align: left !important;
}

.cert-modal .cert-info strong {
	font-weight: 700 !important;
	color: #1f2937 !important;
}

.cert-modal .cert-info h4 {
	font-size: 1.2rem !important;
	color: #111827 !important;
	font-weight: 600 !important;
	margin: 0 0 1rem 0 !important;
}

/* ========================================
   ALERT COMPONENT - CONFIGURAÇÃO ÚNICA
   ======================================== */

/* ========================================
   ALERT COMPONENT - ESTILO BRANCO SIMPLES
   ======================================== */
.cert-modal .cert-alert {
	display: flex !important;
	gap: 1.25rem !important;
	padding: 1.5rem !important;
	background: #ffffff !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 16px !important;
	margin-bottom: 2rem !important;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}

.cert-modal .cert-alert-icon {
	width: 24px !important;
	height: 24px !important;
	color: #6366f1 !important;
	flex-shrink: 0 !important;
	margin-top: 2px !important;
	filter: drop-shadow(0 1px 2px rgba(99, 102, 241, 0.2)) !important;
}

.cert-modal .cert-alert div {
	font-size: 1.25rem !important;
	line-height: 1.8 !important;
	color: #374151 !important;
	font-weight: 600 !important;
}

.cert-modal .cert-alert strong {
	font-weight: 700 !important;
	color: #1f2937 !important;
}

/* ========================================
   COURSE INFO SECTION
   ======================================== */
.cert-modal .cert-course-info {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.cert-modal .cert-course-info h3 {
	margin: 0 0 1.5rem 0 !important;
	font-size: 1.25rem !important;
	font-weight: 700 !important;
	color: #1e293b !important;
	letter-spacing: -0.025em !important;
	line-height: 1.3 !important;
}

.cert-modal .cert-course-info h4 {
	margin: 2rem 0 1.25rem 0 !important;
	font-size: 1.1rem !important;
	font-weight: 600 !important;
	color: #334155 !important;
	letter-spacing: -0.015em !important;
	line-height: 1.4 !important;
}

.cert-modal .cert-course-info p {
	margin: 0 0 1.5rem 0 !important;
	line-height: 1.7 !important;
	color: #475569 !important;
	text-align: justify !important;
	font-size: 1rem !important;
	font-weight: 400 !important;
}

/* ========================================
   OBJECTIVES LIST
   ======================================== */
.cert-modal .cert-objectives {
	margin: 0 !important;
	padding-left: 0 !important;
	list-style: none !important;
}

.cert-modal .cert-objectives li {
	position: relative !important;
	margin-bottom: 1rem !important;
	line-height: 1.7 !important;
	color: #475569 !important;
	text-align: justify !important;
	padding-left: 2rem !important;
	font-size: 1rem !important;
	font-weight: 400 !important;
}

.cert-modal .cert-objectives li:before {
	content: '✓' !important;
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	color: #10b981 !important;
	font-weight: 900 !important;
	font-size: 1.1rem !important;
	text-shadow: 0 1px 2px rgba(16, 185, 129, 0.3) !important;
}

.cert-modal .cert-objectives li:last-child {
	margin-bottom: 0 !important;
}

/* ========================================
   MODAL FOOTER
   ======================================== */
.cert-modal-footer {
	padding: 2rem 2.5rem;
	background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: center;
	gap: 1rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.cert-btn {
	border: none;
	border-radius: 12px;
	padding: 1rem 2.5rem;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	outline: none;
	letter-spacing: -0.01em;
	position: relative;
	overflow: hidden;
}

.cert-btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cert-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.cert-btn-primary:active {
	transform: translateY(0);
}

/* Button ripple effect */
.cert-btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.cert-btn:active::before {
	width: 300px;
	height: 300px;
}

/* ========================================
   ACCESSIBILITY FOCUS STYLES
   ======================================== */
.cert-modal-close:focus,
.cert-btn:focus {
	outline: 3px solid #667eea;
	outline-offset: 2px;
}

.cert-modal-close:focus {
	outline-color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
	.cert-modal {
		padding: 1rem;
	}

	.cert-modal-content {
		max-width: 100%;
		border-radius: 16px;
		max-height: 90vh;
	}

	.cert-modal-header {
		padding: 1.75rem 2rem;
	}

	.cert-modal-title {
		font-size: 1.25rem;
	}

	.cert-modal-body {
		padding: 2rem;
	}

	.cert-modal-footer {
		padding: 1.75rem 2rem;
	}
}

/* Mobile Phones */
@media (max-width: 640px) {
	.cert-modal {
		padding: 0.75rem;
	}

	.cert-modal-content {
		border-radius: 12px;
		max-height: 92vh;
	}

	.cert-modal-header {
		padding: 1.5rem 1.75rem;
	}

	.cert-modal-title {
		font-size: 1.125rem;
		gap: 0.75rem;
	}

	.cert-icon {
		width: 24px;
		height: 24px;
	}

	.cert-modal-body {
		padding: 1.75rem;
		max-height: 60vh;
	}

	.cert-modal-footer {
		padding: 1.5rem 1.75rem;
	}

	.cert-alert {
		flex-direction: column;
		gap: 1rem;
		padding: 1.25rem;
	}

	.cert-alert-icon {
		align-self: flex-start;
		margin-top: 0;
	}

	.cert-btn {
		padding: 0.875rem 2rem;
		font-size: 0.9rem;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.cert-modal {
		padding: 0.5rem;
	}

	.cert-modal-content {
		max-height: 95vh;
	}

	.cert-modal-body {
		padding: 1.5rem;
		max-height: 65vh;
	}

	.cert-objectives li {
		padding-left: 1.75rem;
	}
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
	.cert-modal-content {
		border: 3px solid #000000;
	}

	.cert-alert {
		border-width: 3px;
	}

	.cert-btn-primary {
		background: #000000;
		color: #ffffff;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.cert-modal,
	.cert-modal-content,
	.cert-btn,
	.cert-modal-close {
		transition: none;
		animation: none;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.cert-modal-content {
		background: #1e293b;
		color: #f1f5f9;
	}

	.cert-course-info h3,
	.cert-course-info h4 {
		color: #f1f5f9;
	}

	.cert-course-info p,
	.cert-objectives li {
		color: #cbd5e1;
	}

	.cert-modal-footer {
		background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
		border-color: #475569;
	}
}

/* Print styles */
@media print {
	.cert-modal {
		display: none !important;
	}
}

/* ========================================
   UTILITIES
   ======================================== */
.cert-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}