/* Shraiber chat widget. Brand: primary #033f88, dark #012a5c, surface #eef3fb, accent #ffab00.
 * Every selector starts with #shraiber-chat so site-wide theme styles (Elementor styles all
 * buttons, inputs and links) can't override the widget; the resets below clear what they set. */

#shraiber-chat {
	--sc-primary: #033f88;
	--sc-dark: #012a5c;
	--sc-surface: #eef3fb;
	--sc-accent: #ffab00;
	--sc-text: #1d2433;
	--sc-muted: #5b6475;
	--sc-border: #d6deeb;
	--sc-radius: 16px;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--sc-text);
	direction: rtl;
	text-align: right;
}

#shraiber-chat.sc-pos-right { right: 20px; }
#shraiber-chat.sc-pos-left { left: 20px; }

#shraiber-chat *,
#shraiber-chat *::before,
#shraiber-chat *::after { box-sizing: border-box; }

#shraiber-chat [hidden] { display: none !important; }

#shraiber-chat button,
#shraiber-chat textarea,
#shraiber-chat input[type="text"],
#shraiber-chat input[type="tel"] {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	cursor: pointer;
	transition: none;
}

#shraiber-chat a {
	text-decoration: none;
	box-shadow: none;
}

#shraiber-chat p { margin: 0; }

#shraiber-chat :focus-visible {
	outline: 3px solid var(--sc-accent);
	outline-offset: 2px;
}

#shraiber-chat .sc-icon,
#shraiber-chat svg { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
#shraiber-chat .sc-icon svg { width: 100%; height: 100%; }

/* ---------- launcher & teaser ---------- */

#shraiber-chat .sc-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--sc-primary);
	color: #fff;
	box-shadow: 0 6px 20px rgba(1, 42, 92, 0.35);
	transition: transform 0.15s ease, background-color 0.15s ease;
}
#shraiber-chat .sc-launcher:hover { background: var(--sc-dark); color: #fff; transform: scale(1.05); }
#shraiber-chat .sc-launcher svg { width: 28px; height: 28px; }
#shraiber-chat.sc-pos-right .sc-launcher { margin-left: auto; }

#shraiber-chat .sc-teaser {
	position: absolute;
	bottom: 72px;
	display: flex;
	align-items: flex-start;
	gap: 4px;
	width: max-content;
	max-width: 240px;
	padding: 10px 10px 10px 6px;
	background: #fff;
	border: 1px solid var(--sc-border);
	border-radius: var(--sc-radius);
	box-shadow: 0 8px 24px rgba(1, 42, 92, 0.18);
	animation: sc-pop 0.25s ease-out;
}
#shraiber-chat.sc-pos-right .sc-teaser { right: 0; }
#shraiber-chat.sc-pos-left .sc-teaser { left: 0; }

#shraiber-chat .sc-teaser-text {
	padding: 0 4px;
	text-align: right;
	font-weight: 600;
	color: var(--sc-dark);
}
#shraiber-chat .sc-teaser-close {
	display: flex;
	padding: 2px;
	color: var(--sc-muted);
}

/* ---------- panel ---------- */

#shraiber-chat .sc-panel {
	position: absolute;
	bottom: 76px;
	display: flex;
	flex-direction: column;
	width: 370px;
	height: min(600px, calc(100vh - 120px));
	background: #fff;
	border-radius: var(--sc-radius);
	box-shadow: 0 12px 40px rgba(1, 42, 92, 0.28);
	overflow: hidden;
	animation: sc-pop 0.2s ease-out;
}
#shraiber-chat .sc-panel:focus { outline: none; }
#shraiber-chat.sc-pos-right .sc-panel { right: 0; }
#shraiber-chat.sc-pos-left .sc-panel { left: 0; }

#shraiber-chat .sc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--sc-primary);
	color: #fff;
}
#shraiber-chat .sc-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--sc-accent);
	color: var(--sc-dark);
	font-weight: 800;
	font-size: 18px;
}
#shraiber-chat .sc-title { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
#shraiber-chat .sc-title strong { font-size: 16px; }
#shraiber-chat .sc-title span { font-size: 12.5px; opacity: 0.85; }
#shraiber-chat .sc-close {
	display: flex;
	padding: 6px;
	border-radius: 8px;
	color: #fff;
}
#shraiber-chat .sc-close:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
#shraiber-chat .sc-close svg { width: 20px; height: 20px; }

/* ---------- messages ---------- */

#shraiber-chat .sc-log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--sc-surface);
}

#shraiber-chat .sc-msg {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 14px;
	white-space: pre-line;
	overflow-wrap: anywhere;
}
#shraiber-chat .sc-msg-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--sc-border);
	border-start-start-radius: 4px;
}
#shraiber-chat .sc-msg-user {
	align-self: flex-end;
	background: var(--sc-primary);
	color: #fff;
	border-start-end-radius: 4px;
}

#shraiber-chat .sc-links { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; white-space: normal; }
#shraiber-chat .sc-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--sc-surface);
	color: var(--sc-primary);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
}
#shraiber-chat .sc-link:hover { background: #dde7f6; color: var(--sc-primary); }

#shraiber-chat .sc-cta { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sc-border); white-space: normal; }

