/*
 * PTH Reisplanner Widget styling.
 * All selectors are scoped under .pthrw with raised specificity so host-theme
 * rules on input/button/ul/li/svg cannot bleed in. The widget inherits the
 * site's font for a native feel.
 *
 * Brand: matches the /treinticket planner — blue #0060ac / #1da3dd, primary CTA
 * uses the planner's gradient (#1da3dd -> #0060ac). An optional --pthrw-accent
 * (set via the accent_color setting / inline style in render.php) overrides the
 * button with a solid colour.
 */
.pthrw {
	--pthrw-blue: #0060ac;
	--pthrw-blue-light: #1da3dd;
	--pthrw-ink: #17324a;
	--pthrw-border: #dbe3ea;
	--pthrw-radius: 8px;
	--pthrw-radius-lg: calc(var(--pthrw-radius) + 4px);

	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	font-family: inherit;
	line-height: 1.4;
	color: var(--pthrw-ink);
	-webkit-font-smoothing: antialiased;
}

/* --- Scoped resets so the host theme cannot leak in --- */
.pthrw *,
.pthrw *::before,
.pthrw *::after {
	box-sizing: border-box;
}

.pthrw h2,
.pthrw p,
.pthrw ul,
.pthrw li,
.pthrw label,
.pthrw span {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	text-transform: none;
	letter-spacing: normal;
}

.pthrw ul,
.pthrw li {
	list-style: none;
}

