/* =========================================================
   Afrizandu — Login & Register (Premium Edition)
   ========================================================= */

.afz-auth-wrapper,
.afz-auth-wrapper * {
	box-sizing: border-box;
}

.afz-auth-wrapper {
	--afz-orange: #f78e02;
	--afz-orange-dark: #dd7d00;
	--afz-ink: #1c160f;
	--afz-muted: #6b6258;
	--afz-cream: #fbf6ef;
	--afz-card: #ffffff;
	--afz-border: #ece3d6;

	position: relative;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--afz-ink);
	display: flex;
}

/* ---------- Background (only "full" style) ---------- */
.afz-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.afz-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background:
		radial-gradient(1100px 720px at 50% 32%, rgba(255,255,255,0.40), transparent 72%),
		linear-gradient(180deg, rgba(28,22,15,0.08) 0%, rgba(28,22,15,0.30) 100%);
}

/* Particles */
.afz-particles {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	overflow: hidden;
}

.afz-particle {
	position: absolute;
	border-radius: 50%;
	opacity: 0;
	animation: afzParticle linear infinite;
}

@keyframes afzParticle {
	0%   { opacity: 0;    transform: translateY(100vh) scale(0); }
	10%  { opacity: .55; }
	90%  { opacity: .15; }
	100% { opacity: 0;    transform: translateY(-10vh) scale(1.4); }
}

/* ---------- Page layout ---------- */
.afz-page {
	position: relative;
	z-index: 10;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(10px, 2.2vh, 24px) 16px;
	overflow: hidden;
}

.afz-style-minimal .afz-page {
	background: var(--afz-cream);
}

/* Header (logo + tagline) */
.afz-header {
	text-align: center;
	margin-bottom: clamp(8px, 1.6vh, 18px);
	animation: afzDown .7s ease both;
	flex-shrink: 0;
}

.afz-logo-img {
	height: clamp(38px, 6vh, 58px);
	width: auto;
	display: inline-block;
	filter: drop-shadow(0 6px 18px rgba(28,22,15,0.35));
}

.afz-tagline {
	margin: 8px 0 0;
	font-family: 'Sora', sans-serif;
	font-weight: 700;
	font-size: clamp(0.66rem, 1.6vw, 0.82rem);
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.96);
	text-shadow: 0 2px 10px rgba(28,22,15,0.55);
}

@keyframes afzDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes afzUp   { from { opacity: 0; transform: translateY(20px); }  to { opacity: 1; transform: none; } }

/* Language switch — segmented control, sliding indicator (configurável) */
.afz-lang-switch {
	--afz-lang-size: 11.5px;
	--afz-lang-active: var(--afz-orange);
	--afz-lang-text: rgba(255,255,255,0.85);
	--afz-lang-radius: 999px;
	position: relative;
	flex-shrink: 0;
	display: inline-flex;
	gap: 2px;
	background: rgba(255,255,255,0.16);
	border: 1px solid rgba(255,255,255,0.30);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: var(--afz-lang-radius);
	padding: 4px;
	margin-bottom: clamp(8px, 1.6vh, 16px);
	box-shadow: 0 6px 20px rgba(28,22,15,0.16), inset 0 1px 0 rgba(255,255,255,0.25);
}

.afz-style-minimal .afz-lang-switch {
	background: #fff;
	border: 1px solid var(--afz-border);
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	--afz-lang-text: var(--afz-muted);
}

/* Modificador: sem fundo/moldura — apenas texto + indicador */
.afz-lang-switch.afz-lang-nobg {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	padding: 0 !important;
	gap: 6px;
}

.afz-lang-slider {
	position: absolute;
	top: 4px;
	left: 4px;
	width: calc(50% - 4px);
	height: calc(100% - 8px);
	background: var(--afz-lang-active);
	border-radius: var(--afz-lang-radius);
	box-shadow: 0 3px 10px rgba(247,142,2,0.45);
	transition: transform .32s cubic-bezier(0.65, 0, 0.35, 1);
	z-index: 0;
}

.afz-lang-btn {
	position: relative;
	z-index: 1;
	border: none;
	background: transparent;
	cursor: pointer;
	font-family: 'Sora', sans-serif;
	font-size: var(--afz-lang-size);
	font-weight: 700;
	letter-spacing: 1px;
	color: var(--afz-lang-text);
	padding: 7px 18px;
	min-width: 52px;
	border-radius: var(--afz-lang-radius);
	transition: color .25s ease;
}

.afz-style-minimal .afz-lang-btn {
	color: var(--afz-lang-text);
}

.afz-lang-btn.is-active {
	color: #fff;
}

