/* ==========================================================================
   fieldbox hub — estilos da área de cliente (login e pedido de acesso)
   ========================================================================== */
:root {
	--bg: #0b120f;
	--card: #111a15;
	--field: #0b120f;
	--line: rgba(255, 255, 255, 0.09);
	--line-strong: rgba(255, 255, 255, 0.16);
	--green: #87e64b;
	--green-hover: #7dd642;
	--green-soft: rgba(135, 230, 75, 0.14);
	--white: #ffffff;
	--text: #c9d3cd;
	--muted: #8e9a93;
	--danger: #f87171;
	--radius: 6px;
	--font: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background: var(--bg);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
	-webkit-font-smoothing: antialiased;
}

/* Fundo: brilho verde e grelha fina (mesma linguagem do site) */
body::before,
body::after {
	content: "";
	position: fixed;
	pointer-events: none;
	z-index: 0;
}

body::before {
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 65%);
	mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 65%);
}

body::after {
	left: 50%;
	top: 38%;
	width: 900px;
	height: 900px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(135, 230, 75, 0.12) 0%, rgba(135, 230, 75, 0) 62%);
}

a {
	color: var(--green);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Estrutura ---------- */
.hub-main {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	padding: 3rem 1.25rem;
}

.hub-card {
	width: 100%;
	max-width: 30rem;
	padding: 3rem 3rem 2.75rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: rgba(17, 26, 21, 0.88);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.hub-card--wide {
	max-width: 40rem;
}

.hub-logo {
	display: block;
	width: 160px;
	height: auto;
    margin-bottom: 3rem;
}

.hub-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 2.25rem;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: var(--green-soft);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--green);
}

.hub-badge::before {
	content: "";
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--green);
}

.hub-title {
	margin: 1rem 0 0;
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--white);
}

.hub-subtitle {
	margin: 0.6rem 0 0;
	font-size: 0.975rem;
	color: var(--muted);
}

/* ---------- Formulário ---------- */
.hub-form {
	margin-top: 2.25rem;
}

.hub-field+.hub-field,
.hub-row+.hub-field,
.hub-field+.hub-row,
.hub-row+.hub-row {
	margin-top: 1.35rem;
}

.hub-row {
	display: grid;
	gap: 1.35rem;
}

@media (min-width: 640px) {
	.hub-row {
		grid-template-columns: 1fr 1fr;
	}
}

.hub-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.55rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--white);
}

.hub-label small {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--muted);
}

.hub-input {
	display: block;
	width: 100%;
	padding: 0.95rem 1rem;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--field);
	font: inherit;
	font-size: 1rem;
	color: var(--white);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hub-input::placeholder {
	color: #5f6b64;
}

.hub-input:focus {
	outline: none;
	border-color: var(--green);
	box-shadow: 0 0 0 4px rgba(135, 230, 75, 0.15);
}

.hub-input[aria-invalid="true"] {
	border-color: var(--danger);
}

textarea.hub-input {
	min-height: 120px;
	resize: vertical;
}

select.hub-input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e9a93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 1.1rem;
	padding-right: 2.75rem;
}

/* Campo de palavra-passe com botão de mostrar/esconder */
.hub-password {
	position: relative;
}

.hub-password .hub-input {
	padding-right: 3.25rem;
}

.hub-eye {
	position: absolute;
	top: 50%;
	right: 0.6rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	transform: translateY(-50%);
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.hub-eye:hover {
	color: var(--white);
	background: rgba(255, 255, 255, 0.05);
}

.hub-eye svg {
	width: 1.2rem;
	height: 1.2rem;
}

.hub-eye .is-hidden {
	display: none;
}

/* Linha "lembrar-me" + "esqueceu" */
.hub-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 1.1rem;
	font-size: 0.875rem;
}

.hub-check {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	color: var(--text);
	cursor: pointer;
}

.hub-check input {
	width: 1.05rem;
	height: 1.05rem;
	margin: 0;
	accent-color: var(--green);
	cursor: pointer;
}

.hub-check--consent {
	align-items: flex-start;
	margin-top: 1.5rem;
	font-size: 0.85rem;
	line-height: 1.5;
}

.hub-check--consent input {
	flex: none;
	margin-top: 0.2rem;
}

/* Botões */
.hub-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	width: 100%;
	margin-top: 1.75rem;
	padding: 1rem 1.25rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--green);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #000;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	box-shadow: 0 10px 30px rgba(135, 230, 75, 0.18);
}

.hub-btn:hover {
	background: var(--green-hover);
}

.hub-btn:active {
	transform: translateY(1px);
}

.hub-btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.hub-btn svg {
	width: 1.1rem;
	height: 1.1rem;
}

/* Separador + ligação para a outra página */
.hub-switch {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 0.9rem;
	color: var(--muted);
}

.hub-switch a {
	font-weight: 700;
}

/* Mensagens */
.hub-alert {
	margin-top: 1.5rem;
	padding: 0.85rem 1rem;
	border-radius: var(--radius);
	font-size: 0.9rem;
}

.hub-alert--error {
	border: 1px solid rgba(248, 113, 113, 0.5);
	background: rgba(248, 113, 113, 0.08);
	color: #fca5a5;
}

.hub-alert--ok {
	border: 1px solid rgba(135, 230, 75, 0.5);
	background: var(--green-soft);
	color: #c8f5a8;
}

