/* Popup de avaliação — wizard (passos na lateral + formulário) */
.atl-wz {
	--wz-navy: var(--atl-navy, #0d1d33);
	--wz-cream: var(--atl-cream, #fafaf5);
	--wz-sand: var(--atl-sand, #e8e7d1);
	--wz-accent: var(--atl-accent, #a98a63);
	--wz-accent-dark: #7a5f3b;
	--wz-field: rgba(13, 29, 51, 0.055);

	position: fixed;
	inset: 0;
	width: min(62rem, calc(100vw - 2rem));
	max-width: none;
	height: min(42rem, calc(100dvh - 2rem));
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--wz-navy);
	font-family: var(--atl-font-body, "Lato", sans-serif);
	box-shadow: 0 40px 90px -30px rgba(13, 29, 51, 0.6);
	overflow: hidden;
	z-index: 100001;
}

.atl-wz:not([open]) { display: none; }

.atl-wz::backdrop {
	background: rgba(13, 29, 51, 0.55);
	backdrop-filter: blur(6px);
	animation: wz-fade 0.4s ease both;
}

.atl-wz[open] { animation: wz-pop 0.55s cubic-bezier(0.22, 0.8, 0.2, 1) both; }
.atl-wz.is-closing { animation: wz-out 0.3s ease both; pointer-events: none; }
.atl-wz.is-closing::backdrop { animation: wz-fade-out 0.3s ease both; }

@keyframes wz-pop { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
@keyframes wz-out { to { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes wz-fade { from { opacity: 0; } }
@keyframes wz-fade-out { to { opacity: 0; } }

.atl-wz__shell {
	display: grid;
	grid-template-columns: 20rem minmax(0, 1fr);
	height: 100%;
}

/* ---- Lateral: título, texto e passos ---- */
.atl-wz__side {
	display: flex;
	flex-direction: column;
	margin: 2.5rem 0;
	padding: 0 2.25rem 0 2.75rem;
	border-right: 1px solid rgba(13, 29, 51, 0.12);
}

.atl-wz__brand {
	margin: 0 0 0.9rem;
	font-family: var(--atl-font-heading, "Playfair Display", serif);
	font-size: 2.1rem;
	font-weight: 400;
	line-height: 1.12;
	color: var(--wz-navy);
}

.atl-wz__brand em { font-style: italic; color: var(--wz-accent-dark); }

.atl-wz__note {
	margin: 0 0 2.25rem;
	font-size: 0.9rem;
	line-height: 1.65;
	opacity: 0.72;
}

.atl-wz__nav {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* linha vertical a ligar os círculos */
.atl-wz__nav::before {
	content: "";
	position: absolute;
	top: 1rem;
	bottom: 1rem;
	left: 1rem;
	width: 2px;
	background: rgba(13, 29, 51, 0.12);
}

.atl-wz__nav li { position: relative; margin: 0; }

.atl-wz__nav button {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wz-navy);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	text-align: left;
	cursor: default;
}

.atl-wz__nav li.is-done button { cursor: pointer; }
.atl-wz__nav button:disabled { opacity: 1; }

.atl-wz__dot {
	position: relative;
	z-index: 1;
	display: grid;
	flex: none;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border: 2px solid rgba(13, 29, 51, 0.15);
	border-radius: 50%;
	background: #fff;
	font-size: 0.85rem;
	transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}

.atl-wz__dot svg { display: none; }

.atl-wz__nav li.is-current .atl-wz__dot { border-color: var(--wz-accent); color: var(--wz-accent-dark); transform: scale(1.08); }
.atl-wz__nav li.is-current .atl-wz__label { color: var(--wz-accent-dark); }

.atl-wz__nav li.is-done .atl-wz__dot { border-color: var(--wz-navy); background: var(--wz-navy); color: #fff; }
.atl-wz__nav li.is-done .atl-wz__dot b { display: none; }
.atl-wz__nav li.is-done .atl-wz__dot svg { display: block; }

/* ---- Principal ---- */
.atl-wz__main {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.atl-wz__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wz-navy);
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s, transform 0.3s;
}

.atl-wz__close:hover { opacity: 1; transform: rotate(90deg); }

.atl-wz__form {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.atl-wz__form[hidden] { display: none; }

.atl-wz__steps {
	flex: 1 1 auto;
	min-height: 0;
	padding: 2.75rem 3rem 1rem 3rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.atl-wz__step { display: none; }
.atl-wz__step.is-active { display: block; animation: wz-in-right 0.45s cubic-bezier(0.22, 0.8, 0.2, 1) both; }
.atl-wz__step.is-active.from-left { animation-name: wz-in-left; }

@keyframes wz-in-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes wz-in-left { from { opacity: 0; transform: translateX(-28px); } }

.atl-wz__title {
	margin: 0 0 1.6rem;
	font-family: var(--atl-font-heading, "Playfair Display", serif);
	font-size: clamp(1.5rem, 2.6vw, 1.9rem);
	font-weight: 400;
	line-height: 1.15;
	color: var(--wz-navy);
}

.atl-wz__sub {
	margin: 1.6rem 0 0.7rem;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--wz-navy);
}

/* Pills */
.atl-wz__pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.atl-wz__pill { position: relative; cursor: pointer; }

.atl-wz__pill input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.atl-wz__pill span {
	display: inline-block;
	padding: 0.65rem 1.05rem;
	border: 1px solid transparent;
	background: var(--wz-field);
	font-size: 0.9rem;
	line-height: 1.2;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.atl-wz__pill:hover span { border-color: var(--wz-navy); }

.atl-wz__pill input:checked + span {
	border-color: var(--wz-navy);
	background: var(--wz-navy);
	color: #fff;
}

.atl-wz__pill input:focus-visible + span { outline: 2px solid var(--wz-accent); outline-offset: 2px; }

.atl-wz__pills--lg .atl-wz__pill span { padding: 0.9rem 1.5rem; font-size: 0.98rem; }
.atl-wz__pills--sm .atl-wz__pill span { min-width: 3rem; padding: 0.6rem 0.75rem; text-align: center; }

/* Campos preenchidos, etiqueta por cima */
.atl-wz__field { display: block; margin: 0 0 1.1rem; }

.atl-wz__field > span {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.82rem;
	font-weight: 700;
}

.atl-wz__field > span i {
	font-style: normal;
	font-weight: 400;
	opacity: 0.45;
}

.atl-wz__field input,
.atl-wz__field textarea {
	display: block;
	width: 100%;
	padding: 0.8rem 0.9rem;
	border: 1px solid transparent;
	border-radius: 0;
	background: var(--wz-field);
	color: var(--wz-navy);
	font: inherit;
	font-size: 0.95rem;
	box-shadow: none;
	transition: border-color 0.2s, background 0.2s;
}

.atl-wz__field input::placeholder,
.atl-wz__field textarea::placeholder { color: rgba(13, 29, 51, 0.38); }

.atl-wz__field input:focus,
.atl-wz__field textarea:focus {
	outline: 0;
	border-color: var(--wz-accent);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(169, 138, 99, 0.18);
}

.atl-wz__field textarea { resize: none; height: 5.25rem; min-height: 0; }

.atl-wz__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }

.atl-wz__hint { margin: -0.2rem 0 0; font-size: 0.82rem; opacity: 0.55; }

.atl-wz__consent {
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
	margin-top: 0.4rem;
	font-size: 0.8rem;
	line-height: 1.5;
	cursor: pointer;
}

.atl-wz__consent input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; accent-color: var(--wz-navy); }
.atl-wz__consent a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }

.atl-wz__err { margin: 1rem 0 0; padding: 0.6rem 0.8rem; background: rgba(160, 40, 40, 0.08); color: #8a2a2a; font-size: 0.85rem; }
.atl-wz__err[hidden] { display: none; }

.atl-wz__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Botões em baixo à direita */
.atl-wz__foot {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1rem 3rem 2rem;
}

.atl-wz__back,
.atl-wz__next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.85rem 1.4rem;
	border-radius: 0;
	font: inherit;
	font-size: 0.88rem;
	cursor: pointer;
	transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.atl-wz__back {
	border: 1px solid rgba(13, 29, 51, 0.25);
	background: #fff;
	color: var(--wz-navy);
}

.atl-wz__back:hover { border-color: var(--wz-navy); }

.atl-wz__next {
	border: 1px solid var(--wz-navy);
	background: var(--wz-navy);
	color: #fff;
}

.atl-wz__next:hover { background: var(--wz-accent-dark); border-color: var(--wz-accent-dark); }
.atl-wz__next[hidden] { display: none; }
.atl-wz__submit.is-loading { opacity: 0.6; pointer-events: none; }

/* Sucesso */
.atl-wz__done {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 3rem 3rem;
	text-align: center;
	animation: wz-in-right 0.5s ease both;
}

.atl-wz__done[hidden] { display: none; }
.atl-wz__done .atl-wz__title { margin-bottom: 1rem; }
.atl-wz__done p { max-width: 26rem; margin: 0 0 1.75rem; line-height: 1.65; opacity: 0.8; }

.atl-wz__art {
	width: min(15rem, 60%);
	height: auto;
	margin-bottom: 1.5rem;
	color: var(--wz-navy);
}

/* Telemóvel: ecrã inteiro, passos em linha no topo */
@media (max-width: 820px) {
	.atl-wz {
		width: 100vw;
		height: 100dvh;
		max-width: 100vw;
		box-shadow: none;
	}

	.atl-wz__shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }

	.atl-wz__side {
		margin: 0;
		padding: calc(env(safe-area-inset-top, 0px) + 1.1rem) 4rem 0.9rem 1.25rem;
		border-right: 0;
		border-bottom: 1px solid rgba(13, 29, 51, 0.1);
	}

	.atl-wz__brand,
	.atl-wz__note { display: none; }

	.atl-wz__nav { flex-direction: row; align-items: center; gap: 0; }

	.atl-wz__nav::before { top: 50%; bottom: auto; left: 1rem; right: 1rem; width: auto; height: 2px; transform: translateY(-50%); }

	.atl-wz__nav li { flex: 1; }
	.atl-wz__nav li:last-child { flex: none; }
	.atl-wz__nav .atl-wz__label { display: none; }
	.atl-wz__nav li.is-current .atl-wz__label { display: none; }

	.atl-wz__close { top: calc(env(safe-area-inset-top, 0px) + 0.35rem); right: 0.4rem; }

	.atl-wz__main { position: static; }

	.atl-wz__steps { padding: 1.5rem 1.25rem 1rem; }

	.atl-wz__foot { padding: 0.75rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1rem); }

	.atl-wz__next { flex: 1; }

	.atl-wz__row { grid-template-columns: minmax(0, 1fr); }

	.atl-wz__field input,
	.atl-wz__field textarea { font-size: 1rem; }

	.atl-wz__done { padding: 1rem 1.25rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
	.atl-wz, .atl-wz::backdrop, .atl-wz__step.is-active, .atl-wz__done { animation: none !important; }
}
