/* FhuluTech Assistant widget — matches the craft-studio theme. */

.fta {
	--fta-paper: #fbf6ec;
	--fta-cream: #f3ead9;
	--fta-ink: #1a2b22;
	--fta-green: #1f5b41;
	--fta-terra: #e4572e;
	--fta-gold: #f4b942;
	--fta-line: rgba(26, 43, 34, 0.92);
	display: flex;
	flex-direction: column;
	height: 560px;
	max-height: 78vh;
	background: var(--fta-paper);
	border: 2px solid var(--fta-line);
	border-radius: 16px;
	overflow: hidden;
	font-family: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
	font-size: 15px;
	color: var(--fta-ink);
}

/* Header */
.fta__head {
	display: flex; align-items: center; gap: 10px;
	background: var(--fta-green); color: var(--fta-paper);
	padding: 12px 16px;
	border-bottom: 2px solid var(--fta-line);
}
.fta__head strong { display: block; font-size: 0.98rem; line-height: 1.2; }
.fta__head small { opacity: 0.75; font-size: 0.75rem; }
.fta__ava { position: relative; flex: none; width: 38px; height: 38px; }
.fta__ava img {
	width: 38px; height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 1.5px solid rgba(251, 246, 236, 0.75);
	display: block;
}
.fta__dot {
	width: 10px; height: 10px; border-radius: 50%;
	background: #7ee2a8;
	box-shadow: 0 0 0 0 rgba(126, 226, 168, 0.7);
	animation: fta-pulse 2s infinite;
	flex: none;
	position: absolute; right: -1px; bottom: -1px;
	border: 2px solid var(--fta-green);
	box-sizing: content-box;
}
@keyframes fta-pulse {
	0% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0.6); }
	70% { box-shadow: 0 0 0 8px rgba(126, 226, 168, 0); }
	100% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0); }
}
.fta__title { min-width: 0; }
.fta__human {
	margin-left: auto;
	color: var(--fta-gold);
	font-weight: 700; font-size: 0.8rem;
	text-decoration: underline; text-underline-offset: 3px;
	white-space: nowrap;
}

/* Header window controls */
.fta__btns { display: flex; gap: 6px; flex: none; }
.fta__hbtn {
	display: grid; place-items: center;
	width: 28px; height: 28px;
	border-radius: 8px;
	border: 1.5px solid rgba(251, 246, 236, 0.45);
	background: rgba(251, 246, 236, 0.12);
	color: var(--fta-paper);
	cursor: pointer;
	transition: background 0.12s ease;
}
.fta__hbtn:hover { background: rgba(251, 246, 236, 0.28); }
.fta--docked .fta__hbtn--popout { display: none; }

@media (max-width: 480px) {
	.fta__human { display: none; }
	.fta__hbtn--expand { display: none; }
}

/* Log */
.fta__log {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.fta-msg {
	max-width: 86%;
	padding: 11px 15px;
	border: 1.5px solid var(--fta-line);
	border-radius: 16px;
	line-height: 1.5;
	animation: fta-pop 0.22s ease;
}
@keyframes fta-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: none; }
}
.fta-msg--bot {
	align-self: flex-start;
	background: #fff;
	border-bottom-left-radius: 4px;
	box-shadow: 3px 3px 0 rgba(26, 43, 34, 0.12);
}
.fta-msg--user {
	align-self: flex-end;
	background: var(--fta-green);
	color: var(--fta-paper);
	border-bottom-right-radius: 4px;
}
.fta-msg a { color: var(--fta-terra); font-weight: 700; }
.fta-msg small { color: #6b7a70; }

/* Typing dots */
.fta-typing { display: flex; gap: 5px; padding: 14px 16px; }
.fta-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--fta-green);
	animation: fta-bounce 1.1s infinite;
}
.fta-typing span:nth-child(2) { animation-delay: 0.15s; }
.fta-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fta-bounce {
	0%, 60%, 100% { transform: none; opacity: 0.4; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* Option chips */
.fta-options {
	display: flex; flex-wrap: wrap; gap: 8px;
	align-self: flex-start;
	max-width: 95%;
	animation: fta-pop 0.25s ease;
}
.fta-chip {
	font: inherit; font-weight: 600; font-size: 0.92rem;
	background: var(--fta-cream);
	color: var(--fta-ink);
	border: 1.5px solid var(--fta-line);
	border-radius: 999px;
	padding: 9px 16px;
	cursor: pointer;
	box-shadow: 2.5px 2.5px 0 rgba(26, 43, 34, 0.85);
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
	text-align: left;
}
.fta-chip:hover:not(:disabled) {
	transform: translate(-1.5px, -1.5px);
	box-shadow: 4px 4px 0 rgba(26, 43, 34, 0.85);
	background: #fff;
}
.fta-chip:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(26, 43, 34, 0.85); }
.fta-chip:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.fta-chip.is-picked {
	background: var(--fta-terra); color: #fff;
	opacity: 1 !important;
}
.fta-chip--done { background: var(--fta-gold); font-weight: 800; }
.fta-options.is-done .fta-chip:not(.is-picked) { box-shadow: none; }

/* Inline forms */
.fta-inline-form, .fta-contact {
	display: flex; flex-direction: column; gap: 8px;
	align-self: flex-start;
	width: 92%;
	background: var(--fta-cream);
	border: 1.5px dashed var(--fta-line);
	border-radius: 14px;
	padding: 12px;
	animation: fta-pop 0.25s ease;
}
.fta-inline-form.is-done, .fta-contact.is-done { opacity: 0.55; pointer-events: none; }

.fta-text {
	font: inherit;
	border: 1.5px solid var(--fta-line);
	border-radius: 10px;
	padding: 10px 12px;
	background: #fff;
	resize: none;
	width: 100%;
}
.fta-text:focus { outline: 2.5px solid var(--fta-terra); outline-offset: 1px; }

.fta-file { font-size: 0.85rem; }
.fta-upload-status { font-size: 0.85rem; font-weight: 600; color: var(--fta-green); min-height: 1.2em; }

.fta-hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }

