/* Chat Isabel Vigil: colores de la web */
.civ-card,
.civ-bar {
	--civ-navy: #243B52;
	--civ-navy-dark: #1A2C3E;
	--civ-rasp: #CC3366;
	--civ-blue: #5C9BD5;
	--civ-bg: #F4F7FB;
	--civ-text: #1F2D3D;
	--civ-line: #E3E8EF;
	font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	color: var(--civ-text);
	text-align: left;
	box-sizing: border-box;
}
.civ-card *,
.civ-card *::before,
.civ-card *::after,
.civ-bar *,
.civ-bar *::before,
.civ-bar *::after { box-sizing: border-box; }

/* ---------- Ventana de conversación ---------- */
.civ-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 720px;
	height: 540px;
	margin: 0 auto;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(28, 42, 60, .06), 0 18px 40px rgba(28, 42, 60, .14);
}

/* Cabecera */
.civ-card .civ-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	background: var(--civ-navy);
	color: #fff;
	flex: none;
}
.civ-card .civ-logo {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #fff;
	object-fit: contain;
	padding: 4px;
	flex: none;
}
.civ-card .civ-titles { flex: 1; min-width: 0; }
.civ-card .civ-title { font-weight: 600; font-size: 15px; line-height: 1.25; color: #fff; }
.civ-card .civ-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; line-height: 1.3; color: rgba(255, 255, 255, .85); }
.civ-card .civ-dot { width: 8px; height: 8px; border-radius: 50%; background: #3CCF8E; flex: none; }

/* Conversación */
.civ-card .civ-log {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 18px;
	background: var(--civ-bg);
	display: flex;
	flex-direction: column;
	gap: 10px;
	overscroll-behavior: contain;
}
.civ-card .civ-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 15px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.civ-card .civ-msg p { margin: 0 0 8px; color: inherit; font-size: inherit; line-height: inherit; }
.civ-card .civ-msg p:last-child { margin-bottom: 0; }
.civ-card .civ-msg ul { margin: 4px 0 8px; padding-left: 20px; }
.civ-card .civ-msg ul:last-child { margin-bottom: 0; }
.civ-card .civ-msg li { margin: 2px 0; }
.civ-card .civ-msg strong { font-weight: 600; }
.civ-card .civ-msg a { color: var(--civ-rasp); text-decoration: underline; font-weight: 600; }
.civ-card .civ-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--civ-line);
	border-bottom-left-radius: 6px;
}
.civ-card .civ-user {
	align-self: flex-end;
	background: var(--civ-navy);
	color: #fff;
	border-bottom-right-radius: 6px;
	white-space: pre-wrap;
}
.civ-card .civ-crisis { border-left: 4px solid var(--civ-rasp); }

.civ-card .civ-typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.civ-card .civ-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9AA8B8;
	animation: civ-bounce 1.2s infinite ease-in-out;
}
.civ-card .civ-typing span:nth-child(2) { animation-delay: .15s; }
.civ-card .civ-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes civ-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .5; }
	40% { transform: translateY(-4px); opacity: 1; }
}

/* Botones: anulan los estilos del tema */
.civ-card button,
.civ-bar button { font-family: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; margin: 0; cursor: pointer; white-space: normal; }

