/* =====================================================================
   VW Collection | Promoção Vale+ Chilli Beans
   Arquivo: /arquivos/up-cb-landing.css
   Todo o CSS fica preso em .up-cb para não afetar o tema da loja.
   Medidas de referência: Figma 1440px (desktop) e 412px (mobile).
   ===================================================================== */

.up-cb {
	--cb-bg: #6083B2;
	--cb-card: #5ECBF4;
	--cb-navy: #061A5E;
	--cb-white: #FFFFFF;
	--cb-error: #D93B3B;
	--cb-error-soft: #FDECEC;
	--cb-error-line: #F2A7A7;
	--cb-font: VWHead, Helvetica, Arial, sans-serif;

	position: relative;
	clear: both;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: var(--cb-bg);
	font-family: var(--cb-font);
	font-weight: 400;
	color: var(--cb-white);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

/* Trava de pré-visualização: nada aparece até o JS liberar */
.up-cb:not(.is-ready) { visibility: hidden; }

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

.up-cb :where(h1, h2, h3, p, label, ul, li, form, fieldset, legend) {
	margin: 0;
	padding: 0;
	border: 0;
	font: inherit;
	color: inherit;
	letter-spacing: 0;
	text-transform: none;
}

/* Imagem de fundo: sempre alinhada à base (degradês já aplicados no arquivo) */
.up-cb::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
	width: 100%;
	aspect-ratio: 1440 / 810;
	background: url("/arquivos/up-cb-bg-desktop.jpg?v=1") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}

.up-cb__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 200px;
	grid-template-areas:
		"logo  logo"
		"stage stage"
		"back  back"
		"legal seal";
	column-gap: 10px;
	padding: 24px 24px 24px;
}

/* ---------- Logo Vale+ ---------- */
.up-cb__logo {
	grid-area: logo;
	justify-self: center;
	display: block;
	width: 220px;
	height: 219px;
	margin: 0;
}
.up-cb__logo img {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Área das telas ---------- */
.up-cb__stage {
	grid-area: stage;
	justify-self: center;
	width: 526px;
	max-width: 100%;
	margin-top: 24px;
}

.up-cb__step { display: none; }
.up-cb[data-state="consulta"] [data-cb-step="consulta"],
.up-cb[data-state="cadastro"] [data-cb-step="cadastro"],
.up-cb[data-state="negado"] [data-cb-step="negado"],
.up-cb[data-state="ja-cadastrado"] [data-cb-step="ja-cadastrado"],
.up-cb[data-state="sucesso"] [data-cb-step="sucesso"] { display: block; }

.up-cb[data-state="cadastro"] .up-cb__stage { width: 932px; }
.up-cb[data-state="negado"] .up-cb__stage,
.up-cb[data-state="ja-cadastrado"] .up-cb__stage { width: 908px; }
.up-cb[data-state="sucesso"] .up-cb__stage { width: 860px; }

/* ---------- Card azul ---------- */
.up-cb__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 36px;
	width: 100%;
	padding: 24px;
	border-radius: 10px;
	background: var(--cb-card);
}

.up-cb__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.up-cb__title {
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 36px;
	line-height: 44px;
	text-align: center;
	color: var(--cb-white);
}

.up-cb__brands {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 20px;
}
.up-cb__brands img { display: block; border: 0; }
.up-cb__brands .up-cb__brand-vw { width: 178px; height: 10px; }
.up-cb__brands .up-cb__brand-x { width: 9px; height: 10px; }
.up-cb__brands .up-cb__brand-cb { width: 145px; height: 20px; }

/* ---------- Campos ---------- */
.up-cb__form {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 36px;
	width: 100%;
}

