/**
 * First Order Coupon - By Inside · front-end do formulário e do ticket de cupom.
 * Tokens do Estudo de Caso: form "camaleão" (herda o site), ticket com identidade.
 *
 * Projeto Gerado pelo Prompt Mestre do Desenvolvedor e Vibe Coder Dante Testa — www.dantetesta.com.br
 */

.foc-widget {
	/* Verde "ganho" escurecido p/ contraste AA 4.5:1 com texto branco (R48). */
	--foc-accent: #0b7d46;
	--foc-accent-hover: #095f36;
	--foc-ticket-accent: #0b7d46;
	--foc-ticket-bg: #f2fbf6;
	--foc-error: #d93025;
	--foc-gap: 16px;
	--foc-radius: 8px;
	box-sizing: border-box;
}

.foc-widget *,
.foc-widget *::before,
.foc-widget *::after {
	box-sizing: inherit;
}

.foc-title {
	margin: 0 0 8px;
}

.foc-desc {
	margin: 0 0 24px;
	opacity: .85;
}

/* ---------- Formulário ---------- */

.foc-fields {
	display: flex;
	flex-direction: column;
	gap: var(--foc-gap);
	margin: 0 0 var(--foc-gap);
}

.foc-form--inline .foc-fields {
	flex-direction: row;
	flex-wrap: wrap;
}

.foc-form--inline .foc-field {
	flex: 1 1 180px;
}

.foc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.foc-field label {
	font-size: .875em;
	font-weight: 600;
}

.foc-field input {
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .18);
	border-radius: var(--foc-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.foc-field input:focus-visible {
	outline: 2px solid var(--foc-accent);
	outline-offset: 2px;
	border-color: var(--foc-accent);
}

/* Honeypot: fora da tela, invisível para humanos, presente para bots. */
.foc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	margin: 0;
}

.foc-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 var(--foc-gap);
	font-size: .8em;
	line-height: 1.5;
}

/* Consentimento posicionado após o botão. */
.foc-consent--after {
	margin: calc(var(--foc-gap) * .75) 0 0;
}

.foc-consent input {
	margin-top: 3px;
	accent-color: var(--foc-accent);
}

.foc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 24px;
	font: inherit;
	font-weight: 700;
	color: #fff;
	background: var(--foc-accent);
	border: none;
	border-radius: var(--foc-radius);
	cursor: pointer;
	transition: background-color .15s ease, transform .1s ease;
}

/* Largura do botão: 100% por padrão (inclusive no modo inline); "auto" via opção. */
.foc-form--btn-auto .foc-btn {
	width: auto;
}

.foc-btn:hover {
	background: var(--foc-accent-hover);
}

.foc-btn:focus-visible {
	outline: 2px solid var(--foc-accent);
	outline-offset: 3px;
}

.foc-btn[disabled] {
	opacity: .65;
	cursor: wait;
}

.foc-msg {
	margin: 10px 0 0;
	font-size: .875em;
	min-height: 1em;
}

.foc-msg.is-error {
	color: var(--foc-error);
	font-weight: 600;
}

/* ---------- Ticket (estado de sucesso, assinatura visual) ---------- */

.foc-ticket {
	position: relative;
	margin-top: 8px;
	padding: 26px 28px;
	text-align: center;
	background: var(--foc-ticket-bg);
	border: 2px dashed var(--foc-ticket-accent);
	border-radius: 14px;
	animation: foc-reveal .32s cubic-bezier(.2, .8, .2, 1);
}

/* Recortes circulares laterais, estilo ingresso destacável. */
.foc-ticket::before,
.foc-ticket::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 22px;
	height: 22px;
	background: #fff;
	border: 2px dashed var(--foc-ticket-accent);
	border-radius: 50%;
	transform: translateY(-50%);
}

.foc-ticket::before {
	left: -13px;
	clip-path: inset(0 0 0 50%);
	border-left-color: transparent;
}

.foc-ticket::after {
	right: -13px;
	clip-path: inset(0 50% 0 0);
	border-right-color: transparent;
}

.foc-ticket__title {
	margin: 0 0 14px;
	font-size: 1.15em;
	font-weight: 700;
}

.foc-ticket__code {
	display: block;
	margin: 0 auto 6px;
	font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
	font-size: 1.6em;
	font-weight: 700;
	letter-spacing: .12em;
	color: var(--foc-ticket-accent);
	word-break: break-all;
	user-select: all;
}

.foc-ticket__expiry {
	margin: 0 0 16px;
	font-size: .8em;
	opacity: .8;
}

.foc-ticket__copy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 20px;
	font: inherit;
	font-size: .875em;
	font-weight: 700;
	color: #fff;
	background: var(--foc-ticket-accent);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: filter .15s ease;
}

.foc-ticket__copy:hover {
	filter: brightness(.92);
}

.foc-ticket__copy:focus-visible {
	outline: 2px solid var(--foc-ticket-accent);
	outline-offset: 3px;
}

.foc-ticket__note {
	margin: 14px 0 0;
	font-size: .8em;
	opacity: .85;
}

@keyframes foc-reveal {
	from {
		opacity: 0;
		transform: translateY(10px) scale(.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.foc-ticket {
		animation: none;
	}
	.foc-widget * {
		transition: none !important;
	}
}