.hub-error {
	margin: 0.4rem 0 0;
	font-size: 0.8rem;
	color: var(--danger);
}

/* Ecrã de sucesso (pedido enviado) */
.hub-success {
	text-align: center;
}

.hub-success__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin: 2rem auto 0;
	border: 2px solid var(--green);
	border-radius: 50%;
	background: var(--green-soft);
	color: var(--green);
}

.hub-success__icon svg {
	width: 1.8rem;
	height: 1.8rem;
}

/* Rodapé */
.hub-footer {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.5rem;
	padding: 0 1.25rem 2rem;
	font-size: 0.8rem;
	color: #5f6b64;
}

.hub-footer a {
	color: var(--muted);
}

/* Telemóvel */
@media (max-width: 520px) {
	.hub-main {
		align-items: flex-start;
		padding: 1.5rem 1rem 2rem;
	}

	.hub-card {
		padding: 2rem 1.5rem;
		border-radius: 14px;
	}

	.hub-title {
		font-size: 1.6rem;
	}

	.hub-input {
		font-size: 16px;
		/* evita o zoom automático do iPhone */
	}
}

/* ==========================================================================
   Carregamento (preloader) — igual ao site
   ========================================================================== */
.hub-preloader {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hub-preloader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.hub-spinner {
	width: 2.5rem;
	height: 2.5rem;
	border: 4px solid #2a3a31;
	border-top-color: var(--green);
	border-radius: 50%;
	animation: hub-spin 0.8s linear infinite;
}

@keyframes hub-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Botão a enviar: spinner pequeno no lugar da seta */
.hub-btn.is-loading {
	pointer-events: none;
	opacity: 0.85;
}

.hub-btn.is-loading svg {
	display: none;
}

.hub-btn.is-loading::after {
	content: "";
	width: 1.05rem;
	height: 1.05rem;
	border: 2.5px solid rgba(0, 0, 0, 0.25);
	border-top-color: #000;
	border-radius: 50%;
	animation: hub-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {

	.hub-spinner,
	.hub-btn.is-loading::after {
		animation-duration: 2s;
	}
}


/* ==========================================================================
   Recuperação de palavra-passe
   ========================================================================== */
.hub-back {
	font-weight: 700;
}

.hub-hint {
	margin: 1.25rem 0 0;
	font-size: 0.875rem;
	color: var(--muted);
}

/* Requisitos da nova palavra-passe */
.hub-reqs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	color: var(--muted);
}

.hub-reqs li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	transition: color 0.2s ease;
}

.hub-reqs li::before {
	content: "";
	width: 0.9rem;
	height: 0.9rem;
	border: 1.5px solid #3a4a41;
	border-radius: 50%;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hub-reqs li.is-ok {
	color: var(--green);
}

.hub-reqs li.is-ok::before {
	border-color: var(--green);
	background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Sem sombras no cartão e no botão */
.hub-card {
	box-shadow: none;
}

.hub-btn,
.hub-btn:hover {
	box-shadow: none;
}

body::after {
	display: none;
}

/* Ecrãs de confirmação: etiqueta à esquerda, por baixo do logótipo */
.hub-success .hub-badge {
	display: flex;
	width: max-content;
	margin-top: 2.25rem;
	margin-right: auto;
}

.hub-success .hub-success__icon {
	margin-top: 1.75rem;
}

.hub-success {
	text-align: left;
}

.hub-success .hub-success__icon {
	margin-left: 0;
}

/* ==========================================================================
   Telemóvel: letras mais pequenas em todo o hub
   ========================================================================== */
@media (max-width: 520px) {
	body {
		font-size: 14px;
	}

	.hub-badge {
		margin-top: 1.75rem;
		padding: 0.25rem 0.65rem;
		font-size: 0.65rem;
	}

	.hub-title {
		margin-top: 0.85rem;
		font-size: 1.4rem;
	}

	.hub-subtitle {
		font-size: 0.875rem;
	}

	.hub-form {
		margin-top: 1.75rem;
	}

	.hub-label {
		margin-bottom: 0.45rem;
		font-size: 0.68rem;
	}

	.hub-label small {
		font-size: 0.65rem;
	}

	.hub-input {
		padding: 0.8rem 0.9rem;
		font-size: 16px;
		/* fica em 16 px: abaixo disto o iPhone faz zoom ao tocar no campo */
	}

	.hub-input::placeholder {
		font-size: 0.875rem;
	}

	.hub-options,
	.hub-check,
	.hub-check--consent {
		font-size: 0.8rem;
	}

	.hub-btn {
		margin-top: 1.5rem;
		padding: 0.85rem 1rem;
		font-size: 0.85rem;
	}

	.hub-switch {
		margin-top: 1.5rem;
		padding-top: 1.25rem;
		font-size: 0.825rem;
	}

	.hub-reqs {
		font-size: 0.72rem;
	}

	.hub-hint,
	.hub-error,
	.hub-alert {
		font-size: 0.8rem;
	}

	.hub-success__icon {
		width: 3.25rem;
		height: 3.25rem;
	}

	.hub-success__icon svg {
		width: 1.5rem;
		height: 1.5rem;
	}

	.hub-footer {
		font-size: 0.72rem;
	}
}