.up-cb__fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.up-cb__field {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.up-cb__label {
	display: block;
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 24px;
	line-height: 29px;
	color: var(--cb-white);
	cursor: pointer;
}

.up-cb .up-cb__input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--cb-white);
	border-radius: 5px;
	outline: 0;
	background: var(--cb-white);
	box-shadow: none;
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 18px;
	line-height: 38px;
	color: var(--cb-navy);
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.up-cb .up-cb__input:focus {
	border-color: var(--cb-navy);
	box-shadow: 0 0 0 2px rgba(6, 26, 94, .25);
}
.up-cb .up-cb__input::placeholder { color: #8A94B5; opacity: 1; }

/* Erro no campo: borda levemente vermelha + caixinha com a mensagem */
.up-cb .up-cb__input[aria-invalid="true"] {
	border-color: var(--cb-error);
	box-shadow: 0 0 0 2px rgba(217, 59, 59, .18);
}

.up-cb__error {
	position: relative;
	display: none;
	margin-top: -4px;
	padding: 8px 12px;
	border: 1px solid var(--cb-error-line);
	border-radius: 5px;
	background: var(--cb-error-soft);
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 14px;
	line-height: 1.3;
	color: #A32020;
}
.up-cb__error::before {
	content: "";
	position: absolute;
	top: -6px;
	left: 16px;
	width: 10px;
	height: 10px;
	border-top: 1px solid var(--cb-error-line);
	border-left: 1px solid var(--cb-error-line);
	background: var(--cb-error-soft);
	transform: rotate(45deg);
}
.up-cb__error.is-visible { display: block; }

/* Erro geral (retorno da API, captcha, conexão) */
.up-cb__alert {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--cb-error-line);
	border-radius: 5px;
	background: var(--cb-error-soft);
	font-family: var(--cb-font);
	font-size: 15px;
	line-height: 1.3;
	color: #A32020;
}
.up-cb__alert[hidden] { display: none; }

/* Honeypot anti-robô */
.up-cb__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.up-cb__captcha { display: flex; justify-content: center; width: 100%; }
.up-cb__captcha:empty,
.up-cb__captcha[hidden] { display: none; }

/* ---------- Botões ---------- */
.up-cb .up-cb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 53px;
	margin: 0;
	padding: 12px 48px;
	border: 0;
	border-radius: 500px;
	font-family: var(--cb-font);
	font-size: 24px;
	line-height: 29px;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity .15s ease;
}
.up-cb .up-cb__btn:hover { opacity: .9; text-decoration: none; }
.up-cb .up-cb__btn:focus-visible { outline: 2px solid var(--cb-white); outline-offset: 2px; }
.up-cb .up-cb__btn[disabled] { opacity: .6; cursor: default; }

.up-cb .up-cb__btn--navy {
	min-width: 235px;
	font-weight: 400;
	color: var(--cb-white);
	background: var(--cb-navy);
}
.up-cb .up-cb__btn--navy:hover,
.up-cb .up-cb__btn--navy:focus { color: var(--cb-white); }

.up-cb .up-cb__btn--white {
	font-weight: 700;
	color: var(--cb-navy);
	background: var(--cb-white);
}
.up-cb .up-cb__btn--white:hover,
.up-cb .up-cb__btn--white:focus { color: var(--cb-navy); }

.up-cb__spinner {
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: var(--cb-white);
	border-radius: 50%;
	animation: up-cb-spin .7s linear infinite;
}
.up-cb__spinner[hidden] { display: none; }
@keyframes up-cb-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Tela 02 · Cadastro + escolha do óculos
   ===================================================================== */
.up-cb__card--reg {
	align-items: stretch;
	gap: 24px;
	padding: 24px 36px;
}

.up-cb__reg-head {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.up-cb__reg-title {
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 36px;
	line-height: 44px;
	text-align: center;
	color: var(--cb-navy);
}
.up-cb__reg-title strong { font-weight: 700; }
.up-cb__reg-title-l1,
.up-cb__reg-title-l2 { display: block; }
.up-cb__reg-title-l2 {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;           /* sem espaço: o logo desce, o texto não quebra */
	gap: 0 10px;
}
.up-cb__reg-title-l2 img {
	display: block;
	flex: 0 0 auto;
	width: 250px;
	height: 34px;
	border: 0;
}

.up-cb__reg-sub {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 24px;
	line-height: 29px;
	text-align: center;
	color: var(--cb-white);
}

.up-cb__reg-form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.up-cb__groups {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px;
}

.up-cb__group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}
.up-cb__group--products { grid-column: 1 / -1; }

.up-cb__group-title {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 24px;
	line-height: 29px;
	color: var(--cb-navy);
}

.up-cb__split {
	display: grid;
	grid-template-columns: 126px minmax(0, 1fr);
	gap: 10px;
}
.up-cb__split--half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.up-cb__split > .up-cb__field { min-width: 0; }

.up-cb .up-cb__input[readonly] {
	color: #33427A;
	cursor: default;
}

/* Select de UF com a mesma aparência dos campos */
.up-cb select.up-cb__input {
	padding-right: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23061A5E' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
	cursor: pointer;
}

/* ---------- Cards de óculos ---------- */
.up-cb__products {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px 24px;
}

.up-cb__product {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 150px;
	border-radius: 5px;
	background: var(--cb-white);
	cursor: pointer;
	transition: box-shadow .15s ease;
}
.up-cb__product.is-soldout { cursor: not-allowed; opacity: .55; }

