:root {
	--bg: #f4f6fb;
	--card-bg: #ffffff;
	--text: #1f2933;
	--muted: #52606d;
	--primary: #0b7285;
	--primary-hover: #095d6b;
	--border: #dfe3eb;
	--shadow: rgba(15, 23, 42, 0.08);
	font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
	--bg: #0f1419;
	--card-bg: #1a1f29;
	--text: #e2e8f0;
	--muted: #94a3b8;
	--primary: #22d3ee;
	--primary-hover: #06b6d4;
	--border: #2d3748;
	--shadow: rgba(0, 0, 0, 0.3);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	transition: background-color 0.3s ease, color 0.3s ease;
}

header {
	padding: 1.5rem 1rem;
	background: var(--card-bg);
	border-bottom: 1px solid var(--border);
}

.header-content {
	max-width: 780px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
}

.header-text {
	max-width: 60ch;
}

.header-text h1 {
	margin: 0 0 0.35rem;
}

.header-text p {
	margin: 0;
	color: var(--muted);
	line-height: 1.5;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.panel-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--primary);
	color: #ffffff;
	text-decoration: none;
	padding: 0.6rem 1.25rem;
	border-radius: 999px;
	font-weight: 600;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.panel-link:hover,
.panel-link:focus {
	background: var(--primary-hover);
	transform: translateY(-1px);
}

.theme-toggle {
	background: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: 999px;
	padding: 0.25rem;
	width: 3.2rem;
	height: 1.8rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.theme-toggle:hover {
	border-color: var(--primary);
}

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

.theme-toggle .theme-icon {
	position: relative;
	width: 100%;
	height: 100%;
	display: block;
}

.theme-toggle .theme-icon::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: rgba(11, 114, 133, 0.25);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle .theme-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0.25rem;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: var(--primary);
	transform: translate(0, -50%);
	transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.theme-toggle[data-mode="dark"] .theme-icon::before {
	background: rgba(34, 211, 238, 0.25);
	box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.4);
}

.theme-toggle[data-mode="dark"] .theme-icon::after {
	background: var(--primary-hover);
	transform: translate(1.35rem, -50%);
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}

.theme-toggle:hover .theme-icon::before {
	box-shadow: inset 0 0 0 1px rgba(11, 114, 133, 0.35);
}

.theme-toggle[data-mode="dark"]:hover .theme-icon::before {
	box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45);
}

.theme-toggle:active .theme-icon::after {
	transform: translate(0.05rem, -50%) scale(0.95);
}

.theme-toggle[data-mode="dark"]:active .theme-icon::after {
	transform: translate(1.45rem, -50%) scale(0.95);
}

footer {
	text-align: center;
	padding: 1.5rem 1rem;
}

main {
	max-width: 780px;
	margin: 1.5rem auto 0;
	padding: 0 1rem 4rem;
	display: grid;
	gap: 1.5rem;
}

.card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	box-shadow: 0 12px 24px var(--shadow);
	border-radius: 16px;
	padding: 1.75rem;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card h2 {
	margin-top: 0;
}

.card .intro {
	margin: 0.5rem 0 1.5rem;
	color: var(--muted);
	line-height: 1.6;
	max-width: 640px;
}

.card form {
	max-width: 640px;
	width: 100%;
}

.form-group {
	margin-bottom: 1.25rem;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

input[type="text"],
textarea {
	width: 100%;
	padding: 0.75rem;
	border-radius: 10px;
	border: 1px solid var(--border);
	font-size: 1rem;
	background: var(--card-bg);
	color: var(--text);
	transition: all 0.2s ease;
}

input[type="text"]:focus,
textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.2);
}

textarea {
	resize: vertical;
}

.options {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.options label {
	font-weight: 500;
}

.captcha-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

#reloadCaptcha {
	background: none;
	border: 1px solid var(--primary);
	color: var(--primary);
	padding: 0.45rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

#reloadCaptcha:hover,
#reloadCaptcha:focus {
	background: var(--primary);
	color: #ffffff;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 1.5rem;
}

.form-actions button {
	background: var(--primary);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 140px;
}

.form-actions button:hover,
.form-actions button:focus {
	background: var(--primary-hover);
	transform: translateY(-1px);
}

.form-actions button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.notice {
	color: var(--muted);
	font-size: 0.95rem;
}

.message {
	margin-top: 1.5rem;
	padding: 0;
	border-radius: 10px;
	border: 1px solid transparent;
	transition: all 0.3s ease;
}

.message:not(:empty) {
	padding: 0.85rem 1.1rem;
	margin-bottom: 0.5rem;
}

.message.info {
	background: rgba(11, 114, 133, 0.12);
	border-color: rgba(11, 114, 133, 0.3);
	color: #0b7285;
}

[data-theme="dark"] .message.info {
	background: rgba(34, 211, 238, 0.15);
	border-color: rgba(34, 211, 238, 0.3);
	color: #67e8f9;
}

.message.success {
	background: rgba(16, 185, 129, 0.12);
	border-color: rgba(16, 185, 129, 0.35);
	color: #059669;
}

[data-theme="dark"] .message.success {
	background: rgba(16, 185, 129, 0.15);
	border-color: rgba(16, 185, 129, 0.3);
	color: #6ee7b7;
}

.message.error {
	background: rgba(239, 68, 68, 0.12);
	border-color: rgba(239, 68, 68, 0.35);
	color: #dc2626;
}

[data-theme="dark"] .message.error {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.3);
	color: #fca5a5;
}

.hidden {
	display: none;
}

.legal p {
	margin: 0.6rem 0;
	color: var(--muted);
}

.modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	font-family: inherit;
}

.modal.open {
	display: flex;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.modal-content {
	position: relative;
	max-width: 420px;
	width: calc(100% - 2rem);
	background: var(--card-bg);
	border-radius: 16px;
	border: 1px solid var(--border);
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
	padding: 1.75rem;
	z-index: 1;
	outline: none;
}

.modal-content h2 {
	margin-top: 0;
	margin-bottom: 0.75rem;
}

.modal-actions {
	margin-top: 1.5rem;
	display: flex;
	justify-content: flex-end;
}

.modal-close {
	background: var(--primary);
	color: #ffffff;
	border: none;
	border-radius: 999px;
	padding: 0.6rem 1.4rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
	background: var(--primary-hover);
	transform: translateY(-1px);
}

@media (max-width: 640px) {
	.header-content {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
		gap: 1.25rem;
	}

	.header-actions {
		flex-wrap: wrap;
	}

	.panel-link {
		width: 100%;
		justify-content: center;
	}

	.card {
		padding: 1.25rem;
	}

	.options {
		flex-direction: column;
		gap: 0.5rem;
	}

	.form-actions {
		justify-content: stretch;
	}

	.form-actions button {
		width: 100%;
	}
}
