/* APP/assets/css/modulos/ventanas_alpha.css
   Ventanas emergentes (SweetAlert2 10) con el diseño de ALPHA_CLOUD
   (ALPHA_CLOUD/public/assets/css/components/confirm.css y toast.css), 2026-10-28.

   - SOLO aspecto: no se toca ninguna de las ~1.000 llamadas a Swal.fire ni su
     comportamiento (.then, inputs, timers, botones). Se activa con
     <body data-ventanas-alpha> (index.php): quitando el atributo se vuelve al
     aspecto original de golpe.
   - SweetAlert inyecta su CSS al cargar (por detras de estas hojas): por eso
     todo va prefijado con body[data-ventanas-alpha], que gana por especificidad.
   - Ventanas centradas = dialogo de ALPHA_CLOUD (tarjeta, icono redondo suave,
     titulo, texto, botones de pastilla, fondo oscuro con desenfoque).
     Avisos arriba a la derecha (position: 'top-end') = toast de ALPHA_CLOUD
     (tarjeta compacta, borde izquierdo del color del tipo, sin oscurecer).
   - Se respetan: el color de boton fijado en la llamada (confirmButtonColor,
     inline), el ancho propio (width, inline) y las ventanas con diseño propio
     de cada pagina (customClass *_swal_popup: DPD, LPRL), que no se tocan.
   - Colores: los de marca de CONSULTORIA (--nav_a_hover_COLOR*, personalizables
     por usuario) y los tonos de estado de ALPHA_CLOUD. */