.up-cb__product input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.up-cb__product-txt {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 0 12px;
}

.up-cb__radio {
	position: relative;
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
}
.up-cb__radio::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border: 2px solid #1C1B1F;
	border-radius: 50%;
}
.up-cb__radio::after {
	content: "";
	position: absolute;
	top: 7px;
	left: 7px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #1C1B1F;
	transform: scale(0);
	transition: transform .12s ease;
}
.up-cb__product input:checked + .up-cb__product-txt .up-cb__radio::after { transform: scale(1); }
.up-cb__product input:focus-visible + .up-cb__product-txt .up-cb__radio::before {
	box-shadow: 0 0 0 3px rgba(6, 26, 94, .3);
}

.up-cb__product-name {
	flex: 1 1 auto;
	min-width: 0;
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 20px;
	line-height: 24px;
	color: #000000;
}

.up-cb__product-img {
	display: block;
	flex: 0 0 150px;
	width: 150px;
	height: 150px;
	margin: 0;
	border: 0;
	border-radius: 5px;
	background: #E8E8E8;
	object-fit: cover;
}

.up-cb__products[aria-invalid="true"] .up-cb__product { box-shadow: 0 0 0 2px var(--cb-error); }
.up-cb__products-empty {
	padding: 16px;
	border-radius: 5px;
	background: var(--cb-white);
	font-size: 18px;
	line-height: 1.3;
	color: var(--cb-navy);
}

.up-cb .up-cb__btn--submit { align-self: center; min-width: 163px; }

/* =====================================================================
   Telas 03 (não elegível), já cadastrado e 04 (sucesso)
   ===================================================================== */
.up-cb__card--info { gap: 24px; }

.up-cb__info-title {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 36px;
	line-height: 44px;
	text-align: center;
	color: var(--cb-navy);
}

.up-cb__info-text {
	width: 100%;
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 24px;
	line-height: 29px;
	color: var(--cb-white);
}
.up-cb__info-text strong { font-weight: 700; }

.up-cb .up-cb__btn--info { order: 3; }
.up-cb__contacts { order: 4; }

.up-cb__contacts {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: end;
	gap: 24px;
	width: 100%;
}