.afz-style-minimal .afz-lang-btn.is-active {
	color: #fff;
}

/* Variante: sublinhado — o "slider" vira uma barra fina por baixo do texto */
.afz-lang-switch.afz-lang-style-underline .afz-lang-slider {
	top: auto;
	bottom: 0;
	left: 0;
	height: 2px;
	width: 50%;
	border-radius: 2px;
	box-shadow: none;
	background: var(--afz-lang-active);
}

.afz-lang-switch.afz-lang-style-underline {
	padding-bottom: 6px;
}

.afz-lang-switch.afz-lang-style-underline .afz-lang-btn.is-active {
	color: var(--afz-lang-active);
}

.afz-style-minimal .afz-lang-switch.afz-lang-style-underline .afz-lang-btn.is-active {
	color: var(--afz-lang-active);
}

/* Variante: contorno — o indicador fica só com borda, sem preenchimento */
.afz-lang-switch.afz-lang-style-outline .afz-lang-slider {
	background: transparent;
	border: 1.5px solid var(--afz-lang-active);
	box-shadow: none;
}

.afz-lang-switch.afz-lang-style-outline .afz-lang-btn.is-active {
	color: var(--afz-lang-active);
}

.afz-style-minimal .afz-lang-switch.afz-lang-style-outline .afz-lang-btn.is-active {
	color: var(--afz-lang-active);
}

/* ---------- Card ---------- */
.afz-card {
	width: 100%;
	max-width: 420px;
	background: var(--afz-card);
	border: 1px solid var(--afz-border);
	border-radius: 22px;
	padding: clamp(16px, 2.6vh, 30px) clamp(20px, 3vw, 32px);
	box-shadow: 0 30px 70px -28px rgba(28,22,15,0.45);
	animation: afzUp .8s ease .1s both;
	overflow-y: auto;
	max-height: 100%;
	flex-shrink: 1;
}

.afz-style-minimal .afz-card {
	box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* Tabs */
.afz-tabs {
	display: flex;
	background: #f1efe9;
	border-radius: 12px;
	padding: 4px;
	margin-bottom: clamp(10px, 2vh, 20px);
}

.afz-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 9px 10px;
	font-family: 'Sora', sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--afz-muted);
	border-radius: 9px;
	cursor: pointer;
	transition: all .2s ease;
}

.afz-tab.is-active {
	background: #fff;
	color: var(--afz-ink);
	box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.afz-form {
	display: none;
}

.afz-form.is-active {
	display: block;
	animation: afzFadeIn .25s ease;
}

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

/* Badge */
.afz-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(247,142,2,0.10);
	border: 1px solid rgba(247,142,2,0.28);
	color: var(--afz-orange-dark);
	font-family: 'Sora', sans-serif;
	font-weight: 700;
	font-size: 0.66rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 999px;
	margin-bottom: 10px;
}

.afz-form-title {
	font-family: 'Sora', sans-serif;
	font-size: clamp(18px, 2.4vw, 23px);
	font-weight: 800;
	letter-spacing: -0.3px;
	color: var(--afz-ink);
	margin: 0 0 4px;
}

.afz-form-subtitle {
	font-size: 13px;
	color: var(--afz-muted);
	margin: 0 0 clamp(10px, 2vh, 18px);
	line-height: 1.5;
}

.afz-field {
	margin-bottom: clamp(8px, 1.6vh, 14px);
}

.afz-field-row {
	display: flex;
	gap: 12px;
}

.afz-field-row .afz-field {
	flex: 1;
}

.afz-field label {
	display: block;
	font-family: 'Sora', sans-serif;
	font-size: 12px;
	font-weight: 700;
	color: var(--afz-ink);
	margin-bottom: 5px;
}

.afz-field input[type="text"],
.afz-field input[type="email"],
.afz-field input[type="password"] {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--afz-border);
	border-radius: 12px;
	font-size: 14px;
	font-family: inherit;
	color: var(--afz-ink);
	background: #fffdfa;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.afz-field input:focus {
	outline: none;
	border-color: var(--afz-orange);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(247,142,2,0.16);
}

.afz-password-wrap {
	position: relative;
}

.afz-password-wrap input {
	padding-right: 42px;
}

.afz-toggle-pass {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	opacity: .55;
	line-height: 1;
}

.afz-row-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 4px 0 clamp(10px, 1.8vh, 16px);
	font-size: 12.5px;
}

.afz-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12.5px;
	color: var(--afz-muted);
	cursor: pointer;
	line-height: 1.45;
}

