/* ============================================================
   Yhteydenottolomake ([hb_yhteydenotto] / [hb_contact]) — korvaa
   "HB-yhteydenotto"-lisäosan assets/css/style.css:n. Ilmava lomake +
   kelluvat otsikot + pyörivä liukuvärirengas kortin ympärillä.

   HUOM (opittu Domainit-hakemiston CSS-bugista aiemmin projektissa):
   alkuperäisen lisäosan tyylitiedostossa oli sitä käyttäviä yleisiä
   selektoreita (esim. paljas "button{...}", ".field", ".chk", ".box",
   ".tick", ".txt") ilman omaa nimiavaruutta, koska se ladattiin vain
   lisäosan omalle lomakesivulle. Tässä teemassa site.css on ladattu
   JOKA sivulla, joten kaikki nämä on tarkoituksella skoopattu
   "#hbform"-esivalitsimella, jotta ne eivät vahingossa vaikuta mihinkään
   muuhun lomakkeeseen tai nappiin sivustolla.
   ============================================================ */

@property --hb-angle {
	syntax: '<angle>';
	inherits: false;
	initial-value: 0deg;
}

.hb-wrap {
	max-width: 520px;
	margin: auto;
	padding: 2px;
	border-radius: 22px;
	background: conic-gradient(from var(--hb-angle), #ff2a2a, #ff6a00, #ffb020, #ff2a2a 75%, #ff6a00);
	box-shadow: 0 25px 70px rgba(0, 0, 0, .55);
	animation: hb-ring 7s linear infinite;
}

@keyframes hb-ring {
	to { --hb-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
	.hb-wrap { animation: none; }
}

#hbform {
	background: #0a0a0a;
	padding: 42px 34px;
	border-radius: 20px;
	display: grid;
	gap: 20px;
}

.hb-head {
	display: grid;
	justify-items: center;
	gap: 8px;
	text-align: center;
	margin-bottom: 6px;
}

.hb-badge {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 20px;
	background: linear-gradient(135deg, #ff2a2a, #ff6a00);
	box-shadow: 0 10px 24px rgba(255, 42, 42, .35);
}

#hbform h2 {
	color: #fff;
	margin: 0;
	font-size: 1.55rem;
	letter-spacing: -.02em;
}

.hb-sub {
	margin: 0;
	color: #9b9b9b;
	font-size: .92rem;
	line-height: 1.5;
	max-width: 34ch;
}

/* Kelluvat otsikot: kentän nimi näkyy aina, ei katoa kun kirjoittaa. */
#hbform .field {
	position: relative;
}

#hbform .field input,
#hbform .field textarea {
	width: 100%;
	padding: 20px 16px 10px;
	background: #131313;
	color: #fff;
	border: 1.5px solid #262626;
	border-radius: 12px;
	font-size: 15px;
	transition: border-color .25s, box-shadow .25s, background .25s;
}

#hbform .field textarea {
	min-height: 110px;
	resize: vertical;
	padding-top: 22px;
}

#hbform .field label {
	position: absolute;
	left: 16px;
	top: 18px;
	color: #8a8a8a;
	font-size: 15px;
	pointer-events: none;
	transition: top .2s ease, font-size .2s ease, color .2s ease, letter-spacing .2s ease;
}

#hbform .field input:focus,
#hbform .field textarea:focus {
	outline: none;
	border-color: #ff2a2a;
	background: #161010;
	box-shadow: 0 0 0 4px rgba(255, 42, 42, .15);
}

#hbform .field input:focus + label,
#hbform .field input:not(:placeholder-shown) + label,
#hbform .field textarea:focus + label,
#hbform .field textarea:not(:placeholder-shown) + label {
	top: 7px;
	font-size: 11px;
	color: #ff5a3c;
	letter-spacing: .05em;
	text-transform: uppercase;
}

#hbform .chk {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #e6e6e6;
	position: relative;
	cursor: pointer;
	font-size: .92rem;
	line-height: 1.4;
}

#hbform .chk input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
}

#hbform .box {
	flex: none;
	width: 20px;
	height: 20px;
	border: 2px solid #ff2a2a;
	border-radius: 6px;
	position: relative;
	transition: .3s;
	overflow: hidden;
}

#hbform .box::before {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	background: rgba(255, 42, 42, 0.2);
	transform: scale(0);
	border-radius: 50%;
	transition: .4s;
}

#hbform .tick {
	position: absolute;
	inset: 0;
}

#hbform .tick::before,
#hbform .tick::after {
	content: "";
	position: absolute;
	height: 2px;
	width: 0;
	background: #fff;
	border-radius: 2px;
	transition: width .15s ease;
}

#hbform .tick::before {
	left: 4px;
	top: 11px;
	transform-origin: left center;
	transform: rotate(45deg);
}

#hbform .tick::after {
	left: 8px;
	top: 15px;
	transform-origin: left center;
	transform: rotate(-45deg);
}

#hbform .chk:hover .box {
	box-shadow: 0 0 12px rgba(255, 42, 42, 0.9);
	transform: scale(1.1);
}

#hbform .chk input:checked + .box {
	background: #ff2a2a;
	transform: scale(1.05);
}

#hbform .chk input:checked + .box::before {
	transform: scale(2);
	opacity: 0;
}

#hbform .chk input:checked + .box .tick::before {
	width: 6px;
	transition: width .15s ease .12s;
}

#hbform .chk input:checked + .box .tick::after {
	width: 13px;
	transition: width .2s ease .27s;
}

#hbform .txt { transition: .3s; }

#hbform button {
	width: 100%;
	padding: 15px;
	background: linear-gradient(45deg, #ff2a2a, #ff6a00);
	border: none;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	transition: .3s;
}

#hbform button .hb-arrow {
	transition: transform .3s ease;
}

#hbform button:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(255, 42, 42, .4);
}

#hbform button:hover .hb-arrow {
	transform: translateX(5px);
}

#hbform button:active {
	transform: translateY(-1px) scale(.99);
}

#hbform.is-loading {
	opacity: .6;
	pointer-events: none;
	transform: translateY(-2px);
	transition: .25s;
}
#hbform.is-loading button {
	position: relative;
}
#hbform.is-loading button::after {
	content: '';
	position: absolute;
	right: 16px; top: 50%;
	width: 16px; height: 16px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	transform: translateY(-50%);
	animation: hbspin .8s linear infinite;
}
@keyframes hbspin { to { transform: translateY(-50%) rotate(360deg); } }

.hb-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(20px);
	background: #111;
	color: #fff;
	padding: 12px 16px;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
	border: 1px solid rgba(255, 42, 42, .5);
	opacity: 0;
	transition: .3s;
	z-index: 9999;
}
.hb-toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.hb-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 480px) {
	#hbform { padding: 32px 22px; }
}
