/**
 * Folha de estilo: Submissão de Artigo (OTP Front-end)
 * Descrição: Formulário com Stepper para submissão de itens ao Repositório.
 */

.submit-article-bg {
	background-color: #f9f9f9;
	padding: 4rem 0;
	min-height: 80vh;
}

.submit-article-container {
	max-width: 950px;
	margin: 0 auto;
}

/* --- CABEÇALHO --- */
.submit-header {
	text-align: center;
	margin-bottom: 3.5rem;
}

.submit-logo-wrapper {
	margin-bottom: 1.5rem;
	display: flex;
	justify-content: center;
}

.submit-logo-wrapper img {
	max-height: 80px;
	width: auto;
	object-fit: contain;
}

.fallback-logo {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--cor-primaria);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0;
}

.submit-title {
	font-size: 2.2rem;
	font-weight: 800;
	color: #404040;
	margin-bottom: 1rem;
}

.submit-subtitle {
	font-size: 1.1rem;
	color: #64748b;
	max-width: 600px;
	margin: 0 auto;
	line-height: 1.6;
}

/* --- STEPPER --- */
.submit-stepper {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2.5rem;
}

.step-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	position: relative;
	z-index: 2;
}

.step-number {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #fff;
	border: 2px solid #cbd5e1;
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.1rem;
	transition: all 0.3s ease;
}

.step-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: color 0.3s ease;
}

.step-line {
	height: 2px;
	background-color: #cbd5e1;
	width: 100px;
	margin: 0 15px;
	position: relative;
	top: -12px;
	z-index: 1;
	transition: background-color 0.3s ease;
}

