/* Edify admissions chatbot window (16-Nov-2026) — assets/js/chatbot.js.
   Everything is scoped under .ewsbot so nothing else on the page changes. */
.ewsbot {
	position: fixed;
	right: 24px;
	bottom: 92px;
	z-index: 260;
	width: 380px;
	height: min(600px, calc(100vh - 120px));
	height: min(600px, calc(100dvh - 120px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 60px -12px rgba(16, 31, 77, .35), 0 0 0 1px rgba(16, 31, 77, .06);
	overflow: hidden;
	font-family: var(--font-base);
	color: var(--text);
	opacity: 0;
	transform: translateY(12px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .2s ease;
}
.ewsbot[hidden] { display: none; }
.ewsbot.is-open { opacity: 1; transform: none; }

.ewsbot__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 12px 14px 16px;
	background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
	color: #fff;
	flex-shrink: 0;
}
.ewsbot__avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ewsbot__avatar svg { width: 20px; height: 20px; }
.ewsbot__title { flex: 1; min-width: 0; line-height: 1.25; }
.ewsbot__title strong { display: block; font-size: 15.5px; font-weight: 700; color: #fff; }
.ewsbot__title small { font-size: 12px; color: rgba(255, 255, 255, .82); display: flex; align-items: center; gap: 6px; }
.ewsbot__title small i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.ewsbot__head button {
	width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
	background: transparent; color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.ewsbot__head button:hover, .ewsbot__head button:focus-visible { background: rgba(255, 255, 255, .16); }
.ewsbot__head button svg { width: 18px; height: 18px; }

.ewsbot__msgs {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px 8px;
	background: #f6f5fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.ewsbot__msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.ewsbot__msg--user { align-items: flex-end; }
.ewsbot__bubble {
	max-width: 88%;
	padding: 10px 14px;
	border-radius: 16px 16px 16px 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 31, 77, .08);
	font-size: 14px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.ewsbot__msg--user .ewsbot__bubble {
	background: var(--purple);
	color: #fff;
	border-radius: 16px 16px 4px 16px;
}
.ewsbot__bubble p { margin: 0 0 8px; }
.ewsbot__bubble p:last-child { margin-bottom: 0; }
.ewsbot__bubble a { color: #6d28d9; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ewsbot__bubble strong { font-weight: 700; color: var(--navy); }
.ewsbot__bubble ul, .ewsbot__bubble ol { margin: 0 0 8px; padding-left: 18px; }
.ewsbot__bubble ul { list-style: disc; } /* main.css resets every ul to list-style:none */
.ewsbot__bubble li { margin: 0 0 4px; }
.ewsbot__bubble ul li::marker { color: var(--purple); }
.ewsbot__bubble ol li::marker { color: var(--purple); font-weight: 700; }
.ewsbot__bubble .ewsbot-sub { margin: 8px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.ewsbot__bubble .ewsbot-note { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.ewsbot__bubble .ewsbot-cta { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: #fff4ec; border-left: 3px solid var(--orange); font-size: 13.5px; }
.ewsbot__bubble ul.ewsbot-list { list-style: none; padding: 0; }
.ewsbot__bubble ul.ewsbot-list li { padding: 6px 0; border-bottom: 1px solid #eee; margin: 0; }
.ewsbot__bubble ul.ewsbot-list li:last-child { border-bottom: 0; }
.ewsbot__bubble ul.ewsbot-list span { display: block; font-size: 12px; color: var(--text-muted); }
.ewsbot__bubble ul.ewsbot-cols { columns: 2; column-gap: 18px; }
.ewsbot__bubble ul.ewsbot-cols li { break-inside: avoid; }
.ewsbot__bubble ul.ewsbot-contact, .ewsbot__bubble ul.ewsbot-facts { list-style: none; padding: 0; }
.ewsbot__bubble ul.ewsbot-facts li { display: flex; gap: 8px; }
.ewsbot__bubble ul.ewsbot-facts span { min-width: 78px; color: var(--text-muted); font-size: 12.5px; padding-top: 1px; }
.ewsbot__bubble table.ewsbot-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 2px 0 6px; }
.ewsbot__bubble .ewsbot-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid #e6e8f0; }
.ewsbot__bubble .ewsbot-table td { padding: 5px 6px; border-bottom: 1px solid #f0f0f5; }

.ewsbot__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 100%; }
.ewsbot__chip {
	border: 1px solid #d9ccfb;
	background: #fff;
	color: #5b21b6;
	border-radius: 999px;
	padding: 6px 12px;
	font: 600 13px/1.2 var(--font-base);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, border-color .15s ease;
}
.ewsbot__chip:hover, .ewsbot__chip:focus-visible { background: #f3edff; border-color: #a78bfa; color: #5b21b6; }
.ewsbot__chip--cta { background: var(--orange); border-color: var(--orange); color: #fff; }
.ewsbot__chip--cta:hover, .ewsbot__chip--cta:focus-visible { background: #e8650f; border-color: #e8650f; color: #fff; }

.ewsbot__typing .ewsbot__bubble { display: flex; gap: 4px; padding: 14px; }
.ewsbot__typing span { width: 7px; height: 7px; border-radius: 50%; background: #a78bfa; animation: ewsbot-dot 1s infinite ease-in-out; }
.ewsbot__typing span:nth-child(2) { animation-delay: .15s; }
.ewsbot__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ewsbot-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ewsbot__form {
	width: 100%;
	max-width: 300px;
	background: #fff;
	border-radius: 16px 16px 16px 4px;
	padding: 14px;
	box-shadow: 0 1px 2px rgba(16, 31, 77, .08);
	display: flex;
	flex-direction: column;
	gap: 9px;
	font-size: 14px;
}
.ewsbot__form p { margin: 0; line-height: 1.45; }
.ewsbot__form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.ewsbot__form input, .ewsbot__form select {
	font: 500 14px var(--font-base);
	color: var(--text);
	padding: 9px 10px;
	border: 1px solid #d6d9e4;
	border-radius: 10px;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}
.ewsbot__form input:focus, .ewsbot__form select:focus { outline: 2px solid #c4b5fd; border-color: var(--purple); }
.ewsbot__form .ewsbot__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ewsbot__form small { font-size: 11.5px; color: var(--text-muted); }
.ewsbot__err { color: #b91c1c; font-size: 13px; font-weight: 600; }
.ewsbot__form .ewsbot__opt { font-weight: 500; }
.ewsbot__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ewsbot__form select { padding-right: 6px; text-overflow: ellipsis; }
.ewsbot__form.ewsbot__visit { border-top: 3px solid var(--orange); }
.ewsbot__bubble--done { background: #ecfdf3; border: 1px solid #bbf7d0; }
.ewsbot__chip--visit { background: var(--purple); border-color: var(--purple); }
.ewsbot__chip--visit:hover, .ewsbot__chip--visit:focus-visible { background: #6d28d9; border-color: #6d28d9; color: #fff; }

/* school-page preview message above the bubble (shown once, after 15 s) */
.ewsbot-teaser {
	position: fixed;
	right: 24px;
	bottom: 90px;
	z-index: 210;
	max-width: 270px;
	background: #fff;
	border-radius: 16px 16px 4px 16px;
	box-shadow: 0 14px 34px -8px rgba(16, 31, 77, .35), 0 0 0 1px rgba(16, 31, 77, .06);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .3s ease, transform .3s ease;
	font-family: var(--font-base);
}
.ewsbot-teaser.is-in { opacity: 1; transform: none; }
.ewsbot-teaser__body {
	display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
	padding: 13px 34px 13px 15px; font: inherit; color: var(--text);
}
.ewsbot-teaser__body strong { display: block; font-size: 14px; color: var(--navy); margin-bottom: 3px; }
.ewsbot-teaser__body span { font-size: 13px; color: var(--text-muted); }
.ewsbot-teaser__close {
	position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%;
	background: #f1f1f6; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.ewsbot-open .ewsbot-teaser { display: none; }
.ewsbot__send {
	border: 0; border-radius: 10px; padding: 11px 14px;
	background: var(--orange); color: #fff; font: 700 14px var(--font-base); cursor: pointer;
}
.ewsbot__send:hover { background: #e8650f; }
.ewsbot__send:disabled { opacity: .7; cursor: default; }

.ewsbot__input {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #ecebf3;
	background: #fff;
	flex-shrink: 0;
}
.ewsbot__input input {
	flex: 1;
	min-width: 0;
	border: 1px solid #d6d9e4;
	border-radius: 999px;
	padding: 10px 16px;
	font: 500 14px var(--font-base);
	color: var(--text);
	background: #fff;
}
.ewsbot__input input:focus { outline: 2px solid #c4b5fd; border-color: var(--purple); }
.ewsbot__input button {
	width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 50%;
	background: var(--purple); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.ewsbot__input button:hover { background: #6d28d9; }
.ewsbot__input button svg { width: 18px; height: 18px; }
.ewsbot__foot { margin: 0; padding: 0 12px 9px; font-size: 11.5px; color: var(--text-muted); text-align: center; background: #fff; flex-shrink: 0; }
.ewsbot__foot a { color: inherit; font-weight: 600; }

/* while the chat is open: hide the bubble's hint and the right-edge quick-action strip it would overlap */
.ewsbot-open .chat-bubble__tooltip { display: none; }
.ewsbot-open .quick-sidebar { opacity: 0; pointer-events: none; transition: opacity .2s ease; }

@media (max-width: 720px) {
	.ewsbot {
		right: 0; bottom: 0; left: 0; top: 0;
		width: auto; height: auto;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom);
		transform: translateY(16px);
	}
	.ewsbot-open .chat-bubble { display: none; }
	.ewsbot__input input { font-size: 16px; } /* stops iPhone zooming in */
	.ewsbot__form input, .ewsbot__form select { font-size: 16px; }
	.ewsbot__form { max-width: 100%; }
	/* school pages: show the bubble straight away (other pages wait until the visitor scrolls) */
	.ewsbot-school-page .chat-bubble { opacity: 1; transform: none; pointer-events: auto; }
	.ewsbot-teaser { right: 14px; left: 60px; bottom: 72px; max-width: none; margin-left: auto; width: max-content; max-width: calc(100vw - 74px); }
}
@media (prefers-reduced-motion: reduce) {
	.ewsbot, .ewsbot__typing span { transition: none; animation: none; }
}
@media print { .ewsbot { display: none !important; } }
