:root {
	--primary: #3b82f6;
	--primary-dark: #2563eb;
	--primary-light: #60a5fa;
	--secondary: #8b5cf6;
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ef4444;
	--text: #1e293b;
	--text-light: #64748b;
	--bg: #f8fafc;
	--surface: #ffffff;
	--surface-alt: #ffffff;
	--border: #e2e8f0;
	--shadow: rgba(0, 0, 0, 0.1);
	--shadow-lg: rgba(0, 0, 0, 0.15);
	color-scheme: light;
}

:root[data-theme='dark'] {
	--text: #e2e8f0;
	--text-light: #94a3b8;
	--bg: #0f172a;
	--surface: #1e293b;
	--surface-alt: #0b1220;
	--border: #334155;
	--shadow: rgba(0, 0, 0, 0.4);
	--shadow-lg: rgba(0, 0, 0, 0.6);
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--text: #e2e8f0;
		--text-light: #94a3b8;
		--bg: #0f172a;
		--surface: #1e293b;
		--surface-alt: #0b1220;
		--border: #334155;
		--shadow: rgba(0, 0, 0, 0.4);
		--shadow-lg: rgba(0, 0, 0, 0.6);
		color-scheme: dark;
	}
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
	line-height: 1.6;
	background: var(--bg);
	color: var(--text);
	font-size: 16px;
	min-height: 100vh;
	position: relative;
	overflow-x: hidden;
}

/* Animated Background */
.background-animation {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.gradient-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.3;
	animation: float 20s infinite ease-in-out;
}

.orb-1 {
	width: 500px;
	height: 500px;
	background: linear-gradient(135deg, var(--primary), var(--secondary));
	top: -250px;
	left: -250px;
	animation-delay: 0s;
}

.orb-2 {
	width: 400px;
	height: 400px;
	background: linear-gradient(135deg, var(--secondary), var(--primary));
	bottom: -200px;
	right: -200px;
	animation-delay: 7s;
}

.orb-3 {
	width: 300px;
	height: 300px;
	background: linear-gradient(135deg, var(--primary-light), var(--primary));
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	animation-delay: 14s;
}

@keyframes float {
	0%,
	100% {
		transform: translate(0, 0) scale(1);
	}
	33% {
		transform: translate(100px, -100px) scale(1.1);
	}
	66% {
		transform: translate(-100px, 100px) scale(0.9);
	}
}

/* Hero Section */
.hero {
	padding: 4rem 1rem 3rem;
	text-align: center;
	position: relative;
	z-index: 1;
}

.hero-content {
	max-width: 600px;
	margin: 0 auto;
	animation: fadeInUp 0.8s ease;
}

.shield-icon {
	display: inline-flex;
	padding: 1.5rem;
	background: linear-gradient(135deg, var(--primary), var(--secondary));
	border-radius: 24px;
	color: white;
	margin-bottom: 1.5rem;
	box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
	animation: pulse 3s infinite;
}

@keyframes pulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
	}
}

.hero h1 {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
	color: var(--text);
	margin-bottom: 1rem;
	letter-spacing: -0.02em;
	background: linear-gradient(135deg, var(--text), var(--primary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.hero-subtitle {
	font-size: clamp(1rem, 2vw, 1.25rem);
	color: var(--text-light);
	max-width: 500px;
	margin: 0 auto;
}

/* Container */
.container {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 1rem 4rem;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
}

/* Quick Links Section */
.quick-links-section {
	margin-top: 0;
	margin-bottom: 3rem;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 1.5rem;
	text-align: center;
}

.quick-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1rem;
}

.quick-link {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.25rem;
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: 16px;
	text-decoration: none;
	color: var(--text);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 8px var(--shadow);
	position: relative;
	overflow: hidden;
}

.quick-link::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.05));
	opacity: 0;
	transition: opacity 0.3s;
}

.quick-link:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px var(--shadow-lg);
	border-color: var(--primary);
}

