:root {
	--primary: #004d56; /* Ajustado pro Teal da Concept */
	--accent: #22d3ee;
	--background: #f8fafc;
	--surface: rgba(255, 255, 255, 0.8);
	--text-main: #1e293b;
	--text-muted: #64748b;
	--border-light: #e2e8f0;
	--error: #ef4444;
}

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

body {
	font-family: 'Inter', sans-serif;
	background-color: var(--background);
	background-image: radial-gradient(
		circle at top left,
		rgba(34, 211, 238, 0.03) 0%,
		transparent 40%
	);
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-main);
	font-size: 14px;
}

.auth-card {
	background: var(--surface);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	width: 100%;
	max-width: 350px;
	padding: 40px 32px;
	border-radius: 24px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
	display: flex;
	flex-direction: column;
	align-items: center;
	opacity: 0;
	transform: scale(0.98);
	animation: popUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes popUp {
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes shake {
	10%,
	90% {
		transform: translate3d(-1px, 0, 0);
	}
	20%,
	80% {
		transform: translate3d(2px, 0, 0);
	}
	30%,
	50%,
	70% {
		transform: translate3d(-3px, 0, 0);
	}
	40%,
	60% {
		transform: translate3d(3px, 0, 0);
	}
}

.brand-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 32px;
}
.logo {
	height: 30px;
	object-fit: contain;
	margin-bottom: 6px;
}
.hub-text {
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 10px;
	color: #b4905a;
	text-transform: uppercase;
	margin-left: 7px;
	margin-top: 5px;
}

h1 {
	font-size: 20px;
	font-weight: 500;
	margin-bottom: 6px;
	letter-spacing: -0.5px;
}
p.subtitle {
	font-size: 13px;
	color: var(--text-muted);
	margin-bottom: 32px;
	text-align: center;
}

/* FORMULÁRIO */
.input-group {
	width: 100%;
	margin-bottom: 16px;
	position: relative;
}
.input-control {
	width: 100%;
	height: 46px;
	background: rgba(241, 245, 249, 0.5);
	border: 1px solid var(--border-light);
	border-radius: 23px;
	padding: 18px 16px 4px 16px;
	font-size: 14px;
	color: var(--text-main);
	font-family: 'Inter', sans-serif;
	transition: all 0.2s ease;
}
.input-control:hover {
	border-color: #cbd5e1;
}
.input-control:focus {
	background: #ffffff;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(0, 77, 86, 0.1);
}

.input-label {
	position: absolute;
	left: 16px;
	top: 15px;
	font-size: 14px;
	color: #94a3b8;
	pointer-events: none;
	transition: 0.2s ease;
}

.input-control:focus + .input-label,
.input-control:not(:placeholder-shown) + .input-label {
	top: 6px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--primary);
}

.btn-primary {
	width: 100%;
	height: 46px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 23px;
	font-size: 13px;
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 1px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.2s ease;
	margin-top: 24px;
}
.btn-primary:hover {
	background: #00363d;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 77, 86, 0.2);
}
.btn-primary:active {
	transform: scale(0.98);
}
.btn-primary:disabled {
	background: #e2e8f0;
	color: #94a3b8;
	cursor: not-allowed;
	box-shadow: none;
}

.spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	display: none;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* LINKS DE APOIO (CRIAR CONTA / ESQUECI SENHA) */
.auth-links {
	width: 100%;
	display: flex;
	justify-content: space-between;
	margin-top: 18px;
	font-size: 12px;
	font-weight: 500;
}
.auth-links a {
	color: var(--primary);
	text-decoration: none;
	transition: 0.2s;
	cursor: pointer;
}
.auth-links a:hover {
	opacity: 0.7;
	text-decoration: underline;
}

.whatsapp-link {
	margin-top: 28px;
	font-size: 12px;
	color: var(--text-muted);
	text-decoration: none;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 20px;
	transition: all 0.2s ease;
}
.whatsapp-link:hover {
	color: #166534;
	background: rgba(37, 211, 102, 0.05);
}

.error-msg,
.success-msg {
	font-size: 12px;
	padding: 10px 14px;
	border-radius: 10px;
	display: none;
	align-items: center;
	gap: 6px;
	width: 100%;
	margin-bottom: 16px;
}
.error-msg {
	background: #fef2f2;
	color: var(--error);
	border: 1px solid #fee2e2;
}
.success-msg {
	background: #f0fdf4;
	color: #16a34a;
	border: 1px solid #dcfce7;
}

