/**
 * HRMG intake chat modal. Brand-consistent with hrmg-portfolio — the ember/ink/
 * paper palette is inlined here so the widget stands alone even on pages that do
 * not load portfolio.css.
 */
.hrmg-intake-overlay {
	--hrmg-ember: #F15A29;
	--hrmg-ink: #14161C;
	--hrmg-ink-2: #464C5A;
	--hrmg-ink-3: #8A90A0;
	--hrmg-paper: #FFFFFF;
	--hrmg-paper-2: #F8F6F3;
	--hrmg-line: #E7E3DD;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 24px;
	background: rgba(20, 22, 28, 0.55);
	font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
.hrmg-intake-overlay[hidden] { display: none; }

.hrmg-intake-panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 420px;
	max-height: min(680px, calc(100vh - 48px));
	background: var(--hrmg-paper);
	color: var(--hrmg-ink);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(20, 22, 28, 0.35);
	overflow: hidden;
}

.hrmg-intake-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	background: var(--hrmg-ink);
	color: #fff;
	flex: 0 0 auto;
}
.hrmg-intake-title {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.hrmg-intake-close {
	appearance: none;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.8;
}
.hrmg-intake-close:hover { opacity: 1; }

/* ---- Gate ---- */
.hrmg-intake-gate {
	padding: 20px 18px 22px;
	overflow-y: auto;
}
.hrmg-intake-intro {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--hrmg-ink-2);
}
.hrmg-intake-field { margin-bottom: 12px; }
.hrmg-intake-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--hrmg-ink-2);
	margin-bottom: 5px;
}
.hrmg-intake-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	font-size: 14px;
	color: var(--hrmg-ink);
	background: var(--hrmg-paper-2);
	border: 1px solid var(--hrmg-line);
	border-radius: 8px;
}
.hrmg-intake-field input:focus {
	outline: none;
	border-color: var(--hrmg-ember);
	box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.15);
}

/* Honeypot — off-screen, never shown to a human. */
.hrmg-intake-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.hrmg-intake-gate-msg {
	min-height: 0;
	margin: 4px 0 12px;
	font-size: 12.5px;
	color: #b3261e;
}
.hrmg-intake-gate-msg:empty { margin: 0; }

.hrmg-intake-btn {
	appearance: none;
	border: 0;
	width: 100%;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--hrmg-ink);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.hrmg-intake-btn:hover { background: var(--hrmg-ember); }
.hrmg-intake-btn--sm {
	width: auto;
	padding: 8px 14px;
	font-size: 13px;
}

/* ---- Thread ---- */
.hrmg-intake-thread {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}
.hrmg-intake-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--hrmg-paper-2);
}
.hrmg-intake-bubble {
	max-width: 85%;
	padding: 10px 13px;
	font-size: 13.5px;
	line-height: 1.5;
	border-radius: 12px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.hrmg-intake-bubble.is-user {
	align-self: flex-end;
	background: var(--hrmg-ink);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.hrmg-intake-bubble.is-assistant {
	align-self: flex-start;
	background: var(--hrmg-paper);
	color: var(--hrmg-ink);
	border: 1px solid var(--hrmg-line);
	border-bottom-left-radius: 4px;
}
.hrmg-intake-bubble.is-error {
	background: #fdeceb;
	border-color: #f3c6c2;
	color: #8a1c1c;
}
.hrmg-intake-bubble a {
	color: var(--hrmg-ember);
	text-decoration: underline;
}
.hrmg-intake-bubble strong { font-weight: 600; }

/* Cards (structured, DOM-built) */
.hrmg-intake-cards {
	align-self: flex-start;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}
.hrmg-intake-card {
	background: var(--hrmg-paper);
	border: 1px solid var(--hrmg-line);
	border-left: 3px solid var(--hrmg-ember);
	border-radius: 10px;
	padding: 11px 13px;
}
.hrmg-intake-card__title {
	font-size: 13px;
	font-weight: 600;
	color: var(--hrmg-ink);
	margin-bottom: 3px;
}
.hrmg-intake-card__problem {
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--hrmg-ink-2);
}
.hrmg-intake-card__link {
	display: inline-block;
	margin-top: 7px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--hrmg-ember);
	text-decoration: none;
}
.hrmg-intake-card__link:hover { text-decoration: underline; }