/* Estados do Stepper */
.step-indicator.active .step-number {
	border-color: var(--cor-primaria);
	background-color: var(--cor-primaria);
	color: #fff;
	box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.step-indicator.active .step-label {
	color: var(--cor-primaria);
}

.step-indicator.completed .step-number {
	border-color: var(--cor-primaria);
	background-color: #fff;
	color: var(--cor-primaria);
}

.step-indicator.completed .step-label {
	color: var(--cor-primaria);
}

.step-indicator.completed + .step-line {
	background-color: var(--cor-primaria);
}

/* --- CARD DO FORMULÁRIO --- */
.submit-card {
	background: #fff;
	border-radius: 1rem;
	box-shadow:
		0 10px 25px -5px rgba(0, 0, 0, 0.05),
		0 8px 10px -6px rgba(0, 0, 0, 0.01);
	border: 1px solid #e2e8f0;
	padding: 2.5rem;
}

.submit-step {
	animation: fadeIn 0.4s ease-out;
}

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

/* --- ELEMENTOS DE FORMULÁRIO --- */
.form-group {
	margin-bottom: 1.5rem;
}

.form-label {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	color: #334155;
	margin-bottom: 0.5rem;
}

.required {
	color: #ef4444;
}

.form-control {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 0.95rem;
	color: #334155;
	background-color: #f9f9f9;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	transition: all 0.2s ease;
	outline: none;
	box-sizing: border-box;
	height: 48px;
}

textarea.form-control {
	height: auto;
	resize: vertical;
	min-height: 120px;
}

.form-control::placeholder {
	color: #94a3b8;
}

.form-control:focus {
	background-color: #fff;
	border-color: var(--cor-primaria);
	box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.input-with-icon {
	position: relative;
}

.input-with-icon input {
	border-radius: 0.85rem;
}

.input-with-icon i {
	position: absolute;
	left: 1rem;
	top: 24px;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 1.1rem;
	transition: color 0.2s ease;
	z-index: 10;
	pointer-events: none;
	line-height: 1;
}

.input-with-icon .form-control:focus + i,
.input-with-icon .form-control:focus ~ i {
	color: var(--cor-primaria);
}

.input-with-icon .form-control {
	padding-left: 2.8rem;
}

.input-group-doi {
	display: flex;
	gap: 0.5rem;
}

.input-group-doi .input-with-icon {
	width: 100%;
}

.input-group-doi .form-control {
	flex: 1;
}

.btn-doi {
	margin-top: 0 !important;
	padding: 0.75rem 1.25rem;
	white-space: nowrap;
}

.form-text {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.85rem;
	color: #64748b;
}

.form-divider {
	height: 1px;
	background-color: #e2e8f0;
	margin: 2rem 0;
}

/* --- REPEATER AUTORES --- */
.authors-section {
	background: #f9f9f9;
	padding: 1.5rem;
	border-radius: 0.75rem;
	border: 1px dashed #cbd5e1;
}

.authors-title {
	font-size: 1.2rem;
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 0.5rem 0;
}

.author-row {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	padding: 1.25rem;
	margin-top: 1.25rem;
	position: relative;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.author-grid {
	display: grid;
	grid-template-columns: 2fr 1.5fr 1fr;
	gap: 1rem;
}

.author-row .form-group {
	margin-bottom: 0;
}

.btn-remove-author {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #ef4444;
	color: white;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
	transition: transform 0.2s;
}

.btn-remove-author:hover {
	transform: scale(1.1);
	background: #dc2626;
}

.mt-3 {
	margin-top: 1rem;
}
.mt-4 {
	margin-top: 1.5rem;
}
.text-center {
	text-align: center;
}

/* --- BOTÕES --- */
.btn-submit-primary {
	background-color: var(--cor-primaria);
	color: #fff;
	border: none;
	border-radius: 0.5rem;
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition:
		background-color 0.2s,
		transform 0.1s;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.btn-submit-primary:hover {
	background-color: #ea580c; /* Tom mais escuro */
}

.btn-submit-primary:active {
	transform: scale(0.98);
}

.btn-submit-primary:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.btn-large {
	width: 100%;
	justify-content: center;
	padding: 1rem;
	font-size: 1.1rem;
}

.btn-submit-secondary {
	background-color: transparent;
	color: var(--cor-primaria);
	border: 2px solid var(--cor-primaria);
	border-radius: 0.5rem;
	padding: 0.6rem 1.2rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1rem;
	text-decoration: none;
}

.btn-submit-secondary:hover {
	background-color: var(--cor-primaria);
	color: #fff;
}

/* --- FEEDBACK & LOADING --- */
.submit-feedback {
	margin-top: 1.5rem;
	padding: 1rem;
	border-radius: 0.5rem;
	font-weight: 500;
	font-size: 0.95rem;
}

.feedback-error {
	background-color: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.feedback-success {
	background-color: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

/* --- ESTADOS DE VALIDAÇÃO --- */
.form-control.is-invalid {
	border-color: #ef4444 !important;
	background-color: #fef2f2 !important;
}

.form-control.is-invalid:focus {
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.invalid-feedback {
	display: none;
	color: #ef4444;
	font-size: 0.8rem;
	font-weight: 600;
	margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
	display: block;
}

/* --- SELECT2 CUSTOM STYLING --- */
.select2-container--default .select2-selection--single {
	height: 48px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 0.85rem !important;
	background-color: #f9f9f9 !important;
	display: flex;
	align-items: center;
	transition: all 0.2s ease;
}

.select2-container--default
	.select2-selection--single
	.select2-selection__rendered {
	line-height: 48px !important;
	padding-left: 2.8rem !important;
	color: #334155 !important;
	font-size: 0.95rem;
}

.select2-container--default
	.select2-selection--single
	.select2-selection__arrow {
	height: 46px !important;
	right: 10px !important;
}

.select2-container--default
	.select2-selection--single
	.select2-selection__placeholder {
	color: #94a3b8 !important;
}

.select2-container--default.select2-container--focus
	.select2-selection--single {
	background-color: #fff !important;
	border-color: var(--cor-primaria) !important;
	box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1) !important;
}

/* Estado Inválido para Select2 */
.is-invalid + .select2-container .select2-selection {
	border-color: #ef4444 !important;
	background-color: #fef2f2 !important;
}

.spin {
	animation: spin 1s linear infinite;
}

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

/* --- SUCESSO SCREEN --- */
.success-icon {
	font-size: 5rem;
	color: #22c55e;
	margin-bottom: 1rem;
}

#submit-step-success h2 {
	color: #1e293b;
	font-weight: 800;
	margin-bottom: 1rem;
}

#submit-step-success p {
	color: #475569;
	font-size: 1.1rem;
	line-height: 1.6;
}

.submit-footer-info {
	margin-top: 3rem;
	text-align: center;
	color: #94a3b8;
	font-size: 0.9rem;
	border-top: 1px solid #e2e8f0;
	padding-top: 2rem;
}

.submit-footer-info p {
	margin: 0.2rem 0;
}

.submit-footer-info strong {
	color: #64748b;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
	.author-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.submit-card {
		padding: 1.5rem;
	}

	.submit-stepper {
		flex-direction: column;
		gap: 1rem;
	}

	.step-line {
		width: 2px;
		height: 30px;
		margin: 0;
		top: 0;
	}
}

.spin {
	animation: spin 1s linear infinite;
	display: inline-block;
}

/* --- CLASSES UTILITÁRIAS (Refatoração Inline) --- */
.highlighted-box {
	background: #f9f9f9;
	padding: 1.5rem;
	border-radius: 0.5rem;
}

.doi-box {
	border: 1px dashed #94a3b8;
	margin-bottom: 2rem;
}

.solid-box {
	border: 1px solid #e2e8f0;
}

.mb-1-5 {
	margin-bottom: 1.5rem;
}
.mb-1 {
	margin-bottom: 1rem;
}
.mb-4 {
	margin-bottom: 2.5rem;
}

.grid-1-1 {
	grid-template-columns: 1fr 1fr;
}
.grid-1-1-1 {
	grid-template-columns: 1fr 1fr 1fr;
}
.grid-2-1 {
	grid-template-columns: 2fr 1fr;
}

.feedback-doi-text {
	color: #475569;
}

.text-optional {
	color: #64748b;
	font-weight: normal;
	font-size: 0.9rem;
}

.d-flex-start {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.mt-check {
	margin-top: 5px;
}

.check-text {
	font-size: 0.9rem;
	color: #334155;
	line-height: 1.4;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
	.submit-article-container {
		padding: 2rem 1.5rem;
		margin: 1.5rem auto;
	}

	.author-grid,
	.grid-1-1,
	.grid-2-1 {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.btn-submit-primary,
	.btn-submit-secondary {
		width: 100%;
		justify-content: center;
	}

	.input-group-doi {
		flex-direction: column;
	}

	.input-group-doi .btn-doi {
		width: 100%;
	}
}