.pthrw button {
	margin: 0;
	font-family: inherit;
	line-height: 1;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.pthrw input {
	margin: 0;
	font-family: inherit;
	color: var(--pthrw-ink);
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.pthrw svg {
	display: block;
	flex: 0 0 auto;
}

/* --- Layout --- */
.pthrw .pthrw__inner {
	max-width: 760px;
	margin: 0 auto;
}

/* Dark (banner) theme */
.pthrw--dark {
	background: #0b2b45;
	background-image: linear-gradient(120deg, #0a2540 0%, #0060ac 118%);
	border-radius: var(--pthrw-radius-lg);
	padding: 34px 30px;
}

.pthrw--dark .pthrw__heading {
	color: #ffffff;
}

.pthrw--dark .pthrw__sub {
	color: #cfe0ee;
}

.pthrw--dark .pthrw__badge {
	background: rgba(29, 163, 221, 0.2);
	color: #9bd7f1;
}

.pthrw--dark .pthrw__foot {
	color: #9fbdd6;
}

/* Light theme */
.pthrw--light {
	padding: 6px 0;
}

.pthrw--light .pthrw__heading {
	color: #0b2b45;
}

.pthrw--light .pthrw__sub {
	color: #4a6072;
}

.pthrw--light .pthrw__badge {
	background: rgba(0, 96, 172, 0.1);
	color: #0060ac;
}

.pthrw--light .pthrw__foot {
	color: #6b8296;
}

/* --- Header bits --- */
.pthrw .pthrw__badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	padding: 6px 13px;
	border-radius: 999px;
	margin-bottom: 16px;
}

.pthrw .pthrw__badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.pthrw .pthrw__heading {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.15;
	margin-bottom: 8px;
	letter-spacing: -0.01em;
}

.pthrw .pthrw__sub {
	font-size: 16px;
	line-height: 1.45;
	margin-bottom: 22px;
}

/* --- Form card --- */
.pthrw .pthrw__form {
	background: #ffffff;
	border-radius: var(--pthrw-radius-lg);
	padding: 18px;
	box-shadow: 0 18px 40px rgba(9, 33, 56, 0.18);
}

.pthrw .pthrw__row {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.pthrw .pthrw__row--submit {
	margin-top: 14px;
}

.pthrw .pthrw__field {
	flex: 1 1 0;
	min-width: 0;
}

.pthrw .pthrw__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #5a7288;
	margin-bottom: 6px;
}

.pthrw .pthrw__control {
	position: relative;
	display: flex;
	align-items: center;
}

.pthrw .pthrw__icon {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--pthrw-blue);
	display: inline-flex;
	pointer-events: none;
	z-index: 1;
}

.pthrw .pthrw__input {
	width: 100%;
	height: 48px;
	border: 1px solid var(--pthrw-border);
	border-radius: var(--pthrw-radius);
	padding: 0 14px;
	font-size: 15px;
	color: var(--pthrw-ink);
	background: #ffffff;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.pthrw .pthrw-from,
.pthrw .pthrw-to {
	padding-left: 40px;
}

.pthrw .pthrw__input:hover {
	border-color: #b8c6d2;
}

.pthrw .pthrw__input:focus {
	border-color: var(--pthrw-blue-light);
	box-shadow: 0 0 0 3px rgba(29, 163, 221, 0.2);
}

.pthrw .pthrw__input::placeholder {
	color: #9aa7b4;
	opacity: 1;
}

/* Swap button */
.pthrw .pthrw__swap {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border: 1px solid var(--pthrw-border);
	background: #f4f8fb;
	border-radius: var(--pthrw-radius);
	color: var(--pthrw-blue);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pthrw .pthrw__swap:hover {
	background: #eaf4fc;
	border-color: var(--pthrw-blue-light);
}

/* Submit button — matches the planner's primary gradient (#1da3dd -> #0060ac).
   Set --pthrw-accent (via the settings / accent_color) to use a solid colour instead. */
.pthrw .pthrw__submit {
	flex: 0 0 auto;
	height: 48px;
	border: 0;
	border-radius: var(--pthrw-radius);
	background: var(--pthrw-accent, linear-gradient(to right, var(--pthrw-blue-light), var(--pthrw-blue)));
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	padding: 0 24px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	white-space: nowrap;
	box-shadow: 0 8px 18px rgba(0, 96, 172, 0.28);
	transition: opacity 0.15s, transform 0.06s, box-shadow 0.15s;
}

.pthrw .pthrw__submit:hover {
	opacity: 0.92;
}

.pthrw .pthrw__submit:active {
	transform: translateY(1px);
	box-shadow: 0 3px 10px rgba(0, 96, 172, 0.28);
}

.pthrw .pthrw__submit svg {
	transition: transform 0.15s;
}

.pthrw .pthrw__submit:hover svg {
	transform: translateX(2px);
}

/* Footer hint */
.pthrw .pthrw__foot {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	margin-top: 14px;
}

/* Error */
.pthrw .pthrw__error {
	display: flex;
	align-items: center;
	margin-top: 14px;
	font-size: 13px;
	color: #b32d2e;
	background: #fdecea;
	border-radius: var(--pthrw-radius);
	padding: 9px 13px;
}

.pthrw .pthrw__error[hidden] {
	display: none;
}

/* --- Suggestions dropdown --- */
.pthrw .pthrw__suggestions {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 60;
	margin: 0;
	padding: 6px;
	background: #ffffff;
	border: 1px solid #e6ecf2;
	border-radius: var(--pthrw-radius-lg);
	box-shadow: 0 16px 34px rgba(9, 33, 56, 0.22);
	max-height: 264px;
	overflow-y: auto;
}

.pthrw .pthrw__suggestions[hidden] {
	display: none;
}

.pthrw .pthrw__suggestion {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 12px;
	font-size: 14.5px;
	color: #29435c;
	border-radius: var(--pthrw-radius);
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pthrw .pthrw__suggestion::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230060ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 12-9 12s-9-5-9-12a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center;
	opacity: 0.65;
}

.pthrw .pthrw__suggestion:hover,
.pthrw .pthrw__suggestion.is-active {
	background: #eef7fd;
	color: var(--pthrw-blue);
}

/* --- Glass (frosted) variant --- */
.pthrw--glass .pthrw__form {
	background: rgba(255, 255, 255, 0.14);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border: 1px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 20px 50px rgba(9, 33, 56, 0.3);
}

.pthrw--glass .pthrw__input {
	background: rgba(255, 255, 255, 0.95);
	border-color: rgba(255, 255, 255, 0.55);
}

.pthrw--glass .pthrw__swap {
	background: rgba(255, 255, 255, 0.88);
	border-color: rgba(255, 255, 255, 0.55);
}

.pthrw--glass.pthrw--dark .pthrw__label {
	color: #e6eef6;
}

.pthrw--glass .pthrw__suggestions {
	background: rgba(255, 255, 255, 0.98);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

/* --- Responsive --- */
@media (max-width: 680px) {
	.pthrw--dark {
		padding: 24px 18px;
	}

	.pthrw .pthrw__heading {
		font-size: 24px;
	}

	.pthrw .pthrw__row {
		flex-wrap: wrap;
	}

	.pthrw .pthrw__row--stations .pthrw__field {
		flex: 1 1 100%;
	}

	.pthrw .pthrw__swap {
		order: 3;
		width: 100%;
		height: 40px;
	}

	.pthrw .pthrw__row--stations .pthrw__field--from {
		order: 1;
	}

	.pthrw .pthrw__row--stations .pthrw__field--to {
		order: 2;
	}

	.pthrw .pthrw__swap svg {
		transform: rotate(90deg);
	}

	.pthrw .pthrw__row--submit .pthrw__field {
		flex: 1 1 45%;
	}

	.pthrw .pthrw__submit {
		flex: 1 1 100%;
		justify-content: center;
		margin-top: 4px;
	}
}
