/* DM Sans - Variable Font */
@font-face {
	font-family: 'DM Sans';
	src: url('../webfonts/DMSans.woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* ── Design System ── */

:root {
	--color-bg-start: #f8fafc;
	--color-bg-end: #e2e8f0;
	--color-text: #1a2f42;
	--color-text-muted: rgba(26, 47, 66, 0.65);
	--color-accent: #4a9bae;
	--color-accent-hover: #3a8b9e;
	--color-input-bg: #ffffff;
	--color-input-border: #d1d5db;
	--color-input-text: #1a2f42;
	--color-input-placeholder: rgba(26, 47, 66, 0.45);
	--color-success-bg: #ecfdf5;
	--color-success-text: #065f46;
	--color-success-border: #a7f3d0;
	--color-error-bg: #fef2f2;
	--color-error-text: #991b1b;
	--color-error-border: #fecaca;
	--color-toggle-bg: #ffffff;
	--color-shadow: rgba(0, 0, 0, 0.08);

	--font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--app-height: 100vh;
	--radius: 0.75rem;
	--radius-full: 9999px;
	--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark Theme */
[data-theme="dark"] {
	--color-bg-start: #1a2f42;
	--color-bg-end: #2c5f7c;
	--color-text: #ffffff;
	--color-text-muted: rgba(255, 255, 255, 0.65);
	--color-accent: #4a9bae;
	--color-accent-hover: #5aabce;
	--color-input-bg: #ffffff;
	--color-input-border: transparent;
	--color-input-text: #1a2f42;
	--color-input-placeholder: rgba(26, 47, 66, 0.5);
	--color-success-bg: #064e3b;
	--color-success-text: #a7f3d0;
	--color-success-border: #065f46;
	--color-error-bg: #7f1d1d;
	--color-error-text: #fca5a5;
	--color-error-border: #991b1b;
	--color-toggle-bg: #ffffff;
	--color-shadow: rgba(0, 0, 0, 0.2);
}

/* ── Reset ── */

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

html, body {
	width: 100%;
	height: var(--app-height);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */

body {
	font-family: var(--font-main);
	color: var(--color-text);
	background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem;
	min-height: 100vh;
	min-height: var(--app-height);
	transition: background 0.3s ease, color 0.3s ease;
}

.container {
	width: 100%;
	max-width: 720px;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	animation: fadeInUp 0.8s ease-out;
}

/* ── Rocket ── */

.rocket {
	width: 100%;
	max-width: 200px;
	animation: float 4s ease-in-out infinite;
}

.rocket svg {
	width: 100%;
	height: auto;
	display: block;
}

.star { animation: twinkle 3s ease-in-out infinite; }
.star-1 { animation-delay: 0s; }
.star-2 { animation-delay: 0.5s; }
.star-3 { animation-delay: 1.1s; }
.star-4 { animation-delay: 1.7s; }
.star-5 { animation-delay: 2.3s; }
.star-6 { animation-delay: 0.8s; }
.star-7 { animation-delay: 1.4s; }

/* ── Typography ── */

.container span {
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-accent);
	text-align: center;
}

h1 {
	font-size: clamp(2rem, 6vw, 3rem);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: var(--color-text);
}

.container p {
	font-size: clamp(0.95rem, 2vw, 1.0625rem);
	font-weight: 400;
	line-height: 1.6;
	text-align: center;
	color: var(--color-text-muted);
	max-width: 560px;
}

/* ── Signup Form ── */

.signup-form {
	width: 100%;
	position: relative;
}

.form-row {
	display: flex;
	gap: 0.75rem;
}

.form-row input[type="text"],
.form-row input[type="email"] {
	flex: 1;
	border: 1px solid var(--color-input-border);
	background: var(--color-input-bg);
	padding: 0.875rem 1rem;
	font-family: var(--font-main);
	font-size: 1rem;
	color: var(--color-input-text);
	border-radius: var(--radius);
	outline: none;
	box-shadow: var(--shadow);
	transition: box-shadow 0.2s ease;
	min-width: 0;
}

.form-row input::placeholder {
	color: var(--color-input-placeholder);
}

.form-row input:focus {
	box-shadow: 0 0 0 3px rgba(74, 155, 174, 0.3);
}

.form-row button {
	background: var(--color-accent);
	border: none;
	border-radius: var(--radius);
	padding: 0.875rem 1.75rem;
	font-family: var(--font-main);
	font-size: 1rem;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: all 0.2s ease;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.bell-icon {
	width: 18px;
	height: 18px;
	animation: ring 4s ease-in-out infinite;
	transform-origin: top center;
}

@keyframes ring {
	0%, 15%, 100% { transform: rotate(0); }
	2% { transform: rotate(15deg); }
	4% { transform: rotate(-13deg); }
	6% { transform: rotate(10deg); }
	8% { transform: rotate(-8deg); }
	10% { transform: rotate(4deg); }
	12% { transform: rotate(0); }
}

.form-row button:hover {
	background: var(--color-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

.form-row button:active {
	transform: translateY(0);
}

/* ── Alerts ── */

.alert {
	width: 100%;
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: center;
}

.alert-success {
	background: var(--color-success-bg);
	color: var(--color-success-text);
	border: 1px solid var(--color-success-border);
}

.alert-error {
	background: var(--color-error-bg);
	color: var(--color-error-text);
	border: 1px solid var(--color-error-border);
}

/* ── Theme Toggle ── */

.theme-toggle {
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	background: var(--color-toggle-bg);
	border: none;
	border-radius: var(--radius-full);
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: all 0.2s ease;
	z-index: 100;
}

.theme-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
	transform: scale(0.95);
}

.theme-toggle svg {
	width: 22px;
	height: 22px;
	color: var(--color-input-text);
	transition: transform 0.3s ease;
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Footer ── */

.footer {
	width: 100%;
	padding: 1.25rem;
	text-align: center;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--color-text-muted);
}

.footer-heart {
	color: var(--color-accent);
}

.footer-credit a {
	color: var(--color-accent);
	text-decoration: none;
	font-weight: 500;
}

.footer-credit a:hover {
	text-decoration: underline;
}

.footer-slogan {
	margin-top: 0.25rem;
	font-size: 0.75rem;
}

.footer-slogan a {
	color: var(--color-text-muted);
	text-decoration: none;
}

.footer-slogan a:hover {
	color: var(--color-accent);
}

.footer-extra {
	margin-top: 0.25rem;
	font-size: 0.75rem;
}

/* ── Animations ── */

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-15px); }
}

@keyframes twinkle {
	0%, 100% { opacity: 0.1; }
	50% { opacity: 0.6; }
}

/* ── Responsive ── */

@media (max-width: 768px) {
	.container {
		max-width: 560px;
	}
}

@media (max-width: 600px) {
	.container {
		max-width: 480px;
	}

	.container p {
		max-width: 480px;
	}
}

@media (max-width: 480px) {
	body {
		padding: 1rem;
	}

	.container {
		max-width: 100%;
	}

	.rocket {
		max-width: 160px;
	}

	.form-row {
		flex-direction: column;
	}

	.form-row input[type="text"],
	.form-row input[type="email"] {
		font-size: 16px;
		padding: 0.75rem 1rem;
	}

	.form-row button {
		padding: 0.75rem 1.5rem;
	}

	.footer {
		font-size: 0.75rem;
		padding: 1rem;
	}

	.theme-toggle {
		width: 44px;
		height: 44px;
		top: 1rem;
		right: 1rem;
	}

	.theme-toggle svg {
		width: 20px;
		height: 20px;
	}
}

@media (max-width: 375px) {
	h1 {
		font-size: 1.75rem;
	}

	.subtitle {
		font-size: 0.9rem;
	}

	.rocket {
		max-width: 140px;
	}
}

/* ── Accessibility ── */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

*:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}
