/**
 * Torjujat: yhteydenotot (kieleke, paneeli, mobiilipalkki, pikalomake, tarjouspyyntösivu).
 */

/* ============================================================
 * VASEMMAN LAIDAN KIELEKE (työpöytä)
 * ============================================================ */
.tj-lead-tab {
	position: fixed;
	left: 0;
	top: 50%;
	z-index: 85;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 12px;
	writing-mode: vertical-rl;
	transform: translateY(-50%) rotate(180deg);
	background: var(--accent);
	color: var(--contrast);
	border: 0;
	/* Käännetty 180°: elementin vasen reuna näkyy ruudulla oikealla. */
	border-radius: var(--tj-radius) 0 0 var(--tj-radius);
	box-shadow: 0 10px 30px rgba(44, 44, 44, 0.22);
	font-family: "Kumbh Sans", "Poppins", sans-serif;
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: padding 0.25s var(--tj-ease), background-color 0.2s ease, box-shadow 0.25s var(--tj-ease);
	animation: tj-lead-tab-in 0.6s var(--tj-ease) 1.2s both;
}
.tj-lead-tab:hover,
.tj-lead-tab:focus-visible {
	padding-left: 18px;
	background: #f6b77d;
	box-shadow: 0 14px 36px rgba(44, 44, 44, 0.3);
}
.tj-lead-tab__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--accent-3);
	box-shadow: 0 0 0 0 rgba(101, 172, 146, 0.6);
	animation: tj-lead-pulse 2.4s ease-out infinite;
}
@keyframes tj-lead-tab-in {
	from { transform: translate(-100%, -50%) rotate(180deg); }
	to   { transform: translate(0, -50%) rotate(180deg); }
}
@keyframes tj-lead-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(101, 172, 146, 0.6); }
	70%  { box-shadow: 0 0 0 8px rgba(101, 172, 146, 0); }
	100% { box-shadow: 0 0 0 0 rgba(101, 172, 146, 0); }
}
html.tj-lead-lock .tj-lead-tab { opacity: 0; pointer-events: none; }

/* ============================================================
 * MOBIILIPALKKI
 * ============================================================ */
.tj-lead-bar {
	display: none;
}
@media (max-width: 900px) {
	.tj-lead-tab { display: none; }
	.tj-lead-bar {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 85;
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 8px;
		padding: 6px;
		background: rgba(255, 255, 255, 0.96);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-radius: var(--tj-radius-pill);
		box-shadow: 0 12px 34px rgba(20, 32, 28, 0.25);
		transform: translateY(140%);
		transition: transform 0.35s var(--tj-ease);
	}
	.tj-lead-bar.is-visible { transform: translateY(0); }
	html.tj-lead-lock .tj-lead-bar { transform: translateY(140%); }
	.tj-lead-bar__call,
	.tj-lead-bar__cta {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		min-height: 48px;
		padding: 0 18px;
		border-radius: var(--tj-radius-pill);
		font-weight: 700;
		font-size: 15px;
		border: 0;
		font-family: inherit;
	}
	.tj-lead-bar__call {
		background: var(--base);
		color: var(--contrast);
		border: 1.5px solid rgba(44, 44, 44, 0.12);
	}
	.tj-lead-bar__cta {
		background: var(--accent-3);
		color: #fff;
	}
	/* Popup palkin yläpuolelle */
	.tj-promo { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
 * PANEELI
 * ============================================================ */
html.tj-lead-lock { overflow: hidden; }

.tj-lead-backdrop {
	position: fixed;
	inset: 0;
	z-index: 190;
	background: rgba(20, 28, 25, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.tj-lead-backdrop.is-open { opacity: 1; }

.tj-lead-panel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 200;
	width: min(460px, 100vw);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--base-2);
	box-shadow: 24px 0 60px rgba(20, 32, 28, 0.25);
	padding: 32px 28px 28px;
	transform: translateX(-100%);
	transition: transform 0.32s var(--tj-ease);
}
.tj-lead-panel::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--accent-3), var(--accent));
}
.tj-lead-panel.is-open { transform: translateX(0); }

.tj-lead-panel__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--base);
	color: var(--contrast);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.tj-lead-panel__close:hover { background: rgba(44, 44, 44, 0.1); }