.quick-link:hover::before {
	opacity: 1;
}

.link-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	transition: transform 0.3s;
}

.quick-link:hover .link-icon {
	transform: scale(1.1) rotate(5deg);
}

.microsoft .link-icon {
	background: linear-gradient(135deg, #00a4ef, #0078d4);
	color: white;
}

.google .link-icon {
	background: linear-gradient(135deg, #4285f4, #34a853);
	color: white;
}

.netcraft .link-icon {
	background: linear-gradient(135deg, #667eea, #764ba2);
	color: white;
}

.link-content {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.link-title {
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--text);
}

.link-desc {
	font-size: 0.875rem;
	color: var(--text-light);
}

/* Form Section */
.form-section {
	background: var(--surface);
	border-radius: 24px;
	padding: 2.5rem;
	box-shadow: 0 4px 16px var(--shadow);
	border: 1px solid var(--border);
}

.form-header {
	text-align: center;
	margin-bottom: 2rem;
}

.form-description {
	color: var(--text-light);
	margin-top: 0.5rem;
}

.info-link {
	color: var(--primary-dark);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

:root[data-theme='dark'] .info-link {
	color: var(--primary-light);
}

.info-link:hover {
	color: var(--primary-dark);
}

.info-link::after {
	content: '→';
	transition: transform 0.2s;
}

.info-link:hover::after {
	transform: translateX(4px);
}

/* Alerts */
.alert {
	padding: 1rem 1.25rem;
	border-radius: 12px;
	margin-bottom: 1.5rem;
	display: none;
	align-items: center;
	gap: 0.75rem;
	animation: slideDown 0.3s ease;
	font-size: 0.95rem;
	line-height: 1.5;
}

.alert-error {
	background: linear-gradient(135deg, #fee2e2, #fecaca);
	border: 2px solid var(--danger);
	color: #991b1b;
}

.alert-warning {
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	border: 2px solid var(--warning);
	color: #92400e;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Form Grid */
.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.form-group {
	position: relative;
}

.form-group.full-width {
	grid-column: 1 / -1;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	color: var(--text);
	font-size: 0.95rem;
}

.required {
	color: var(--danger);
	margin-left: 0.25rem;
}

input[type='text'],
input[type='url'],
select,
textarea {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 2px solid var(--border);
	border-radius: 12px;
	font-size: 1rem;
	transition: all 0.3s;
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
}

input[type='text']:focus,
input[type='url']:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
	background: white;
}

input.error,
select.error,
textarea.error {
	border-color: var(--danger);
	animation: shake 0.3s;
}

@keyframes shake {
	0%,
	100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-5px);
	}
	75% {
		transform: translateX(5px);
	}
}

textarea {
	min-height: 120px;
	resize: vertical;
	line-height: 1.6;
}

.field-hint {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-light);
}

.field-error {
	display: none;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: #b91c1c;
	font-weight: 600;
}

:root[data-theme='dark'] .field-error {
	color: #fca5a5;
}

/* Advanced Options */
.advanced-options {
	background: linear-gradient(135deg, #f8fafc, #f1f5f9);
	border: 2px solid var(--border);
	border-radius: 16px;
	padding: 0;
	margin-bottom: 2rem;
	overflow: hidden;
}

.advanced-options summary {
	padding: 1.25rem;
	cursor: pointer;
	font-weight: 600;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 0.75rem;
	user-select: none;
	transition: background 0.2s;
}

.advanced-options summary:hover {
	background: rgba(59, 130, 246, 0.05);
}

.summary-icon {
	font-size: 1.25rem;
}

.options-grid {
	padding: 1.25rem;
	border-top: 2px solid var(--border);
	display: grid;
	gap: 1rem;
}

.checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	cursor: pointer;
	padding: 1rem;
	background: var(--surface);
	border-radius: 12px;
	border: 2px solid var(--border);
	transition: all 0.2s;
}

.checkbox-label:hover {
	border-color: var(--primary);
	background: white;
}

.checkbox-label input[type='checkbox'] {
	display: none;
}

.checkbox-custom {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border: 2px solid var(--border);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	background: var(--surface);
}

.checkbox-label input[type='checkbox']:checked + .checkbox-custom {
	background: var(--primary);
	border-color: var(--primary);
}

.checkbox-label input[type='checkbox']:checked + .checkbox-custom::after {
	content: '✓';
	color: white;
	font-weight: bold;
	font-size: 0.875rem;
}

.checkbox-text {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.checkbox-text strong {
	color: var(--text);
	font-size: 0.95rem;
}

.checkbox-text small {
	color: var(--text-light);
	font-size: 0.875rem;
}

/* Turnstile Wrapper */
.turnstile-wrapper {
	margin-bottom: 2rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

#turnstile-container {
	display: flex;
	justify-content: center;
}

.turnstile-error {
	display: none;
	color: #b91c1c;
	font-size: 0.875rem;
	text-align: center;
	font-weight: 600;
}

:root[data-theme='dark'] .turnstile-error {
	color: #fca5a5;
}

/* Submit Button */
.submit-button {
	width: 100%;
	padding: 1rem 2rem;
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	color: white;
	border: none;
	border-radius: 12px;
	font-size: 1.1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
	position: relative;
	overflow: hidden;
}

.submit-button::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.submit-button:hover::before {
	width: 300px;
	height: 300px;
}

.submit-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}

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

.submit-button:disabled {
	background: linear-gradient(135deg, #cbd5e1, #94a3b8);
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.button-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	position: relative;
	z-index: 1;
}

.button-loader {
	display: none;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.submit-button.loading .button-content {
	opacity: 0;
}

.submit-button.loading .button-loader {
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

@keyframes spin {
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Result Container */
.result-container {
	background: linear-gradient(135deg, #ecfdf5, #d1fae5);
	border: 2px solid var(--success);
	border-radius: 16px;
	padding: 2rem;
	margin-top: 2rem;
	animation: slideDown 0.5s ease;
}

.result-container h2 {
	color: var(--success);
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-size: 1.5rem;
}

.result-details {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.result-details p {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem;
	background: white;
	border-radius: 12px;
	border: 1px solid #a7f3d0;
}

.result-details strong {
	color: var(--text);
	font-size: 0.95rem;
}

.result-details a {
	color: var(--primary);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.result-details a:hover {
	color: var(--primary-dark);
	text-decoration: underline;
}

.result-code {
	display: inline-block;
	padding: 0.5rem;
	background: white;
	border-radius: 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	overflow-wrap: anywhere;
}

.api-error-details {
	margin-top: 1rem;
	padding: 1rem;
	background: #fef3c7;
	border: 2px solid var(--warning);
	border-radius: 12px;
	color: #78350f;
}

.api-error-details summary {
	cursor: pointer;
	font-weight: 600;
	color: #92400e;
	user-select: none;
}

.api-error-details ul {
	margin-top: 0.75rem;
	padding-left: 1.5rem;
}

.api-error-details li {
	margin: 0.5rem 0;
}

/* Footer */
footer {
	max-width: 900px;
	margin: 0 auto;
	padding: 3rem 1rem;
	color: var(--text-light);
	font-size: 0.875rem;
	line-height: 1.6;
}

.footer-content {
	display: grid;
	gap: 2rem;
}

.footer-section h3 {
	font-size: 1rem;
	margin-bottom: 0.75rem;
	color: var(--text);
}

.footer-section p {
	margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	.hero {
		padding: 2rem 1rem 1.5rem;
	}

	.shield-icon {
		padding: 1rem;
		border-radius: 18px;
		margin-bottom: 1rem;
	}

	.shield-icon svg {
		width: 48px;
		height: 48px;
	}

	.hero h1 {
		font-size: 1.85rem;
	}

	.hero-subtitle {
		font-size: 1rem;
	}

	.form-section {
		padding: 1.5rem;
		border-radius: 20px;
	}

	.quick-links-section {
		margin-top: 2rem;
	}

	.form-grid {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.quick-links {
		grid-template-columns: 1fr;
	}

	.options-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	body {
		font-size: 15px;
	}

	.form-section {
		padding: 1rem;
		border-radius: 16px;
	}

	.submit-button {
		font-size: 1rem;
		padding: 0.875rem 1.5rem;
	}
}

/* Submit hint under the disabled submit button */
.submit-hint {
	margin-top: 0.75rem;
	text-align: center;
	font-size: 0.875rem;
	color: var(--text-light);
}

/* Result row monospace ID */
.result-mono {
	font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
	background: var(--surface);
	padding: 0.5rem;
	border-radius: 8px;
	display: inline-block;
	word-break: break-all;
}

/* API error details inside result container */
.result-api-errors {
	margin-top: 1rem;
	padding: 1rem;
	background: #fef3c7;
	border: 2px solid var(--warning);
	border-radius: 12px;
}

.result-api-errors > summary {
	cursor: pointer;
	font-weight: 600;
	color: #92400e;
	user-select: none;
}

.result-api-errors ul {
	margin-top: 0.75rem;
	padding-left: 1.5rem;
	font-size: 0.9rem;
	color: #78350f;
}

.result-api-errors li {
	margin: 0.5rem 0;
}

/* Reduced motion: disable decorative animations */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.background-animation,
	.gradient-orb {
		animation: none !important;
	}
}

/* Dark theme — applied via data-theme attribute (set by theme.js bootstrap). */
:root[data-theme='dark'] .hero h1 {
	background: linear-gradient(135deg, #f1f5f9, var(--primary-light));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

:root[data-theme='dark'] input[type='text']:focus,
:root[data-theme='dark'] input[type='url']:focus,
:root[data-theme='dark'] select:focus,
:root[data-theme='dark'] textarea:focus {
	background: var(--surface-alt);
}

:root[data-theme='dark'] .advanced-options {
	background: linear-gradient(135deg, #1e293b, #0f172a);
}

:root[data-theme='dark'] .alert-error {
	background: linear-gradient(135deg, #450a0a, #7f1d1d);
	color: #fecaca;
	border-color: #b91c1c;
}

:root[data-theme='dark'] .alert-warning {
	background: linear-gradient(135deg, #451a03, #78350f);
	color: #fde68a;
	border-color: #b45309;
}

:root[data-theme='dark'] .result-container {
	background: linear-gradient(135deg, #022c22, #064e3b);
	border-color: #047857;
}

:root[data-theme='dark'] .result-details p {
	background: var(--surface);
	border-color: #047857;
}

:root[data-theme='dark'] .result-mono {
	background: var(--surface-alt);
	color: var(--text);
}

:root[data-theme='dark'] .result-api-errors {
	background: #451a03;
	border-color: #b45309;
}

:root[data-theme='dark'] .result-api-errors > summary {
	color: #fde68a;
}

:root[data-theme='dark'] .result-api-errors ul {
	color: #fcd34d;
}

:root[data-theme='dark'] .checkbox-label:hover {
	background: var(--surface-alt);
}

/* Theme toggle button */
.theme-toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 100;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	box-shadow: 0 2px 8px var(--shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
	transform: translateY(-1px);
	border-color: var(--primary);
	box-shadow: 0 4px 14px var(--shadow-lg);
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.theme-toggle:active {
	transform: translateY(0);
}

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

.theme-toggle .icon-sun {
	display: none;
}

.theme-toggle .icon-moon {
	display: block;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
	display: block;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
	display: none;
}

@media (max-width: 480px) {
	.theme-toggle {
		top: 0.75rem;
		right: 0.75rem;
	}
}