.up-cb__contact {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.up-cb__contact-h {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 24px;
	line-height: 29px;
	color: var(--cb-navy);
}

.up-cb__contact-body {
	font-family: var(--cb-font);
	font-weight: 400;
	font-size: 24px;
	line-height: 40px;
	color: var(--cb-white);
}
.up-cb__contact-body a,
.up-cb__contact-body a:hover,
.up-cb__contact-body a:focus {
	color: inherit;
	text-decoration: none;
}
.up-cb__contact-body a:hover { text-decoration: underline; }

/* Sucesso: no Figma (desktop) o texto legal e o selo ficam 24px mais para dentro
   e a seção tem 8px a mais embaixo */
.up-cb[data-state="sucesso"] .up-cb__inner { padding: 24px 48px 32px; }

.up-cb__hero {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-align: center;
	color: var(--cb-white);
}
.up-cb__hero-title {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 90px;
	line-height: 110px;
	text-transform: uppercase;
}
.up-cb__hero-sub {
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 36px;
	line-height: 44px;
}

.up-cb .up-cb__back {
	grid-area: back;
	justify-self: center;
	margin-top: 24px;
}

/* ---------- Texto legal + selo ---------- */
.up-cb__legal {
	grid-area: legal;
	align-self: start;
	margin-top: 261px;
	font-family: var(--cb-font);
	font-weight: 700;
	font-size: 14px;
	line-height: 17px;
	color: var(--cb-white);
}

.up-cb__seal {
	grid-area: seal;
	align-self: start;
	display: block;
	width: 200px;
	height: 44px;
	margin-top: 261px;
	border: 0;
}

.up-cb__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =====================================================================
   Mobile (referência 412px)
   ===================================================================== */
@media (max-width: 767px) {
	.up-cb::before {
		aspect-ratio: 412 / 518;
		background-image: url("/arquivos/up-cb-bg-mobile.jpg?v=1");
	}

	.up-cb__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"logo"
			"stage"
			"legal"
			"back"
			"seal";
		padding: 24px 12px 12px;
	}

	.up-cb__stage { width: 100%; }

	/* Logos: tamanho exato do Figma em 412px e encolhem juntos em telas menores */
	.up-cb__brands {
		justify-content: center;
		width: 100%;
		height: auto;
		min-height: 15px;
	}
	.up-cb__brands .up-cb__brand-vw,
	.up-cb__brands .up-cb__brand-cb {
		flex: 0 1 auto;
		width: min(153px, calc((100% - 34px) / 2));
		height: auto;
	}
	.up-cb__brands .up-cb__brand-vw { aspect-ratio: 153 / 9; }
	.up-cb__brands .up-cb__brand-cb { aspect-ratio: 153 / 21; }
	.up-cb__brands .up-cb__brand-x { flex: 0 0 14px; width: 14px; height: 15px; }

	.up-cb__legal { margin-top: 24px; }

	.up-cb .up-cb__back {
		justify-self: stretch;
		width: 100%;
	}

	.up-cb__seal {
		justify-self: center;
		margin-top: 154px;
	}

	/* ---------- Tela 02 (mobile 412) ---------- */
	.up-cb[data-state="cadastro"] .up-cb__stage { width: 100%; }

	.up-cb__card--reg {
		gap: 36px;
		padding: 24px;
	}

	.up-cb__reg-head { gap: 12px; }

	.up-cb__reg-title {
		font-size: 22px;
		line-height: 27px;
	}
	.up-cb__reg-title-l2 img { width: 122px; height: 17px; }

	.up-cb__reg-sub {
		font-size: 20px;
		line-height: 24px;
	}

	.up-cb__reg-form { gap: 36px; }

	.up-cb__groups {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.up-cb__group-title {
		font-size: 20px;
		line-height: 24px;
	}

	.up-cb__group .up-cb__field {
		gap: 6px;
		padding-bottom: 11px;
	}
	.up-cb__group .up-cb__label {
		font-size: 20px;
		line-height: 24px;
	}

	.up-cb__split { grid-template-columns: 73px minmax(0, 1fr); gap: 6px; }
	.up-cb__split--half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.up-cb__group .up-cb__split .up-cb__field {
		gap: 12px;
		padding-bottom: 5px;
	}

	.up-cb__products {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.up-cb__product-name {
		font-size: 18px;
		line-height: 22px;
	}

	.up-cb .up-cb__btn--submit { align-self: stretch; }

	/* ---------- Telas 03 / já cadastrado / 04 (mobile 412) ---------- */
	.up-cb[data-state="negado"] .up-cb__stage,
	.up-cb[data-state="ja-cadastrado"] .up-cb__stage,
	.up-cb[data-state="sucesso"] .up-cb__stage { width: 100%; }

	.up-cb__card--info .up-cb__info-text { text-align: center; }
	.up-cb__card--success .up-cb__info-text { text-align: left; }

	.up-cb__contacts { order: 3; grid-template-columns: minmax(0, 1fr); }
	.up-cb .up-cb__btn--info {
		order: 4;
		align-self: stretch;
		margin-top: 12px;
	}

	.up-cb__contact-h {
		font-size: 20px;
		line-height: 24px;
	}
	.up-cb__contact-body { font-size: 20px; }

	.up-cb__hero-title {
		font-size: 50px;
		line-height: 61px;
	}

	.up-cb[data-state="sucesso"] .up-cb__inner { padding: 24px 12px 12px; }
	/* No Figma (cadastro mobile) o fundo termina 9px abaixo do conteúdo */
	.up-cb[data-state="cadastro"] .up-cb__inner { padding-bottom: 19px; }
}

/* Tablet: 2 colunas de óculos ficam estreitas demais para o texto */
@media (min-width: 768px) and (max-width: 959px) {
	.up-cb__products { grid-template-columns: minmax(0, 1fr); }
}

/* Abaixo de 400px o título da tela 02 vira texto corrido (evita "para" sozinho) */
@media (max-width: 399px) {
	.up-cb .up-cb__reg-title-l1,
	.up-cb .up-cb__reg-title-l2 { display: inline; }
	.up-cb .up-cb__reg-title-l1::after { content: " "; }
	.up-cb .up-cb__reg-title-l2 img { display: inline-block; vertical-align: -1px; margin-left: 4px; }
}

/* Celulares estreitos: foto do óculos menor para o nome caber */
@media (max-width: 389px) {
	.up-cb__product { min-height: 100px; }
	.up-cb__product-img { flex-basis: 100px; width: 100px; height: 100px; }
}

@media (max-width: 359px) {
	.up-cb__title { font-size: 32px; line-height: 39px; }
	.up-cb__label { font-size: 22px; line-height: 27px; }
	.up-cb .up-cb__btn { padding-left: 24px; padding-right: 24px; font-size: 22px; }
}
