/* =====================================================
VARIÁVEIS GLOBAIS
===================================================== */

:root{
	/* Base */
	--bg: #f6f8fb;
	--card: #ffffff;
	--primary: #2563eb;
	--accent: #22d3ee;
	--text: #1f2937;
	--muted: #6b7280;

	/* Countdown */
	--countdown-number: #000000;
	--countdown-bg: #f3f4f6;

	/* Footer */
	--footer-bg: #76787a;
	--footer-text: #f9fafb;
	--footer-link: #ffffff;
	--footer-border: rgba(0,0,0,.08);
	--footer-height: 56px;

	/* UI */
	--radius: 16px;
}

/* ================= DARK THEME ================= */

[data-theme="dark"]{
	--bg: #0b0f1a;
	--card: #111827;
	--text: #e5e7eb;
	--muted: #9ca3af;

	--countdown-number: #000000;
	--countdown-bg: #e5e7eb;

	--footer-bg: #0f172a;
	--footer-text: #e5e7eb;
	--footer-link: #22d3ee;
	--footer-border: rgba(255,255,255,.08);
}

/* =====================================================
RESET E BASE
===================================================== */

*{
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,body{
	height: 100%;
	font-family: Inter, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
}

/* Evita conteúdo sob footer fixo */
body{
	padding-bottom: calc(var(--footer-height) + 14px);
}

/* =====================================================
CANVAS / BACKGROUND
===================================================== */

canvas{
	position: fixed;
	inset: 0;
	z-index: 0;
}

/* =====================================================
LAYOUT PRINCIPAL
===================================================== */

.main{
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	position: relative;
	z-index: 1;
}

.card{
	width: 100%;
	max-width: 520px;
	background: var(--card);
	border-radius: var(--radius);
	padding: 2.2rem;
	text-align: center;
	box-shadow: 0 20px 50px rgba(0,0,0,.15);
}

/* =====================================================
TEXTO E TÍTULOS
===================================================== */

.toggle{
	font-size: .85rem;
	cursor: pointer;
	margin-bottom: .8rem;
}

.domain{
	color: var(--primary);
	font-weight: 600;
	margin-bottom: .7rem;
}

p{
	color: var(--muted);
	margin-bottom: 1.4rem;
}

/* =====================================================
COUNTDOWN
===================================================== */

.countdown{
	display: flex;
	gap: .8rem;
	justify-content: center;
}

.box{
	background: var(--countdown-bg);
	padding: .7rem 1rem;
	border-radius: 10px;
	min-width: 70px;
}

.box span{
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--countdown-number);
}

.box small{
	font-size: .7rem;
	color: var(--muted);
}

/* =====================================================
PROGRESS BAR
===================================================== */

.progress{
	height: 6px;
	background: #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
	margin: 1rem 0;
}

.progress-bar{
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg,var(--primary),var(--accent));
}

/* =====================================================
BOTÕES
===================================================== */

.btn{
	background: var(--primary);
	color: #fff;
	border: none;
	padding: .75rem 1.4rem;
	border-radius: 10px;
	cursor: pointer;
	transition: opacity .2s ease;
}

.btn.small{
	padding: .45rem .7rem;
	font-size: .75rem;
}

.btn:disabled{
	opacity: .5;
	cursor: not-allowed;
}

/* =====================================================
MODAL
===================================================== */

.modal{
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.6);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 5;
}

.modal.active{
	display: flex;
}

.modal-box{
	position: relative;
	background: var(--card);
	width: 100%;
	max-width: 420px;
	padding: 2rem;
	border-radius: 14px;
}

/* =====================================================
FORMULÁRIOS
===================================================== */

input,textarea{
	width: 100%;
	padding: .65rem;
	margin-bottom: .7rem;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	background: #fff;
	color: #111827;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea{
	background: #1f2937;
	border-color: #374151;
	color: #e5e7eb;
}

textarea{
	resize: none;
	height: 90px;
}

.email-wrapper{
	position: relative;
}

/* Autocomplete e-mail */
#emailSuggestions{
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	display: none;
	z-index: 10;
}

#emailSuggestions div{
	padding: 6px 10px;
	cursor: pointer;
}

#emailSuggestions div:hover{
	background: #f3f4f6;
}

/* Dark autocomplete */
[data-theme="dark"] #emailSuggestions{
	background: #1f2937;
	border-color: #374151;
	color: #e5e7eb;
}

[data-theme="dark"] #emailSuggestions div:hover{
	background: #374151;
}

/* CAPTCHA */
#captcha{
	text-transform: uppercase;
}

.captcha-row{
	display: flex;
	gap: .6rem;
	align-items: center;
	margin-bottom: .7rem;
}

/* =====================================================
TOAST
===================================================== */

#toast{
	position: fixed;
	right: 20px;
	bottom: calc(var(--footer-height) + 16px);
	padding: .8rem 1.2rem;
	border-radius: 10px;
	color: #fff;
	opacity: 0;
	transition: .3s;
	z-index: 30;
}

/* =====================================================
OVERLAY DE ENVIO
===================================================== */

#formOverlay{
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,.85);
	border-radius: 14px;
	align-items: center;
	justify-content: center;
}

[data-theme="dark"] #formOverlay{
	background: rgba(17,24,39,.85);
}

.spinner{
	width: 32px;
	height: 32px;
	border: 4px solid #ccc;
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 10px;
}

@keyframes spin{
	to{
		transform: rotate(360deg);
	}
}

/* =====================================================
FOOTER FIXO
===================================================== */

.site-footer{
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	height: var(--footer-height);

	display: flex;
	flex-direction: column;
	justify-content: center;

	background: var(--footer-bg);
	border-top: 1px solid var(--footer-border);

	padding: .6rem 1rem;
	text-align: center;

	font-size: .75rem;
	color: var(--footer-text);

	z-index: 20;
	backdrop-filter: blur(6px);
}

.footer-line{
	line-height: 1.4;
}

.footer-dev a{
	color: var(--footer-link);
	text-decoration: none;
	font-weight: 500;
	transition: color .2s ease, text-shadow .2s ease;
}

.footer-dev a:hover{
	color: var(--accent);
	text-shadow: 0 0 6px rgba(255,255,255,.4);
}