.fta-contact__how span { font-size: 0.85rem; font-weight: 700; }
.fta-options--inline { align-self: stretch; }
.fta-contact__send { text-align: center; font-size: 1rem; }
.fta-contact__err { color: #b3261e; font-size: 0.85rem; font-weight: 600; min-height: 1.1em; }

/* Estimate card */
.fta-estimate {
	align-self: stretch;
	background: var(--fta-ink);
	color: var(--fta-paper);
	border: 2px solid var(--fta-line);
	border-radius: 16px;
	padding: 18px;
	box-shadow: 4px 4px 0 rgba(228, 87, 46, 0.85);
	animation: fta-pop 0.3s ease;
}
.fta-estimate__label {
	font-size: 0.72rem; font-weight: 800;
	letter-spacing: 0.18em; text-transform: uppercase;
	color: var(--fta-gold);
}
.fta-estimate__range {
	font-family: "Fraunces", Georgia, serif;
	font-weight: 700; font-size: 1.9rem;
	margin: 6px 0 4px;
}
.fta-estimate__sum { font-size: 0.88rem; opacity: 0.85; }
.fta-estimate__note {
	margin-top: 12px; padding-top: 12px;
	border-top: 1px solid rgba(251, 246, 236, 0.25);
	font-size: 0.82rem; opacity: 0.8; line-height: 1.5;
}

/* Input bar */
.fta__bar {
	display: flex; gap: 8px;
	padding: 10px;
	border-top: 2px solid var(--fta-line);
	background: #fff;
	margin: 0;
}
.fta__bar input {
	flex: 1;
	font: inherit;
	border: 1.5px solid var(--fta-line);
	border-radius: 999px;
	padding: 10px 16px;
	background: var(--fta-paper);
}
.fta__bar input:focus { outline: 2.5px solid var(--fta-terra); outline-offset: 1px; }
.fta__bar button {
	font-size: 1.05rem;
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 1.5px solid var(--fta-line);
	background: var(--fta-terra);
	color: #fff;
	cursor: pointer;
	box-shadow: 2.5px 2.5px 0 rgba(26, 43, 34, 0.85);
	transition: transform 0.12s ease;
}
.fta__bar button:hover { transform: translate(-1px, -1px); }

/* Minimised floating bubble (bottom-left) */
.fta-launcher {
	position: fixed; left: 22px; bottom: 22px; z-index: 95;
	width: 62px; height: 62px;
	border-radius: 50%;
	display: grid; place-items: center;
	color: #fff;
	background: var(--fta-terra, #e4572e);
	border: 2px solid rgba(26, 43, 34, 0.92);
	box-shadow: 4px 4px 0 rgba(26, 43, 34, 0.92);
	cursor: pointer;
	transition: transform 0.15s ease;
}
.fta-launcher:hover { transform: translate(-2px, -2px) rotate(-6deg); }
.fta-launcher[hidden] { display: none; }

/* Docked chat (bottom-left, fixed) */
.fta-dock {
	position: fixed; left: 22px; bottom: 22px; z-index: 95;
	width: 400px; max-width: calc(100vw - 32px);
	display: none;
	filter: drop-shadow(8px 8px 0 rgba(26, 43, 34, 0.35));
	animation: fta-pop 0.25s ease;
}
.fta-dock.is-open { display: block; }
.fta-dock .fta { height: 560px; max-height: 74vh; }

.fta-dock--big { width: 640px; }
.fta-dock--big .fta { height: 80vh; max-height: 80vh; }

/* "Chat moved to the corner" card left behind in the hero */
.fta-placeholder {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 10px; text-align: center;
	min-height: 320px;
	padding: 28px;
	border: 2px dashed rgba(26, 43, 34, 0.45);
	border-radius: 16px;
	color: var(--fta-ink, #1a2b22);
	background: rgba(251, 246, 236, 0.6);
	font-family: "Schibsted Grotesk", sans-serif;
}
.fta-placeholder[hidden] { display: none; }
.fta-placeholder strong { font-size: 1.05rem; }
.fta-placeholder span { font-size: 0.92rem; opacity: 0.75; }
.fta-placeholder .fta-chip { margin-top: 6px; }

body.fta-lock { overflow: hidden; }

@media (max-width: 760px) {
	.fta { font-size: 14.5px; }
	.fta-launcher { left: 14px; bottom: 14px; }
	.fta-dock {
		left: 0; right: 0; bottom: 0;
		width: 100%; max-width: 100%;
		filter: none;
	}
	.fta-dock .fta, .fta-dock--big .fta {
		height: 93dvh; max-height: 93dvh;
		border-radius: 18px 18px 0 0;
		border-left: none; border-right: none; border-bottom: none;
		box-shadow: 0 -6px 30px rgba(26, 43, 34, 0.35);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fta-msg, .fta-options, .fta-inline-form, .fta-contact, .fta-estimate, .fta-panel { animation: none; }
	.fta__dot { animation: none; }
	.fta__log { scroll-behavior: auto; }
}