/* Preguntas sugeridas */
.civ-card .civ-sugg {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 18px 12px;
	background: var(--civ-bg);
	flex: none;
}
.civ-card .civ-sugg[hidden] { display: none; }
.civ-card .civ-chip {
	background: #fff;
	color: var(--civ-navy);
	border: 1px solid #C9D6E5;
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.2;
	transition: background .15s, color .15s, border-color .15s;
}
.civ-card .civ-chip:hover,
.civ-card .civ-chip:focus-visible { background: var(--civ-navy); color: #fff; border-color: var(--civ-navy); }

/* Botón de cerrar */
.civ-card .civ-close {
	flex: none;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}
.civ-card .civ-close:hover,
.civ-card .civ-close:focus { background: rgba(255, 255, 255, .24); color: #fff; }
.civ-card .civ-close svg { width: 18px; height: 18px; }

/* Caja de texto */
.civ-card .civ-form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin: 0;
	padding: 12px 14px 10px;
	background: #fff;
	border-top: 1px solid var(--civ-line);
	flex: none;
}
.civ-card .civ-input {
	flex: 1;
	min-width: 0;
	width: auto;
	height: 46px;
	max-height: 120px;
	margin: 0;
	padding: 11px 16px;
	resize: none;
	overflow-y: hidden;
	border: 1px solid #D3DCE6;
	border-radius: 23px;
	background: #F9FBFD;
	color: var(--civ-text);
	font-family: inherit;
	font-size: 16px; /* 16 px evita que el iPhone haga zoom al escribir */
	line-height: 1.4;
	outline: none;
	box-shadow: none;
}
.civ-card .civ-input::placeholder { color: #8796A8; }
.civ-card .civ-input:focus { border-color: var(--civ-blue); background: #fff; box-shadow: 0 0 0 3px rgba(92, 155, 213, .18); }
.civ-card .civ-send,
.civ-bar .civ-bar-send {
	flex: none;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--civ-navy);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}
.civ-card .civ-send:hover,
.civ-card .civ-send:focus,
.civ-bar .civ-bar-send:hover,
.civ-bar .civ-bar-send:focus { background: var(--civ-navy-dark); color: #fff; }
.civ-card .civ-send:disabled { background: #B9C3CE; cursor: default; }
.civ-card .civ-send svg,
.civ-bar .civ-bar-send svg { width: 20px; height: 20px; }

.civ-card .civ-note {
	padding: 0 16px 12px;
	background: #fff;
	font-size: 11.5px;
	line-height: 1.4;
	color: #6B7A8B;
	text-align: center;
	flex: none;
}

/* ---------- Modo barra (portada) ---------- */
.civ-chat[data-mode="barra"] { min-height: 60px; }
.civ-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	padding: 6px 6px 6px 18px;
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, .8);
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(28, 42, 60, .08), 0 14px 34px rgba(28, 42, 60, .20);
	transition: box-shadow .2s;
}
.civ-bar:focus-within { box-shadow: 0 2px 6px rgba(28, 42, 60, .08), 0 14px 34px rgba(28, 42, 60, .20), 0 0 0 3px rgba(92, 155, 213, .45); }
.civ-bar .civ-bar-icon { flex: none; display: flex; width: 22px; height: 22px; color: var(--civ-rasp); }
.civ-bar .civ-bar-icon svg { width: 22px; height: 22px; }
.civ-bar .civ-bar-input {
	flex: 1;
	min-width: 0;
	width: auto;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	color: var(--civ-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 46px;
}
.civ-bar .civ-bar-input:focus { border: 0; box-shadow: none; }
.civ-bar .civ-bar-input::placeholder { color: #5E6E80; opacity: 1; }

/* Ventana flotante que se abre desde la barra */
.civ-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 32, 46, .45);
	opacity: 0;
	transition: opacity .2s ease;
}
.civ-overlay[hidden] { display: none; }
.civ-overlay.civ-overlay--in { opacity: 1; }
.civ-card.civ-card--float {
	max-width: 440px;
	height: 640px;
	max-height: calc(100vh - 48px);
	margin: 0;
	transform: translateY(12px);
	transition: transform .2s ease;
	box-shadow: 0 24px 60px rgba(10, 20, 32, .35);
}
.civ-overlay--in .civ-card--float { transform: none; }
html.civ-open,
html.civ-open body { overflow: hidden; }

@media (max-width: 767px) {
	.civ-card { height: 500px; border-radius: 16px; }
	.civ-card .civ-head { padding: 12px 14px; }
	.civ-card .civ-log { padding: 14px; }
	.civ-card .civ-sugg { padding: 0 14px 10px; }
	.civ-card .civ-msg { max-width: 90%; font-size: 14.5px; }
	.civ-card .civ-chip { font-size: 13px; padding: 6px 12px; }

	.civ-bar { padding: 5px 5px 5px 14px; gap: 8px; }
	.civ-bar .civ-bar-icon,
	.civ-bar .civ-bar-icon svg { width: 20px; height: 20px; }

	.civ-overlay { padding: 0; }
	.civ-card.civ-card--float {
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
}