.afz-checkbox input {
	margin-top: 2px;
	accent-color: var(--afz-orange);
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

.afz-checkbox-terms {
	margin: 4px 0 clamp(8px, 1.6vh, 14px);
}

.afz-checkbox a {
	color: var(--afz-orange-dark);
	font-weight: 700;
	text-decoration: none;
}

.afz-checkbox a:hover {
	text-decoration: underline;
}

.afz-link-small {
	color: var(--afz-orange-dark);
	text-decoration: none;
	font-weight: 700;
}

.afz-link-small:hover {
	text-decoration: underline;
}

.afz-message {
	font-size: 13px;
	margin-bottom: 2px;
	min-height: 0;
}

.afz-message.is-error {
	color: #d92d20;
	background: #fef2f1;
	border: 1px solid #fbd5d1;
	padding: 8px 12px;
	border-radius: 10px;
	margin-bottom: 10px;
}

.afz-message.is-success {
	color: #067647;
	background: #ecfdf3;
	border: 1px solid #abefc6;
	padding: 8px 12px;
	border-radius: 10px;
	margin-bottom: 10px;
}

/* Primary button — required color #f78e02 */
.afz-btn-primary {
	width: 100%;
	background: var(--afz-orange);
	color: #fff;
	border: none;
	padding: 12px 16px;
	font-family: 'Sora', sans-serif;
	font-size: 14.5px;
	font-weight: 700;
	border-radius: 12px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background-color .2s ease, transform .12s ease, box-shadow .25s ease;
	box-shadow: 0 14px 30px -10px rgba(247,142,2,0.55);
}

.afz-btn-primary::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
	transition: left .5s ease;
}

.afz-btn-primary:not(:disabled):hover::before {
	left: 100%;
}

.afz-btn-primary:hover {
	background: var(--afz-orange-dark);
}

.afz-btn-primary:active {
	transform: scale(0.99);
}

.afz-btn-primary:disabled {
	opacity: .65;
	cursor: not-allowed;
}

.afz-btn-arrow {
	transition: transform .3s ease;
}

.afz-btn-primary:hover .afz-btn-arrow {
	transform: translateX(4px);
}

.afz-divider {
	display: flex;
	align-items: center;
	text-align: center;
	color: var(--afz-muted);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .4px;
	text-transform: uppercase;
	margin: clamp(10px, 1.8vh, 16px) 0;
}

.afz-divider::before,
.afz-divider::after {
	content: "";
	flex: 1;
	border-bottom: 1px solid var(--afz-border);
}

.afz-divider span {
	padding: 0 10px;
	white-space: nowrap;
}

.afz-social-row {
	display: flex;
	gap: 10px;
	margin-bottom: clamp(10px, 1.8vh, 16px);
}

.afz-social-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 9px;
	border: 1.5px solid var(--afz-border);
	background: #fffdfa;
	border-radius: 12px;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}

.afz-social-btn:hover {
	background: #f7f4ee;
	border-color: #d8ccb8;
	transform: translateY(-1px);
}

.afz-social-btn img {
	height: 18px;
	width: 18px;
}

.afz-switch-text {
	text-align: center;
	font-size: 12.5px;
	color: var(--afz-muted);
	margin: 0;
}

.afz-switch-link {
	color: var(--afz-orange-dark);
	font-weight: 700;
	text-decoration: none;
	margin-left: 4px;
}

.afz-switch-link:hover {
	text-decoration: underline;
}

/* Link "Voltar para a página inicial" */
.afz-back-home {
	display: block;
	text-align: center;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--afz-muted);
	text-decoration: none;
	transition: color .2s ease;
}

.afz-back-home:hover {
	color: var(--afz-orange-dark);
	text-decoration: underline;
}

/* Logótipo com hiperligação */
.afz-logo-link {
	display: inline-block;
	line-height: 0;
	cursor: pointer;
}

.afz-logo-link:hover .afz-logo-img {
	opacity: 0.92;
}

/* Seletor de idioma dentro do cartão (posição alternativa) */
.afz-lang-switch-card-top {
	display: flex;
	justify-content: center;
	margin-bottom: clamp(10px, 2vh, 18px);
}


.afz-verify-block {
	margin-bottom: clamp(10px, 1.8vh, 16px);
}

.afz-code-row {
	display: flex;
	gap: 10px;
}

.afz-code-row input {
	flex: 1;
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--afz-border);
	border-radius: 12px;
	font-size: 16px;
	letter-spacing: 4px;
	text-align: center;
	font-family: 'Sora', sans-serif;
	font-weight: 700;
	color: var(--afz-ink);
	background: #fffdfa;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.afz-code-row input:focus {
	outline: none;
	border-color: var(--afz-orange);
	box-shadow: 0 0 0 4px rgba(247,142,2,0.16);
}