/* Finish prompt */
.hrmg-intake-finish {
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 11px 13px;
	background: #fff8f4;
	border: 1px solid #f6d3c4;
	border-radius: 10px;
}
.hrmg-intake-finish__q {
	font-size: 13px;
	font-weight: 500;
	color: var(--hrmg-ink);
}

/* Typing indicator */
.hrmg-intake-dots { display: inline-flex; gap: 4px; }
.hrmg-intake-dots i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--hrmg-ink-3);
	display: inline-block;
	animation: hrmg-intake-blink 1.2s infinite ease-in-out both;
}
.hrmg-intake-dots i:nth-child(2) { animation-delay: 0.2s; }
.hrmg-intake-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes hrmg-intake-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* Composer */
.hrmg-intake-form {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--hrmg-line);
	background: var(--hrmg-paper);
	flex: 0 0 auto;
}
.hrmg-intake-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	font-size: 14px;
	color: var(--hrmg-ink);
	background: var(--hrmg-paper-2);
	border: 1px solid var(--hrmg-line);
	border-radius: 8px;
}
.hrmg-intake-input:focus {
	outline: none;
	border-color: var(--hrmg-ember);
	box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.15);
}
.hrmg-intake-input:disabled { opacity: 0.7; }
.hrmg-intake-send {
	appearance: none;
	border: 0;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--hrmg-ink);
	border-radius: 8px;
	cursor: pointer;
}
.hrmg-intake-send:hover:not(:disabled) { background: var(--hrmg-ember); }
.hrmg-intake-send:disabled { opacity: 0.5; cursor: default; }

body.hrmg-intake-open { overflow: hidden; }

/* ---------------------------------------------------------------------------
 * Motion — calm and confident. Every animation here lives inside a
 * (prefers-reduced-motion: no-preference) guard, so a reduced-motion visitor
 * gets everything instantly: no typewriter (handled in JS), no slide, no fade.
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

	/* Modal — overlay backdrop fades; panel scales/rises in from ~0.98. */
	.hrmg-intake-overlay {
		opacity: 0;
		transition: opacity 0.2s ease;
	}
	.hrmg-intake-overlay.is-open { opacity: 1; }

	.hrmg-intake-panel {
		opacity: 0;
		transform: translateY(6px) scale(0.98);
		transition: opacity 0.22s ease, transform 0.22s ease;
	}
	.hrmg-intake-overlay.is-open .hrmg-intake-panel {
		opacity: 1;
		transform: none;
	}

	/* Message bubbles, card groups, finish prompt — subtle fade + slight rise. */
	@keyframes hrmg-intake-enter {
		from { opacity: 0; transform: translateY(6px); }
		to   { opacity: 1; transform: none; }
	}
	.hrmg-intake-bubble,
	.hrmg-intake-finish {
		animation: hrmg-intake-enter 0.2s ease both;
	}
	/* Cards fade in individually so JS can stagger them via animation-delay. */
	.hrmg-intake-card {
		animation: hrmg-intake-enter 0.2s ease both;
	}

	/* Send button — a subtle press feedback (no bounce, no overshoot). */
	.hrmg-intake-send { transition: transform 0.1s ease, background 0.15s ease; }
	.hrmg-intake-send:active:not(:disabled) { transform: scale(0.97); }
}

/* Mobile — full screen */
@media (max-width: 560px) {
	.hrmg-intake-overlay { padding: 0; }
	.hrmg-intake-panel {
		max-width: none;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hrmg-intake-dots i { animation: none; }
	.hrmg-intake-btn { transition: none; }
}
