/* ==========================================================================
   RES Flugsuche — flight search landing template
   Light/dark themes are switched via the [data-res-theme] attribute on <html>.
   Desktop and mobile layouts are handled with media queries.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
	/* Layout */
	--res-max-width: 1320px;
	--res-radius: 16px;

	/* Typography */
	--res-font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

/* Light theme (default) */
html[data-res-theme="light"] {
	--res-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.04) 100%);
	--res-heading-color: #ffffff;
	--res-heading-shadow: 0 2px 18px rgba(8, 30, 63, 0.45);

	--res-toggle-bg: #ffffff;
	--res-toggle-color: #1f3a93;
	--res-toggle-border: rgba(255, 255, 255, 0.9);
	--res-toggle-shadow: 0 6px 18px rgba(8, 30, 63, 0.25);

	--res-panel-bg: rgba(255, 255, 255, 0.96);
	--res-panel-shadow: 0 24px 60px rgba(8, 30, 63, 0.22);

	/* Footer */
	--res-footer-bg: rgba(8, 30, 63, 0.38);
	--res-footer-text: rgba(255, 255, 255, 0.9);
	--res-footer-link: #ffffff;
	--res-footer-border: rgba(255, 255, 255, 0.18);
}

/* Dark theme */
html[data-res-theme="dark"] {
	--res-overlay: linear-gradient(180deg, rgba(7, 16, 33, 0.62) 0%, rgba(7, 16, 33, 0.82) 100%);
	--res-heading-color: #f4f8ff;
	--res-heading-shadow: 0 2px 22px rgba(0, 0, 0, 0.55);

	--res-toggle-bg: #16233d;
	--res-toggle-color: #ffd56b;
	--res-toggle-border: rgba(255, 255, 255, 0.14);
	--res-toggle-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);

	--res-panel-bg: rgba(18, 30, 52, 0.86);
	--res-panel-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

	/* Footer */
	--res-footer-bg: rgba(7, 16, 33, 0.6);
	--res-footer-text: rgba(244, 248, 255, 0.82);
	--res-footer-link: #ffd56b;
	--res-footer-border: rgba(255, 255, 255, 0.1);
}

/* ---------- Page reset (scoped to this template) ---------- */
body.res-flugsuche-body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	font-family: var(--res-font);
	background: #0a1c3a;
	overflow-x: hidden;
}

body.res-flugsuche-body * {
	box-sizing: border-box;
}

.res-page {
	position: relative;
	min-height: 100vh;
	width: 100%;
	/* Column layout so the footer can be pinned to the bottom */
	display: flex;
	flex-direction: column;
}

/* ---------- Background & overlay ---------- */
.res-bg {
	position: fixed;
	inset: 0;
	background-image: var(--res-bg);
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
	z-index: 0;
}

.res-overlay {
	position: fixed;
	inset: 0;
	background: var(--res-overlay);
	z-index: 1;
	/* Smooth transition when toggling themes */
	transition: background 0.35s ease;
}

/* ---------- Top bar ---------- */
.res-topbar {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 22px 28px 0;
}

.res-logo {
	display: inline-flex;
	line-height: 0;
}

.res-logo img {
	width: 86px;
	height: auto;
	border-radius: 8px;
	display: block;
}

.res-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	cursor: pointer;
	border-radius: 12px;
	border: 1px solid var(--res-toggle-border);
	background: var(--res-toggle-bg);
	color: var(--res-toggle-color);
	box-shadow: var(--res-toggle-shadow);
	transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

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

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

.res-theme-toggle:focus-visible {
	outline: 3px solid rgba(120, 170, 255, 0.7);
	outline-offset: 2px;
}

.res-icon {
	display: block;
}

/* Show the moon in light mode and the sun in dark mode */
html[data-res-theme="light"] .res-icon-sun {
	display: none;
}

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

/* ---------- Hero ---------- */
.res-hero {
	position: relative;
	z-index: 2;
	max-width: 90%;
	width: 100%;
	margin: 0 auto;
	padding: 0; /* fixed: was malformed "padding: 0px 0px 0px" without a value */
	text-align: center;
}

.res-heading {
	margin: 60px 0 80px;
	color: var(--res-heading-color);
	font-weight: 600;
	font-size: 40px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-shadow: var(--res-heading-shadow);
	transition: color 0.35s ease;
	text-align: center;
}

/* ---------- Iframe panel ---------- */
.res-iframe-wrap {
	position: relative;
	/* Pulls the search box up over the hero, matching the reference layout */
	margin-top: -60px;
	border-radius: var(--res-radius);
	background: var(--res-panel-bg);
	box-shadow: var(--res-panel-shadow);
	overflow: hidden;
	transition: background 0.35s ease, box-shadow 0.35s ease;
}

.res-iframe {
	display: block;
	width: 100%;
	min-height: 100vh;
	border: none;
	background: transparent;
}

/* ---------- Footer (narrow) ---------- */
.res-footer {
	position: relative;
	z-index: 2;
	/* Push to the bottom when the page content is shorter than the viewport */
	margin-top: auto;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 8px 20px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--res-footer-text);
	background: var(--res-footer-bg);
	border-top: 1px solid var(--res-footer-border);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: background 0.35s ease, color 0.35s ease;
}

.res-footer__center {
	grid-column: 2;
	text-align: center;
}

.res-footer__right {
	grid-column: 3;
	text-align: right;
}

.res-footer a {
	color: var(--res-footer-link);
	text-decoration: none;
}

.res-footer a:hover,
.res-footer a:focus-visible {
	text-decoration: underline;
}

/* ==========================================================================
   Responsive — tablet
   ========================================================================== */
@media (max-width: 1024px) {
	.res-hero {
		padding: 0 18px;
	}

	.res-heading {
		margin-bottom: 110px;
	}
}

/* ==========================================================================
   Responsive — mobile
   ========================================================================== */
@media (max-width: 640px) {
	.res-topbar {
		padding: 16px 16px 0;
	}

	.res-logo img {
		width: 64px;
	}

	.res-theme-toggle {
		width: 40px;
		height: 40px;
	}

	.res-hero {
		padding: 0 12px;
	}

	.res-heading {
		font-size: clamp(24px, 7vw, 34px);
		margin: 40px 0 64px;
	}

	.res-iframe-wrap {
		/* Less overlap on small screens so nothing gets clipped */
		margin-top: -32px;
		border-radius: 14px;
	}

	.res-iframe {
		/* The stacked mobile form needs more vertical room */
		min-height: 720px;
	}

	.res-footer {
		padding: 8px 14px;
		font-size: 11px;
		gap: 8px;
	}
}

/* ==========================================================================
   Accessibility — respect reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.res-overlay,
	.res-heading,
	.res-theme-toggle,
	.res-iframe-wrap,
	.res-footer {
		transition: none;
	}
}