/* ==========================================================================
   AVM Paisagismo · validador.css — página /projeto/
   Tela única (100dvh), topo fixo, conversa rolável e respostas embaixo.
   ========================================================================== */

:root {
	--floresta: #244D35;
	--musgo: #3F6B4E;
	--salvia: #A9B9A0;
	--areia: #EFE9DF;
	--off: #FAF8F3;
	--terracota: #C27C55;
	--noite: #0E1A14;
	--luz: #F3C77A;
	--ink: #1D2B23;
	--ink-soft: #4A5A50;
	--f-display: "Cormorant Garamond", "Times New Roman", serif;
	--f-text: "Jost", system-ui, sans-serif;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.validador {
	margin: 0;
	background: url("../img/textura-areia.webp") repeat var(--off);
	background-size: 700px;
	background-blend-mode: multiply;
	color: var(--ink);
	font-family: var(--f-text);
	font-size: 1.0625rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
}
button, input { font: inherit; color: inherit; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--terracota); outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.val {
	position: relative;
	height: 100vh;
	height: 100dvh;
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	isolation: isolate;
}
.val__deco {
	position: fixed;
	right: -60px; bottom: -40px;
	width: min(70vw, 460px);
	height: auto;
	opacity: .32;
	z-index: -1;
	pointer-events: none;
}

/* ---------- Topo ---------- */
.val-top {
	flex: none;
	padding: calc(10px + var(--safe-t)) 16px 0;
	background: rgba(250, 248, 243, .94);
	backdrop-filter: blur(10px);
	box-shadow: 0 1px 0 rgba(36, 77, 53, .1);
	position: relative;
	z-index: 2;
}
.val-top__in { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.val-top__home { text-decoration: none; flex: none; }
.avatar {
	position: relative;
	width: 48px; height: 48px;
	border-radius: 50%;
	background: var(--floresta);
	color: #fff;
	display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar__mono { font-family: var(--f-display); font-size: 1.3rem; letter-spacing: .04em; }
.avatar__dot {
	position: absolute; right: 0; bottom: 1px;
	width: 13px; height: 13px; border-radius: 50%;
	background: #3BB36B;
	border: 2px solid var(--off);
}
.val-top__who { min-width: 0; flex: 1; }
.val-top__name { font-weight: 500; font-size: 1.0625rem; line-height: 1.25; }
.val-top__status { font-weight: 400; font-size: .875rem; color: var(--musgo); margin-left: 4px; }
.val-top__brand { font-size: .9375rem; color: var(--ink-soft); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.val-back {
	flex: none;
	display: inline-flex; align-items: center; gap: 4px;
	min-height: 48px; padding: 0 10px 0 6px;
	border: 0; background: transparent;
	color: var(--musgo);
	font-size: 1rem;
	cursor: pointer;
	border-radius: 999px;
}
.val-back[hidden] { display: none; }
.val-back:hover { background: rgba(169, 185, 160, .25); }
.val-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Barra de progresso: um caule fino que cresce, com uma folha na ponta */
.val-progress { position: relative; height: 18px; margin: 4px 2px 0; --p: 0%; }
.val-progress::before {
	content: ""; position: absolute; left: 0; right: 0; top: 50%;
	height: 1px; background: rgba(169, 185, 160, .5);
}
.val-progress__stem {
	position: absolute; left: 0; top: 50%;
	height: 2px; margin-top: -.5px;
	width: var(--p);
	background: var(--musgo);
	border-radius: 2px;
	transition: width 1s var(--ease);
}
.val-progress__leaf {
	position: absolute; top: 50%;
	left: var(--p);
	width: 16px; height: 16px;
	margin: -14px 0 0 -3px;
	fill: var(--salvia); stroke: var(--floresta); stroke-width: 1.4; stroke-linecap: round;
	transition: left 1s var(--ease);
}

/* ---------- Conversa ---------- */
.val-chat {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 20px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	-webkit-overflow-scrolling: touch;
}
.msg {
	max-width: 86%;
	padding: 12px 16px;
	border-radius: 20px;
	font-size: 1.0625rem;
	line-height: 1.5;
	word-wrap: break-word;
}
.msg--bot {
	align-self: flex-start;
	background: #fff;
	border-bottom-left-radius: 6px;
	box-shadow: 0 10px 30px -14px rgba(14, 26, 20, .22), 0 2px 6px -3px rgba(14, 26, 20, .08);
}
.msg--me {
	align-self: flex-end;
	background: var(--floresta);
	color: #fff;
	border-bottom-right-radius: 6px;
}
.msg--in { animation: msg-in .6s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg--typing { display: inline-flex; gap: 5px; align-items: center; padding: 16px 18px; }
.msg--typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--salvia); animation: dot 1.1s infinite ease-in-out; }
.msg--typing span:nth-child(2) { animation-delay: .15s; }
.msg--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Respostas ---------- */
.val-dock {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px 16px 10px;
	max-height: 62vh;
	max-height: 62dvh;
	overflow-y: auto;
}
.val-dock:empty { padding: 0; }
.pill {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%;
	min-height: 52px;
	padding: 10px 20px;
	border: 1.5px solid var(--salvia);
	border-radius: 999px;
	background: rgba(255, 255, 255, .85);
	color: var(--floresta);
	font-size: 1.0625rem;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	animation: msg-in .5s var(--ease) both;
	transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.val-dock--choices .pill:nth-child(2) { animation-delay: .05s; }
.val-dock--choices .pill:nth-child(3) { animation-delay: .1s; }
.val-dock--choices .pill:nth-child(4) { animation-delay: .15s; }
.val-dock--choices .pill:nth-child(5) { animation-delay: .2s; }
.pill:hover { border-color: var(--musgo); }
.pill:active, .pill.is-picked { background: var(--floresta); border-color: var(--floresta); color: #fff; transform: scale(.985); }
.pill--go, .pill--wa { background: var(--floresta); border-color: var(--floresta); color: #fff; }
.pill--go:hover, .pill--wa:hover { background: var(--musgo); border-color: var(--musgo); }
.pill--go:disabled { opacity: .45; cursor: not-allowed; }
.pill--soft { background: transparent; border-color: transparent; color: var(--musgo); font-weight: 400; min-height: 48px; }
.pill--soft:hover { border-color: var(--salvia); }
.pill--wa svg { width: 22px; height: 22px; }

.val-form { display: flex; gap: 8px; }
.val-input {
	flex: 1; min-width: 0;
	min-height: 52px;
	padding: 0 20px;
	border: 1.5px solid var(--salvia);
	border-radius: 999px;
	background: #fff;
	font-size: 1.0625rem;
	color: var(--ink);
	outline: none;
	transition: border-color .3s;
}
.val-input:focus { border-color: var(--floresta); }
.val-input.is-error { border-color: var(--terracota); }
.val-send {
	flex: none;
	min-height: 52px; padding: 0 22px;
	border: 0; border-radius: 999px;
	background: var(--floresta); color: #fff;
	font-weight: 500;
	cursor: pointer;
}
.val-send:hover { background: var(--musgo); }

/* Cards da pergunta de desejos (múltipla escolha) */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card {
	position: relative;
	display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
	min-height: 78px;
	padding: 10px 12px;
	border: 1.5px solid var(--salvia);
	border-radius: 18px;
	background: rgba(255, 255, 255, .9);
	color: var(--ink);
	text-align: left;
	font-size: 1rem;
	line-height: 1.3;
	cursor: pointer;
	animation: msg-in .5s var(--ease) both;
	transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
.card .v-icon { width: 30px; height: 30px; color: var(--musgo); }
.card__check {
	position: absolute; top: 10px; right: 10px;
	width: 22px; height: 22px;
	stroke-width: 2.4;
	opacity: 0;
	transition: opacity .3s;
}
.card.is-on { background: var(--floresta); border-color: var(--floresta); color: #fff; }
.card.is-on .v-icon { color: var(--luz); }
.card.is-on .card__check { opacity: 1; }

/* ---------- Rodapé mínimo ---------- */
.val-foot {
	flex: none;
	padding: 4px 16px calc(8px + var(--safe-b));
	text-align: center;
	font-size: .875rem;
	line-height: 1.5;
	color: var(--ink-soft);
}
.val-foot a { color: var(--musgo); }

@media (min-width: 720px) {
	.val-chat { padding: 28px 24px 16px; }
	.val-dock { padding: 10px 24px 12px; }
	.val-dock--choices { display: grid; grid-template-columns: 1fr 1fr; }
	.cards { grid-template-columns: repeat(4, 1fr); }
	.msg { max-width: 76%; }
	.val-top { padding-inline: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
