/* ════════════════════════════════════════════════════════
   editar-gestor.css
   Modal de edição de gestor.
   Depende de variables.css e dos tokens do template.css
   (--card, --background, --border, --muted,
    --muted-foreground, --white-color, --bv-gradient,
    --custom-btn-bg-color, --radius).
════════════════════════════════════════════════════════ */

/* ── OVERLAY ─────────────────────────────────────────── */
.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;

	/* Estado fechado */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease;
}

.modal-overlay.open {
	opacity: 1;
	pointer-events: all;
}

/* ── CAIXA DO MODAL ──────────────────────────────────── */
.modal-box {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	width: 100%;
	max-width: 560px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

	/* Estado fechado */
	transform: translateY(24px) scale(0.97);
	transition:
		transform 0.25s ease,
		opacity 0.22s ease;
	opacity: 0;
}

.modal-overlay.open .modal-box {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* ── CABEÇALHO ───────────────────────────────────────── */
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px 18px;
	border-bottom: 1px solid var(--border);
}

.modal-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--white-color);
	margin: 0;
}

.modal-close-btn {
	width: 34px;
	height: 34px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--muted);
	color: var(--muted-foreground);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.18s,
		border-color 0.18s,
		color 0.18s;
	flex-shrink: 0;
}

.modal-close-btn:hover {
	background: rgba(255, 0, 77, 0.1);
	border-color: var(--custom-btn-bg-color);
	color: var(--custom-btn-bg-color);
}

/* ── FORMULÁRIO ──────────────────────────────────────── */
.modal-form {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Linha com dois campos lado a lado */
.modal-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

/* Campo individual */
.modal-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.modal-field label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted-foreground);
}

/* Input e Select compartilham o mesmo visual */
.modal-input {
	background: var(--background);
	border: 1.5px solid var(--border);
	border-radius: 10px;
	color: var(--white-color);
	font-family: inherit;
	font-size: 0.9rem;
	padding: 10px 14px;
	transition:
		border-color 0.18s,
		box-shadow 0.18s;
	outline: none;
	width: 100%;
}

.modal-input::placeholder {
	color: var(--muted-foreground);
	opacity: 0.7;
}

.modal-input:focus {
	border-color: var(--custom-btn-bg-color);
	box-shadow: 0 0 0 3px rgba(255, 0, 77, 0.12);
}

.modal-input.invalid {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Select — remove aparência nativa e adiciona seta customizada */
.modal-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
	cursor: pointer;
}

/* Opções do select no dark mode */
.modal-select option {
	background: var(--card);
	color: var(--white-color);
}

/* Mensagem de erro inline */
.modal-error {
	font-size: 0.72rem;
	color: #ef4444;
	font-weight: 500;
	min-height: 16px;
	display: block;
}

/* ── RODAPÉ ──────────────────────────────────────────── */
.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 6px;
}

.modal-btn {
	border: none;
	padding: 10px 22px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition:
		opacity 0.18s,
		transform 0.18s,
		box-shadow 0.18s;
	display: flex;
	align-items: center;
	gap: 7px;
}

.modal-btn:hover {
	opacity: 0.88;
	transform: translateY(-1px);
}

.modal-btn.cancel {
	background: var(--muted);
	color: var(--muted-foreground);
	border: 1px solid var(--border);
}

.modal-btn.cancel:hover {
	background: var(--border);
	color: var(--white-color);
	opacity: 1;
}

.modal-btn.save {
	background: var(--bv-gradient);
	color: #fff;
	box-shadow: 0 2px 10px rgba(255, 0, 77, 0.3);
}

.modal-btn.save:hover {
	box-shadow: 0 4px 16px rgba(255, 0, 77, 0.45);
	opacity: 1;
}

/* ── RESPONSIVO ──────────────────────────────────────── */
@media (max-width: 520px) {
	.modal-row {
		grid-template-columns: 1fr;
	}

	.modal-form {
		padding: 18px 16px;
	}

	.modal-header {
		padding: 18px 16px 14px;
	}

	.modal-footer {
		flex-direction: column-reverse;
	}

	.modal-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ── DARK MODE ───────────────────────────────────────── */
body.dark-mode .modal-box {
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .modal-input:focus {
	box-shadow: 0 0 0 3px rgba(255, 0, 77, 0.2);
}