/* ------------------------------------------------------------ Fondo */
body[data-ventanas-alpha] .swal2-container.swal2-backdrop-show,
body[data-ventanas-alpha] .swal2-container.swal2-noanimation {
	background: rgba(15, 23, 42, .45);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------- Tarjeta */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) {
	padding: 21px;
	border-radius: 28px;
	background: #ffffff;
	box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
	color: #0f172a;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]).swal2-show { animation: ventanas-alpha-entrada .18s ease; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]).swal2-hide { animation: ventanas-alpha-salida .15s ease forwards; }
@keyframes ventanas-alpha-entrada {
	from { opacity: 0; transform: translateY(10px) scale(.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ventanas-alpha-salida {
	from { opacity: 1; transform: translateY(0) scale(1); }
	to { opacity: 0; transform: translateY(10px) scale(.97); }
}

body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-header { padding: 0; }

/* ------------------------------------------- Icono (redondo, suave) */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon {
	width: 46px;
	min-width: 46px;
	height: 46px;
	margin: 0 auto 13px;
	border: 0;
	border-radius: 50%;
	background: var(--nav_a_hover_COLOR_pastel, #e6f1f6);
	color: var(--nav_a_hover_COLOR, #0076A5);
	font-family: inherit;
	line-height: 46px;
	animation: none;
}
/* Los dibujos animados de SweetAlert (aro, aspa, check) se sustituyen por un signo. */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon > * { display: none !important; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon::before {
	display: block;
	width: 100%;
	text-align: center;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 46px;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-success { background: #ecfdf5; color: #2f855a; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-success::before { content: "\2713"; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-error { background: #fff1f2; color: #dc3545; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-error::before { content: "\2715"; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-warning { background: #fffbeb; color: #b7791f; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-warning::before { content: "!"; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-info::before { content: "i"; font-family: Georgia, serif; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-icon.swal2-question::before { content: "?"; }

/* ------------------------------------------------------ Textos */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-title {
	margin: 0 0 8px;
	padding: 0;
	color: #0f172a;
	font-size: clamp(1rem, 0.95rem + 0.24vw, 1.1875rem);
	font-weight: 700;
	line-height: 1.3;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-content {
	padding: 0;
	color: #64748b;
	font-size: clamp(0.8125rem, 0.78rem + 0.16vw, 0.9375rem);
	line-height: 1.5;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-footer {
	margin: 13px 0 0;
	padding: 13px 0 0;
	border-top: 1px solid #eef2f7;
	color: #64748b;
	font-size: clamp(0.75rem, 0.71rem + 0.16vw, 0.875rem);
}

/* ----------------------------------------------- Botones (pastilla) */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions {
	gap: 8px;
	margin: 21px 0 0;
	padding: 0;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled {
	flex: 1 1 0;
	min-width: 120px;
	min-height: 42px;
	margin: 0;
	padding: 0 21px;
	border: 0;
	border-radius: 16px;
	font-family: inherit;
	font-size: clamp(0.75rem, 0.71rem + 0.16vw, 0.875rem);
	font-weight: 600;
	box-shadow: none;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled:hover { transform: translateY(-1px); }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled:focus {
	outline: 2px solid var(--nav_a_hover_COLOR, #0076A5);
	outline-offset: 2px;
	box-shadow: none;
}
/* Accion principal: relleno de marca */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-confirm {
	background-color: var(--nav_a_hover_COLOR, #0076A5);
	background-image: linear-gradient(135deg, var(--nav_a_hover_COLOR, #0076A5), var(--nav_a_hover_COLOR_medio, #3391b7));
	color: #ffffff;
	box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
}
/* confirmButtonColor de la llamada (inline): se respeta, sin el degradado de marca encima */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-confirm[style*="background-color"] { background-image: none; }
/* Cancelar: contorno de marca, siempre a la izquierda (abajo en movil) */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-cancel {
	order: -1;
	background-color: #ffffff;
	background-image: none;
	border: 1.5px solid var(--nav_a_hover_COLOR, #0076A5);
	color: var(--nav_a_hover_COLOR, #0076A5);
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-cancel[style*="background-color"] { color: #ffffff; border-color: transparent; }
/* Tercera opcion (showDenyButton): tono de peligro suave */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-deny {
	background-color: #fff1f2;
	background-image: none;
	border: 1.5px solid #dc3545;
	color: #be123c;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled.swal2-deny[style*="background-color"] { color: #ffffff; border-color: transparent; }
/* Movil: botones apilados, la accion principal arriba y Cancelar abajo (como ALPHA_CLOUD) */
@media (max-width: 420px) {
	body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions { flex-direction: column-reverse; }
	body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-actions .swal2-styled { flex: 0 0 auto; width: 100%; }
}

/* ---------------------------------------- Campos, validacion, carga */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-input,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-file,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-textarea,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-select {
	border: 1px solid #dbe3ef;
	border-radius: 12px;
	box-shadow: none;
	color: #0f172a;
	font-family: inherit;
	font-size: clamp(0.8125rem, 0.78rem + 0.16vw, 0.9375rem);
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-input,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-select { min-height: 42px; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-input:focus,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-file:focus,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-textarea:focus,
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-select:focus {
	border-color: var(--nav_a_hover_COLOR, #0076A5);
	box-shadow: 0 0 0 3px var(--nav_a_hover_COLOR_pastel, #e6f1f6);
	outline: none;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-validation-message {
	margin: 13px 0 0;
	border-radius: 12px;
	background: #fff1f2;
	color: #be123c;
	font-size: clamp(0.75rem, 0.71rem + 0.16vw, 0.875rem);
	font-weight: 600;
}
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-validation-message::before { background-color: #dc3545; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-loader { border-color: var(--nav_a_hover_COLOR, #0076A5) transparent var(--nav_a_hover_COLOR, #0076A5) transparent; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-timer-progress-bar { background: var(--nav_a_hover_COLOR_medio, #3391b7); }
/* La barra de tiempo sigue las esquinas redondeadas de la tarjeta (28px / 16px en los avisos) */
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-timer-progress-bar-container { border-bottom-left-radius: 28px; border-bottom-right-radius: 28px; }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-timer-progress-bar-container,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-timer-progress-bar-container { border-bottom-left-radius: 0; border-bottom-right-radius: 16px; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-close { color: #64748b; border-radius: 50%; }
body[data-ventanas-alpha] .swal2-popup:not([class*="_swal_popup"]) .swal2-close:hover { color: #0f172a; background: none; }

/* ------------------------- Avisos arriba a la derecha = toast de ALPHA_CLOUD */
body[data-ventanas-alpha] .swal2-container.swal2-top-end.swal2-backdrop-show,
body[data-ventanas-alpha] .swal2-container.swal2-top-right.swal2-backdrop-show {
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]),
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) {
	margin-top: 14px;
	padding: 13px 13px 13px 15px;
	border-left: 4px solid var(--nav_a_hover_COLOR, #0076A5);
	border-radius: 16px;
	text-align: left;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]):not([style*="width"]),
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]):not([style*="width"]) { width: min(360px, calc(100vw - 32px)); }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup.swal2-icon-success:not([class*="_swal_popup"]),
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup.swal2-icon-success:not([class*="_swal_popup"]) { border-left-color: #9bd4b0; }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup.swal2-icon-error:not([class*="_swal_popup"]),
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup.swal2-icon-error:not([class*="_swal_popup"]) { border-left-color: #dc3545; }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup.swal2-icon-warning:not([class*="_swal_popup"]),
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup.swal2-icon-warning:not([class*="_swal_popup"]) { border-left-color: #ebb87e; }
/* Icono pequeño a la izquierda del titulo */
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-header,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-header {
	flex-direction: row;
	align-items: center;
	gap: 8px;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-icon,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-icon {
	width: 22px;
	min-width: 22px;
	height: 22px;
	margin: 0;
	line-height: 22px;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-icon::before,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-icon::before {
	font-size: .75rem;
	line-height: 22px;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-title,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-title {
	flex: 1 1 auto;
	margin: 0;
	text-align: left;
	font-size: clamp(0.75rem, 0.71rem + 0.16vw, 0.875rem);
	font-weight: 600;
	line-height: 1.4;
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-content,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-content {
	margin-top: 5px;
	text-align: left;
	font-size: clamp(0.75rem, 0.71rem + 0.16vw, 0.875rem);
}
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]) .swal2-actions,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]) .swal2-actions { margin-top: 13px; }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]).swal2-show,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]).swal2-show { animation: ventanas-alpha-toast-entrada .3s ease; }
body[data-ventanas-alpha] .swal2-container.swal2-top-end > .swal2-popup:not([class*="_swal_popup"]).swal2-hide,
body[data-ventanas-alpha] .swal2-container.swal2-top-right > .swal2-popup:not([class*="_swal_popup"]).swal2-hide { animation: ventanas-alpha-toast-salida .25s ease forwards; }
@keyframes ventanas-alpha-toast-entrada {
	from { opacity: 0; transform: translateX(28px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes ventanas-alpha-toast-salida {
	from { opacity: 1; transform: translateX(0); }
	to { opacity: 0; transform: translateX(28px); }
}

/* ===================================================================
   Ventana emergente propia (secciones/ventana_emergente.php +
   modulos/ventana_emergente.css, 68 aperturas con formularios: historicos,
   correos, notas, agenda, chat...) con el diseño del modal de ALPHA_CLOUD
   (components/modal.css), 2026-10-28. Solo aspecto: no se toca ninguna
   apertura ni su contenido.
   - El TAMAÑO va con :where() (especificidad minima) para que sigan ganando
     los ajustes propios de cada pantalla (agenda.css: alto automatico del
     detalle de una nota; chat.css...).
   - La X pasa a ser un boton redondo blanco fijo arriba a la derecha de la
     pantalla (la tarjeta cambia de alto segun el contenido, asi que no se ata
     a su esquina).
   =================================================================== */
body[data-ventanas-alpha] .ventana_emergente {
	background-color: rgba(15, 23, 42, .45);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}
:where(body[data-ventanas-alpha]) .contenedor_ventana_emergente {
	width: min(960px, 92vw);
	height: 82vh;
	padding: 28px 32px;
}
body[data-ventanas-alpha] .ventana_emergente .contenedor_ventana_emergente {
	border-radius: 22px;
	background-color: #ffffff;
	box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
	color: #0f172a;
	animation: ventanas-alpha-modal-entrada .2s ease;
}
@keyframes ventanas-alpha-modal-entrada {
	from { transform: translate(50%, calc(-50% + 10px)) scale(.98); }
	to { transform: translate(50%, -50%) scale(1); }
}
/* Titulo: antes #d7edf7 (casi blanco sobre blanco) */
body[data-ventanas-alpha] .ventana_emergente .contenedor_ventana_emergente h3 {
	color: var(--nav_a_hover_COLOR, #0076A5);
	font-size: clamp(1.05rem, 1rem + 0.3vw, 1.3rem);
	font-weight: 700;
	margin-bottom: 16px;
}
/* Cerrar: boton redondo blanco, siempre visible sobre el fondo oscuro */
body[data-ventanas-alpha] .ventana_emergente .cerrar {
	top: 16px;
	right: 16px;
	left: auto;
	transform: none;
	z-index: 2;
}
body[data-ventanas-alpha] .ventana_emergente .cerrar .btn-close {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	background-color: #ffffff;
	background-size: 12px;
	background-position: center;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
	filter: none;
	-webkit-filter: none;
	opacity: 1;
	transition: transform .15s ease, box-shadow .15s ease;
}
body[data-ventanas-alpha] .ventana_emergente .cerrar .btn-close:hover {
	transform: scale(1.06);
	box-shadow: 0 10px 28px rgba(15, 23, 42, .3);
}
body[data-ventanas-alpha] .ventana_emergente .cerrar .btn-close:focus {
	outline: 2px solid var(--nav_a_hover_COLOR, #0076A5);
	outline-offset: 2px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
}
@media (max-width: 720px) {
	:where(body[data-ventanas-alpha]) .contenedor_ventana_emergente {
		width: 94vw;
		height: 84vh;
		padding: 20px 16px;
	}
	body[data-ventanas-alpha] .ventana_emergente .contenedor_ventana_emergente { border-radius: 18px; }
	body[data-ventanas-alpha] .ventana_emergente .cerrar { top: 10px; right: 10px; }
}
/* Campos y botones dentro de la ventana: radios de ALPHA_CLOUD (campos 12px, botones 16px) */
body[data-ventanas-alpha] .contenedor_ventana_emergente .form-control,
body[data-ventanas-alpha] .contenedor_ventana_emergente .form-select {
	border-color: #dbe3ef;
	border-radius: 12px;
}
body[data-ventanas-alpha] .contenedor_ventana_emergente .form-control:focus,
body[data-ventanas-alpha] .contenedor_ventana_emergente .form-select:focus {
	border-color: var(--nav_a_hover_COLOR, #0076A5);
	box-shadow: 0 0 0 3px var(--nav_a_hover_COLOR_pastel, #e6f1f6);
}
body[data-ventanas-alpha] .contenedor_ventana_emergente .btn {
	min-height: 42px;
	border-radius: 16px;
	font-weight: 600;
}