#shraiber-chat .sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#shraiber-chat .sc-chip {
	padding: 7px 12px;
	border: 1px solid var(--sc-primary);
	border-radius: 999px;
	background: #fff;
	color: var(--sc-primary);
	font-size: 14px;
	line-height: 1.3;
	transition: background-color 0.15s ease, color 0.15s ease;
}
#shraiber-chat .sc-chip:hover { background: var(--sc-primary); color: #fff; }
#shraiber-chat .sc-chip-lead { background: var(--sc-accent); border-color: var(--sc-accent); color: var(--sc-dark); font-weight: 700; }
#shraiber-chat .sc-chip-lead:hover { background: #f0a000; border-color: #f0a000; color: var(--sc-dark); }

/* ---------- lead form ---------- */

#shraiber-chat .sc-lead { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
#shraiber-chat .sc-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--sc-dark); }
#shraiber-chat .sc-field input {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--sc-border);
	border-radius: 10px;
	background: #fff;
	color: var(--sc-text);
	font-size: 16px; /* keeps iOS from zooming in */
	font-weight: 400;
	line-height: 1.3;
	cursor: text;
}
#shraiber-chat .sc-field input:focus { border-color: var(--sc-primary); outline: none; box-shadow: 0 0 0 2px rgba(3, 63, 136, 0.15); }
#shraiber-chat .sc-field input[dir="ltr"] { text-align: right; }
#shraiber-chat .sc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#shraiber-chat .sc-consent { display: flex; align-items: flex-start; gap: 6px; font-size: 11px; line-height: 1.45; color: var(--sc-muted); }
#shraiber-chat .sc-consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; cursor: pointer; }
#shraiber-chat .sc-consent a { color: var(--sc-primary); text-decoration: underline; }
#shraiber-chat .sc-lead-error { padding: 6px 8px; border-radius: 8px; background: #fff4e5; color: #8a4b00; font-size: 12.5px; }
#shraiber-chat .sc-lead-submit {
	padding: 10px;
	border-radius: 10px;
	background: var(--sc-primary);
	color: #fff;
	font-weight: 700;
	text-align: center;
}
#shraiber-chat .sc-lead-submit:hover { background: var(--sc-dark); color: #fff; }
#shraiber-chat .sc-lead-submit:disabled { opacity: 0.6; cursor: wait; }

/* The hidden thank-you page that fires the site's conversion tags (appended to body, outside the widget). */
iframe.sc-thanks-frame {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 1px;
	height: 1px;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

#shraiber-chat .sc-typing { display: flex; gap: 4px; padding: 14px 16px; }
#shraiber-chat .sc-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sc-muted);
	animation: sc-blink 1.2s infinite ease-in-out;
}
#shraiber-chat .sc-typing span:nth-child(2) { animation-delay: 0.15s; }
#shraiber-chat .sc-typing span:nth-child(3) { animation-delay: 0.3s; }

/* ---------- contact & input ---------- */

#shraiber-chat .sc-contact-bar,
#shraiber-chat .sc-cta-row { display: flex; flex-wrap: wrap; gap: 6px; }
#shraiber-chat .sc-contact-bar { padding: 8px 12px 0; background: #fff; border-top: 1px solid var(--sc-border); }

#shraiber-chat .sc-contact {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border: 1px solid var(--sc-border);
	border-radius: 999px;
	background: #fff;
	color: var(--sc-dark);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}
#shraiber-chat .sc-contact:hover { border-color: var(--sc-primary); color: var(--sc-dark); }
#shraiber-chat .sc-contact-wa .sc-icon { color: #1a8f4c; }
#shraiber-chat .sc-cta .sc-contact-wa,
#shraiber-chat .sc-cta .sc-contact-wa:hover { background: #1a8f4c; border-color: #1a8f4c; color: #fff; }
#shraiber-chat .sc-cta .sc-contact-wa .sc-icon { color: #fff; }

#shraiber-chat .sc-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 8px 12px;
	background: #fff;
}
#shraiber-chat .sc-input {
	flex: 1;
	min-height: 42px;
	max-height: 110px;
	padding: 10px 12px;
	border: 1px solid var(--sc-border);
	border-radius: 12px;
	background: #fff;
	color: var(--sc-text);
	font-size: 16px; /* 16px keeps iOS from zooming in on focus */
	line-height: 1.35;
	resize: none;
	overflow-y: hidden;
	cursor: text;
}
#shraiber-chat .sc-input:focus { border-color: var(--sc-primary); outline: none; box-shadow: 0 0 0 2px rgba(3, 63, 136, 0.15); }
#shraiber-chat .sc-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--sc-accent);
	color: var(--sc-dark);
}
#shraiber-chat .sc-send:hover { background: #f0a000; color: var(--sc-dark); }
#shraiber-chat .sc-send svg { width: 22px; height: 22px; }

#shraiber-chat .sc-disclaimer {
	padding: 0 12px 8px;
	background: #fff;
	color: var(--sc-muted);
	font-size: 11.5px;
	line-height: 1.4;
	text-align: center;
}

/* ---------- small screens: full-screen panel ---------- */

@media (max-width: 520px) {
	#shraiber-chat { bottom: 16px; }
	#shraiber-chat.sc-pos-right { right: 16px; }
	#shraiber-chat.sc-pos-left { left: 16px; }
	#shraiber-chat.sc-is-open { inset: 0; }
	#shraiber-chat.sc-is-open .sc-launcher { display: none; }
	#shraiber-chat .sc-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		border-radius: 0;
	}
	#shraiber-chat .sc-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
	#shraiber-chat *,
	#shraiber-chat *::before,
	#shraiber-chat *::after { animation: none !important; transition: none !important; }
}

@keyframes sc-pop {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes sc-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}