.afz-btn-secondary-small {
	flex-shrink: 0;
	background: #fff;
	border: 1.5px solid var(--afz-border);
	color: var(--afz-orange-dark);
	font-family: 'Sora', sans-serif;
	font-weight: 700;
	font-size: 12px;
	padding: 0 14px;
	border-radius: 12px;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.afz-btn-secondary-small:hover {
	background: #fff6ec;
	border-color: var(--afz-orange);
}

.afz-btn-secondary-small:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* Footer */
.afz-footer {
	position: relative;
	z-index: 10;
	text-align: center;
	color: rgba(255,255,255,0.92);
	font-size: 11.5px;
	padding-top: clamp(6px, 1.4vh, 14px);
	text-shadow: 0 1px 6px rgba(28,22,15,0.5);
	animation: afzUp 1s ease .3s both;
	flex-shrink: 0;
}

.afz-footer p {
	margin: 0;
}

.afz-already-logged {
	max-width: 480px;
	margin: 80px auto;
	text-align: center;
	font-family: 'Plus Jakarta Sans', sans-serif;
}

/* =========================================================
   Responsividade — cabe sempre no ecrã, sem scroll
   ========================================================= */

@media (max-width: 480px) {
	.afz-card {
		padding: 14px 18px;
	}
	.afz-field-row {
		gap: 8px;
	}
	.afz-form-title {
		font-size: 18px;
	}
}

@media (max-height: 760px) {
	.afz-header { margin-bottom: 6px; }
	.afz-auth-wrapper.afz-hide-tagline-m .afz-tagline { display: none; }
	.afz-logo-img { height: 34px; }
	.afz-lang-switch { margin-bottom: 8px; }
	.afz-badge { margin-bottom: 6px; padding: 4px 10px; }
	.afz-form-title { font-size: 17px; margin-bottom: 2px; }
	.afz-form-subtitle { margin-bottom: 8px; font-size: 12px; }
	.afz-field { margin-bottom: 6px; }
	.afz-tabs { margin-bottom: 8px; }
	.afz-divider { margin: 6px 0; }
	.afz-social-row { margin-bottom: 6px; }
	.afz-auth-wrapper.afz-hide-footer-m .afz-footer { display: none; }
}

@media (max-height: 600px) {
	.afz-header { display: none; }
	.afz-lang-switch { margin-bottom: 6px; }
}

@media (max-width: 360px) {
	.afz-field-row { flex-direction: column; gap: 0; }
}

/* =========================================================
   Modo "Sem scroll" em mobile (afz-fit-compact)
   Comprime ainda mais o formulário para caber sempre no ecrã,
   sem depender do scroll interno do cartão. Ativado/desativado
   nas definições do plugin ("Ajuste ao ecrã em mobile").
   ========================================================= */

@media (max-height: 760px) {
	.afz-fit-compact .afz-badge { display: none; }
	.afz-fit-compact .afz-form-subtitle { display: none; }
	.afz-fit-compact .afz-card { padding: 12px 18px; }
	.afz-fit-compact .afz-field { margin-bottom: 5px; }
	.afz-fit-compact .afz-field input { padding: 8px 12px; font-size: 13.5px; }
	.afz-fit-compact .afz-row-between { margin: 2px 0 6px; }
	.afz-fit-compact .afz-tabs { margin-bottom: 6px; padding: 3px; }
	.afz-fit-compact .afz-tab { padding: 7px 8px; font-size: 12.5px; }
	.afz-fit-compact .afz-btn-primary { padding: 9px 16px; }
	.afz-fit-compact .afz-divider { margin: 5px 0; font-size: 10px; }
	.afz-fit-compact .afz-social-row { margin-bottom: 5px; }
	.afz-fit-compact .afz-social-btn { padding: 6px; }
	.afz-fit-compact .afz-switch-text { font-size: 11.5px; }
	.afz-fit-compact .afz-back-home { margin-top: 4px; font-size: 11px; }
	.afz-fit-compact .afz-lang-switch { margin-bottom: 6px; padding: 3px; }
}

@media (max-height: 640px) {
	.afz-fit-compact .afz-header { display: none; }
	.afz-fit-compact .afz-lang-switch { margin-bottom: 4px; }
	.afz-fit-compact .afz-form-title { font-size: 16px; margin-bottom: 0; }
	.afz-fit-compact .afz-checkbox-terms { margin: 2px 0 6px; }
	.afz-fit-compact .afz-verify-block { margin-bottom: 6px; }
}

@media (max-height: 560px) {
	.afz-fit-compact .afz-social-row { display: none; }
	.afz-fit-compact .afz-divider { display: none; }
}