/* MODAIS */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.2);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 100;
	display: none;
	align-items: center;
	justify-content: center;
}
.modal-overlay.active {
	display: flex;
}
.modal-card {
	background: #fff;
	width: 90%;
	max-width: 320px;
	padding: 28px 24px;
	border-radius: 20px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
	animation: popIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
@keyframes popIn {
	from {
		transform: scale(0.9) translateY(10px);
		opacity: 0;
	}
	to {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}
.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}
.close-btn {
	background: #f1f5f9;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted);
	transition: 0.2s;
}
.close-btn:hover {
	background: #e2e8f0;
	color: var(--text-main);
}

/* ========================================================
   SMART COMBOBOX (APPLE + GOOGLE STYLE)
   ======================================================== */
.combo-chevron {
	position: absolute;
	right: 16px;
	top: 15px;
	color: #94a3b8;
	pointer-events: none; /* Deixa o clique passar para o input */
	transition:
		transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
		color 0.3s ease;
}

/* Quando o input é focado ou a gaveta está aberta, a setinha gira e pinta com a cor primária */
#company-wrapper.dropdown-open .combo-chevron,
.input-control:focus ~ .combo-chevron {
	transform: rotate(180deg);
	color: var(--primary);
}

.apple-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	width: 100%;
	/* Efeito de vidro Apple */
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	z-index: 1000;
	max-height: 220px;
	overflow-y: auto;
	padding: 6px 0;

	/* Animação de surgimento físico */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px) scale(0.98);
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#company-wrapper.dropdown-open .apple-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.apple-dropdown::-webkit-scrollbar {
	width: 6px;
}
.apple-dropdown::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

.apple-dropdown-item {
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text-main);
	cursor: pointer;
	transition:
		background 0.2s,
		color 0.2s;
	display: flex;
	align-items: center;
	gap: 10px;
}

.apple-dropdown-item:hover {
	background: rgba(0, 77, 86, 0.06); /* Fundo Teal super claro */
	color: var(--primary);
}

/* Design para a opção de "Adicionar Nova" */
.apple-dropdown-item.create-new {
	color: var(--primary);
	font-weight: 600;
	border-top: 1px solid var(--border-light);
	margin-top: 4px;
	padding-top: 10px;
}

.apple-dropdown-empty {
	padding: 16px;
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
	font-style: italic;
}

/* Cabeçalho instrutivo dentro da gaveta */
.apple-dropdown-hint {
	padding: 10px 16px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #94a3b8;
	background: rgba(241, 245, 249, 0.5);
	border-bottom: 1px solid var(--border-light);
	margin-top: -6px;
	margin-bottom: 4px;
	border-radius: 14px 14px 0 0;
}

/* Ajuste no item de criar para comportar título e subtítulo */
.apple-dropdown-item.create-new {
	border-top: 1px solid var(--border-light);
	margin-top: 4px;
	padding-top: 12px;
	padding-bottom: 12px;
	align-items: flex-start;
}

/* ========================================================
   MARCADOR DE OBRIGATÓRIO (DIREITA / STATUS APPLE)
   ======================================================== */

.req-dot {
	position: absolute;
	right: 20px; /* Alinhamento perfeito à direita */
	top: 20px; /* Centralizado verticalmente no input de 46px */
	width: 6px; /* Um tiquinho maior para dar presença sozinho */
	height: 6px;
	background-color: #ff3b30;
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
	pointer-events: none; /* O clique passa direto por ela */
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	z-index: 2;
}

/* A MÁGICA: Se o campo tem o 'required' no HTML e foi preenchido, a bolinha some! */
.input-control:valid ~ .req-dot {
	opacity: 0;
	transform: scale(0);
}

/* Mantemos a Dica invisível animada para a Empresa */
.input-hint {
	font-size: 0.85em;
	font-weight: 400;
	color: #94a3b8;
	text-transform: none;
	letter-spacing: normal;
	margin-left: 6px;
	opacity: 0.7;
	transition: all 0.2s ease;
}

.input-control:focus + .input-label .input-hint,
.input-control:not(:placeholder-shown) + .input-label .input-hint {
	opacity: 0;
	visibility: hidden;
	font-size: 0;
	margin-left: 0;
}

/* ========================================================
   REVELADOR DE SENHA (TOGGLE PASSWORD)
   ======================================================== */
.toggle-password {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		color 0.2s ease,
		transform 0.2s ease;
	z-index: 3;
}

.toggle-password:hover {
	color: var(--primary);
	transform: translateY(-50%) scale(1.05);
}

/* Protege o texto de passar por cima do ícone do olho */
.input-group.has-toggle .input-control {
	padding-right: 46px;
}

/* Se o campo tiver olho E for obrigatório, empurra a bolinha pro lado */
.input-group.has-toggle .req-dot {
	right: 46px;
}