.tj-lead-panel__head { margin-bottom: 18px; padding-right: 40px; }
.tj-lead-panel__title { font-size: 28px; margin: 4px 0 6px; }
.tj-lead-panel__lead { font-size: 15px; opacity: 0.8; margin: 0; }
.tj-lead-panel__call {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
	padding: 14px 16px;
	border-radius: var(--tj-radius-sm);
	background: var(--base);
	font-size: 14px;
}
.tj-lead-panel__call a {
	font-weight: 800;
	font-size: 17px;
	color: var(--contrast);
}

@media (max-width: 900px) {
	.tj-lead-panel {
		top: auto;
		right: 0;
		width: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: var(--tj-radius-lg) var(--tj-radius-lg) 0 0;
		padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		transform: translateY(100%);
		box-shadow: 0 -20px 50px rgba(20, 32, 28, 0.25);
	}
	.tj-lead-panel.is-open { transform: translateY(0); }
	.tj-lead-panel__title { font-size: 24px; }
}

/* ============================================================
 * PIKALOMAKE
 * ============================================================ */
.tj-lead-form { display: grid; gap: 16px; margin: 0; color: var(--contrast); text-align: left; }
/* hidden-attribuutti voittaa aina komponenttien display-arvot */
.tj-lead-form [hidden],
.tj-lead-panel[hidden],
.tj-lead-backdrop[hidden] { display: none !important; }
.tj-lead-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.tj-lead-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px; overflow: hidden;
}
.tj-lead-form__label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	padding: 0;
	color: var(--contrast);
}
.tj-lead-form__opt { font-weight: 400; opacity: 0.6; }
.tj-lead-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.tj-lead-form--compact .tj-lead-form__grid { grid-template-columns: 1fr; gap: 12px; }
@media (max-width: 560px) {
	.tj-lead-form__grid { grid-template-columns: 1fr; }
}
.tj-lead-form input[type="text"],
.tj-lead-form input[type="tel"],
.tj-lead-form input[type="email"],
.tj-lead-form textarea {
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	font-size: 16px; /* estää iOS-zoomauksen */
	color: var(--contrast);
	background: #fff;
	border: 1.5px solid rgba(44, 44, 44, 0.18);
	border-radius: var(--tj-radius-sm);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tj-lead-form textarea { resize: vertical; min-height: 84px; }
.tj-lead-form input:focus,
.tj-lead-form textarea:focus {
	outline: none;
	border-color: var(--accent-3);
	box-shadow: 0 0 0 3px rgba(101, 172, 146, 0.2);
}
.tj-lead-form [aria-invalid="true"] { border-color: #d63638 !important; }

/* Valintanapit */
.tj-lead-form__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tj-lchip { position: relative; margin: 0; cursor: pointer; }
.tj-lchip input { position: absolute; opacity: 0; pointer-events: none; }
.tj-lchip span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	background: var(--base);
	border: 1.5px solid rgba(44, 44, 44, 0.14);
	border-radius: var(--tj-radius-pill);
	color: var(--contrast);
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.tj-lchip:hover span { border-color: var(--accent-3); }
.tj-lchip input:checked + span {
	background: var(--accent-3);
	border-color: var(--accent-3);
	color: #fff;
}
.tj-lchip input:focus-visible + span { outline: 3px solid var(--accent-3); outline-offset: 2px; }
.tj-lead-form__chips--small .tj-lchip span { padding: 7px 12px; font-size: 13px; }

/* Kuva */
.tj-lead-form__file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tj-lead-form__file-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	font-size: 14px;
	border: 1.5px dashed rgba(44, 44, 44, 0.25);
	border-radius: var(--tj-radius-sm);
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.tj-lead-form__file-btn:hover { border-color: var(--accent-3); background: rgba(188, 220, 208, 0.18); }
.tj-lead-form__file input:focus-visible + .tj-lead-form__file-btn,
.tj-lead-form__file:focus-within .tj-lead-form__file-btn { outline: 3px solid var(--accent-3); outline-offset: 2px; }
.tj-lead-form__file.has-file .tj-lead-form__file-btn { border-style: solid; border-color: var(--accent-3); background: rgba(188, 220, 208, 0.25); }

.tj-lead-form__error {
	margin: 0;
	padding: 10px 14px;
	font-size: 14px;
	color: #8a1f1f;
	background: #fdecec;
	border-radius: var(--tj-radius-sm);
}
.tj-lead-form__submit { width: 100%; justify-content: center; }
.tj-lead-form__submit[disabled] { opacity: 0.7; cursor: wait; }
.tj-lead-form__note { margin: -4px 0 0; font-size: 12.5px; line-height: 1.5; opacity: 0.7; }
.tj-lead-form__note a { color: inherit; text-decoration: underline; }

.tj-lead-form__success { text-align: center; padding: 24px 8px; outline: none; }
.tj-lead-form__success-icon {
	width: 56px; height: 56px;
	margin: 0 auto 14px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--accent-3);
	color: #fff;
	font-size: 28px;
	font-weight: 800;
}
.tj-lead-form__success h3 { margin-bottom: 8px; }
.tj-lead-form__success p { font-size: 15px; opacity: 0.85; }

/* Popupin nappi on nyt <button> */
button.tj-promo__cta { border: 0; cursor: pointer; font-family: inherit; }

/* Etusivun lomake: valkoinen kortti tummalla taustalla */
.tj-front-contact__form .tj-lead-form {
	background: var(--base-2);
	padding: clamp(22px, 3vw, 36px);
	border-radius: var(--tj-radius);
	box-shadow: var(--tj-shadow);
	border: 1px solid rgba(44, 44, 44, 0.06);
}
.tj-front-contact .tj-lead-form__grid,
.tj-tarjous .tj-lead-form__grid { grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) {
	.tj-front-contact .tj-lead-form__grid,
	.tj-tarjous .tj-lead-form__grid { grid-template-columns: 1fr; }
}
.tj-front-contact .tj-lead-form__note a { color: inherit; }

/* ============================================================
 * TARJOUSPYYNTÖSIVU
 * ============================================================ */
.tj-tarjous-hero {
	padding: clamp(110px, 12vw, 150px) 0 clamp(28px, 4vw, 44px);
	background: linear-gradient(180deg, rgba(188, 220, 208, 0.45) 0%, var(--base) 100%);
}
.tj-tarjous-hero__title { max-width: 18ch; }
.tj-tarjous-hero__title em { font-style: normal; color: var(--accent-3); }
.tj-tarjous-hero__lead { max-width: 60ch; font-size: 18px; opacity: 0.85; }
.tj-tarjous-hero__points {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	list-style: none;
	padding: 0;
	margin: 18px 0 0;
	font-size: 15px;
	font-weight: 600;
}
.tj-tarjous-hero__points li { margin: 0; display: flex; align-items: center; gap: 8px; }
.tj-tarjous-hero__points li::before {
	content: "✓";
	display: grid; place-items: center;
	width: 22px; height: 22px;
	border-radius: 50%;
	background: var(--accent-3);
	color: #fff;
	font-size: 12px;
}

.tj-tarjous { padding-top: 0; }
.tj-tarjous__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: clamp(24px, 4vw, 48px);
	align-items: start;
}
@media (max-width: 980px) {
	.tj-tarjous__grid { grid-template-columns: minmax(0, 1fr); }
}
.tj-tarjous__card {
	background: #fff;
	border-radius: var(--tj-radius-lg);
	box-shadow: var(--tj-shadow);
	padding: clamp(22px, 3.5vw, 40px);
}
.tj-tarjous__aside { display: grid; gap: 16px; position: sticky; top: 110px; }
@media (max-width: 980px) { .tj-tarjous__aside { position: static; } }
.tj-tarjous__box {
	background: #fff;
	border-radius: var(--tj-radius);
	padding: 22px;
	box-shadow: var(--tj-shadow-xs);
}
.tj-tarjous__box h3 { font-size: 18px; margin-bottom: 8px; }
.tj-tarjous__box p { font-size: 14.5px; margin-bottom: 6px; }
.tj-tarjous__box a[href^="tel:"] { font-size: 20px; font-weight: 800; color: var(--contrast); }
.tj-tarjous__box--accent { background: var(--contrast); color: #fff; }
.tj-tarjous__box--accent h3 { color: #fff; }
.tj-tarjous__box--accent a[href^="tel:"] { color: var(--accent); }
.tj-tarjous__steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.tj-tarjous__steps li { counter-increment: s; position: relative; padding-left: 36px; font-size: 14.5px; margin-bottom: 12px; }
.tj-tarjous__steps li::before {
	content: counter(s);
	position: absolute; left: 0; top: 0;
	width: 24px; height: 24px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--accent);
	font-size: 12px; font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
	.tj-lead-tab, .tj-lead-tab__dot { animation: none; }
	.tj-lead-panel, .tj-lead-bar, .tj-lead-backdrop { transition: none; }
}

