/**
 * EduIA · SweetAlert2 plantilla maestra
 * - Diálogo centrado a pantalla completa
 * - Logo + identidad clara (azul EduIA)
 * - Anula conflictos de sweetalert-custom / shells
 */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
	--eduia-swal-brand: #1877f2;
	--eduia-swal-brand-deep: #0f5ed1;
	--eduia-swal-panel: #ffffff;
	--eduia-swal-panel-2: #f5f9ff;
	--eduia-swal-ink: #142331;
	--eduia-swal-muted: #5b6b7c;
	--eduia-swal-line: #d7e4f2;
	--eduia-swal-soft: #eef5ff;
	--eduia-swal-ok: #15803d;
	--eduia-swal-ok-soft: #ecfdf5;
	--eduia-swal-err: #c0392b;
	--eduia-swal-err-soft: #fef2f2;
	--eduia-swal-warn: #b45309;
	--eduia-swal-warn-soft: #fff7ed;
	--eduia-swal-radius: 18px;
	--eduia-swal-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--eduia-swal-z: 12080;
}

/* ——— Contenedor: siempre viewport completo (rompe width:360 / position:static) ——— */
html.eduia-swal-identity-on .swal2-container,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container,
html.eduia-swal-identity-on body.swal2-shown .swal2-container,
html.eduia-swal-identity-on body.swal2-no-backdrop .swal2-container,
html.eduia-swal-identity-on div:where(.swal2-container) {
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	min-height: 100% !important;
	margin: 0 !important;
	padding:
		max(0.75rem, env(safe-area-inset-top, 0))
		max(0.75rem, env(safe-area-inset-right, 0))
		max(0.75rem, env(safe-area-inset-bottom, 0))
		max(0.75rem, env(safe-area-inset-left, 0)) !important;
	transform: none !important;
	box-sizing: border-box !important;
	z-index: var(--eduia-swal-z) !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	background: transparent !important;
	pointer-events: none !important;
	display: grid !important;
	grid-template-columns: 1fr !important;
	align-items: center !important;
	justify-items: center !important;
}

html.eduia-swal-identity-on .swal2-container.swal2-backdrop-show,
html.eduia-swal-identity-on .swal2-container.swal2-shown {
	background:
		radial-gradient(70% 45% at 50% 8%, rgba(24, 119, 242, 0.14), transparent 58%),
		rgba(15, 35, 55, 0.48) !important;
	-webkit-backdrop-filter: blur(8px) saturate(1.05);
	backdrop-filter: blur(8px) saturate(1.05);
	pointer-events: auto !important;
}

/* Centro maestro */
html.eduia-swal-identity-on .swal2-container.eduia-swal-container--center,
html.eduia-swal-identity-on .swal2-container.swal2-center,
html.eduia-swal-identity-on .swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right) {
	align-items: center !important;
	justify-items: center !important;
	justify-content: center !important;
}

/* Esquina toast (opt-in) */
html.eduia-swal-identity-on .swal2-container.swal2-top-end,
html.eduia-swal-identity-on .swal2-container.swal2-top-right,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-end,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-right {
	align-items: start !important;
	justify-items: end !important;
	justify-content: flex-end !important;
	background: transparent !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	pointer-events: none !important;
}

html.eduia-swal-identity-on .swal2-container .swal2-popup {
	pointer-events: auto !important;
	place-self: center !important;
	grid-column: 1 !important;
	grid-row: 1 !important;
}

html.eduia-swal-identity-on .swal2-container.swal2-top-end .swal2-popup,
html.eduia-swal-identity-on .swal2-container.swal2-top-right .swal2-popup {
	place-self: start end !important;
}

/* ——— Modal maestro ——— */
html.eduia-swal-identity-on .eduia-swal.eduia-swal--fx.swal2-popup,
html.eduia-swal-identity-on .eduia-swal.eduia-swal-master.swal2-popup {
	font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
	border-radius: var(--eduia-swal-radius) !important;
	padding: 0 !important;
	width: min(30rem, 94vw) !important;
	max-width: 94vw !important;
	overflow: hidden;
	border: 1px solid var(--eduia-swal-line) !important;
	background:
		linear-gradient(180deg, var(--eduia-swal-panel-2) 0%, var(--eduia-swal-panel) 42%) !important;
	color: var(--eduia-swal-ink) !important;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.85) inset,
		0 24px 56px rgba(15, 35, 55, 0.22) !important;
}

html.eduia-swal-identity-on .eduia-swal--fx.eduia-swal--error {
	border-color: #f0c4c0 !important;
}

html.eduia-swal-identity-on .eduia-swal--fx.eduia-swal--warning {
	border-color: #f5d9b0 !important;
}

html.eduia-swal-identity-on .eduia-swal--fx.eduia-swal--success {
	border-color: #b7ebc8 !important;
}

html.eduia-swal-identity-on .eduia-swal__title--hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
}

html.eduia-swal-identity-on .eduia-swal__html {
	margin: 0 !important;
	padding: 0 !important;
	color: inherit !important;
	overflow: visible !important;
	text-align: left !important;
}

html.eduia-swal-identity-on .eduia-swal--fx .swal2-icon {
	display: none !important;
}

html.eduia-swal-identity-on .eduia-fx {
	position: relative;
	padding: 1.35rem 1.4rem 0.35rem;
	text-align: left;
}

html.eduia-swal-identity-on .eduia-fx__sky {
	position: absolute;
	inset: 0 0 auto 0;
	height: 6.4rem;
	pointer-events: none;
	overflow: hidden;
	background:
		radial-gradient(90% 80% at 12% 0%, rgba(24, 119, 242, 0.14), transparent 55%),
		radial-gradient(70% 70% at 92% 10%, rgba(24, 119, 242, 0.08), transparent 52%),
		linear-gradient(180deg, rgba(24, 119, 242, 0.05), transparent 78%);
}

html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__sky {
	background:
		radial-gradient(90% 80% at 16% 0%, rgba(192, 57, 43, 0.12), transparent 55%),
		linear-gradient(180deg, rgba(254, 242, 242, 0.9), transparent 78%);
}

html.eduia-swal-identity-on .eduia-swal--warning .eduia-fx__sky {
	background:
		radial-gradient(90% 80% at 16% 0%, rgba(180, 83, 9, 0.12), transparent 55%),
		linear-gradient(180deg, rgba(255, 247, 237, 0.95), transparent 78%);
}

html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__sky {
	background:
		radial-gradient(90% 80% at 16% 0%, rgba(21, 128, 61, 0.12), transparent 55%),
		linear-gradient(180deg, rgba(236, 253, 245, 0.95), transparent 78%);
}

html.eduia-swal-identity-on .eduia-fx__star,
html.eduia-swal-identity-on .eduia-fx__beam,
html.eduia-swal-identity-on .eduia-fx__horizon {
	display: none;
}

html.eduia-swal-identity-on .eduia-fx__lock {
	position: relative;
	z-index: 1;
	margin-bottom: 0.85rem;
}

html.eduia-swal-identity-on .eduia-fx__identity {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	min-width: 0;
}

html.eduia-swal-identity-on .eduia-fx__logo {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	object-fit: contain;
	border-radius: 14px;
	background: #fff;
	border: 1px solid var(--eduia-swal-line);
	box-shadow: 0 8px 20px rgba(24, 119, 242, 0.12);
	padding: 5px;
}

html.eduia-swal-identity-on .eduia-fx__identity-copy {
	min-width: 0;
	flex: 1 1 auto;
}

html.eduia-swal-identity-on .eduia-fx__eyebrow {
	margin: 0 0 0.2rem;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--eduia-swal-brand);
}

html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__eyebrow { color: var(--eduia-swal-err); }
html.eduia-swal-identity-on .eduia-swal--warning .eduia-fx__eyebrow { color: var(--eduia-swal-warn); }
html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__eyebrow { color: var(--eduia-swal-ok); }

html.eduia-swal-identity-on .eduia-fx__brand {
	margin: 0;
	font-family: Syne, "IBM Plex Sans", sans-serif;
	font-weight: 800;
	font-size: clamp(1.45rem, 3.8vw, 1.85rem);
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--eduia-swal-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html.eduia-swal-identity-on .eduia-fx__path {
	display: flex;
	gap: 0.28rem;
	margin: 0.65rem 0 0;
	max-width: 7rem;
}

html.eduia-swal-identity-on .eduia-fx__path span {
	display: block;
	height: 3px;
	border-radius: 99px;
	flex: 1;
	background: #d0e4ff;
}

html.eduia-swal-identity-on .eduia-fx__path span:nth-child(1) { background: var(--eduia-swal-brand); }
html.eduia-swal-identity-on .eduia-fx__path span:nth-child(2) { background: #7eb6f8; }
html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__path span:nth-child(1) { background: var(--eduia-swal-ok); }
html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__path span:nth-child(1) { background: var(--eduia-swal-err); }

html.eduia-swal-identity-on .eduia-fx__body {
	position: relative;
	z-index: 1;
	padding: 0.15rem 0 0.1rem;
}

html.eduia-swal-identity-on .eduia-fx__motive {
	margin: 0 0 0.75rem;
	padding: 0.7rem 0.85rem;
	border-radius: 12px;
	border: 1px solid #cfe2ff;
	background:
		linear-gradient(135deg, rgba(24, 119, 242, 0.08), rgba(24, 119, 242, 0.02)),
		#f7faff;
	color: #0f3d7a;
	font-family: Syne, "IBM Plex Sans", sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.35;
}

html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__motive {
	border-color: #bbf7d0;
	background: linear-gradient(135deg, rgba(21, 128, 61, 0.08), rgba(21, 128, 61, 0.02)), #f3fbf6;
	color: #14532d;
}

html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__motive {
	border-color: #fecaca;
	background: linear-gradient(135deg, rgba(192, 57, 43, 0.08), rgba(192, 57, 43, 0.02)), #fff7f6;
	color: #7f1d1d;
}

html.eduia-swal-identity-on .eduia-swal--warning .eduia-fx__motive {
	border-color: #fed7aa;
	background: linear-gradient(135deg, rgba(180, 83, 9, 0.08), rgba(180, 83, 9, 0.02)), #fffaf3;
	color: #7c2d12;
}

html.eduia-swal-identity-on .eduia-fx__lead {
	margin: 0 0 0.4rem;
	font-family: Syne, "IBM Plex Sans", sans-serif;
	font-size: 1.08rem;
	line-height: 1.35;
	color: var(--eduia-swal-ink);
	font-weight: 700;
	letter-spacing: -0.02em;
}

html.eduia-swal-identity-on .eduia-fx__fine {
	margin: 0 0 0.7rem;
	font-size: 0.94rem;
	line-height: 1.5;
	color: var(--eduia-swal-muted);
	white-space: pre-line;
}

html.eduia-swal-identity-on .eduia-fx__tag {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.1rem 0 0;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--eduia-swal-brand-deep);
	background: var(--eduia-swal-soft);
	border: 1px solid #cfe2ff;
}

html.eduia-swal-identity-on .eduia-fx__tag::before {
	content: "";
	width: 0.35rem;
	height: 0.35rem;
	border-radius: 50%;
	background: var(--eduia-swal-brand);
}

html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__tag {
	color: var(--eduia-swal-ok);
	background: var(--eduia-swal-ok-soft);
	border-color: #bbf7d0;
}
html.eduia-swal-identity-on .eduia-swal--success .eduia-fx__tag::before { background: var(--eduia-swal-ok); }

html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__tag {
	color: var(--eduia-swal-err);
	background: var(--eduia-swal-err-soft);
	border-color: #fecaca;
}
html.eduia-swal-identity-on .eduia-swal--error .eduia-fx__tag::before { background: var(--eduia-swal-err); }

html.eduia-swal-identity-on .eduia-swal--warning .eduia-fx__tag {
	color: var(--eduia-swal-warn);
	background: var(--eduia-swal-warn-soft);
	border-color: #fed7aa;
}
html.eduia-swal-identity-on .eduia-swal--warning .eduia-fx__tag::before { background: var(--eduia-swal-warn); }

html.eduia-swal-identity-on .eduia-swal__actions {
	margin: 0 !important;
	padding: 0.95rem 1.35rem 1.2rem !important;
	gap: 0.5rem;
	border-top: 1px solid var(--eduia-swal-line);
	background: #f8fbff;
}

html.eduia-swal-identity-on .eduia-swal__actions--structure {
	flex-wrap: wrap;
	justify-content: stretch;
}
html.eduia-swal-identity-on .eduia-swal__actions--structure .eduia-swal__btn--go {
	flex: 1 1 100%;
	order: -1;
	margin-bottom: 0.15rem;
}
html.eduia-swal-identity-on .eduia-swal__actions--structure .eduia-swal__btn--ghost {
	flex: 1 1 calc(50% - 0.35rem);
}
html.eduia-swal-identity-on .eduia-fx__fine--cta {
	margin-top: 0.75rem;
	padding: 0.55rem 0.7rem;
	border-radius: 10px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1e3a5f;
}

html.eduia-swal-identity-on .eduia-swal__btn {
	border: 0;
	border-radius: 12px !important;
	padding: 0.72rem 1.15rem !important;
	font-weight: 700 !important;
	font-size: 0.92rem !important;
	cursor: pointer;
	transition: transform 0.16s var(--eduia-swal-ease), background 0.16s ease, box-shadow 0.16s ease;
}

html.eduia-swal-identity-on .eduia-swal__btn--go {
	color: #fff !important;
	background: linear-gradient(135deg, #3b8ef5 0%, var(--eduia-swal-brand) 100%) !important;
	box-shadow: 0 10px 22px rgba(24, 119, 242, 0.28) !important;
}

html.eduia-swal-identity-on .eduia-swal__btn--go:hover {
	transform: translateY(-1px);
	background: linear-gradient(135deg, var(--eduia-swal-brand) 0%, var(--eduia-swal-brand-deep) 100%) !important;
}

html.eduia-swal-identity-on .eduia-swal--success .eduia-swal__btn--go {
	background: linear-gradient(135deg, #22a354 0%, var(--eduia-swal-ok) 100%) !important;
	box-shadow: 0 10px 22px rgba(21, 128, 61, 0.24) !important;
}

html.eduia-swal-identity-on .eduia-swal--error .eduia-swal__btn--go {
	background: linear-gradient(135deg, #e15a4c 0%, var(--eduia-swal-err) 100%) !important;
	box-shadow: 0 10px 22px rgba(192, 57, 43, 0.24) !important;
}

html.eduia-swal-identity-on .eduia-swal__btn--ghost {
	color: var(--eduia-swal-ink) !important;
	background: #fff !important;
	border: 1px solid var(--eduia-swal-line) !important;
}

html.eduia-swal-identity-on .eduia-swal__btn--ghost:hover {
	background: var(--eduia-swal-soft) !important;
}

/* Implementing */
html.eduia-swal-identity-on .eduia-fx-impl {
	display: grid;
	gap: 0.55rem;
	padding: 0.15rem 0 0.4rem;
}

html.eduia-swal-identity-on .eduia-fx-impl__ring {
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	border: 3px solid #d7e8ff;
	border-top-color: var(--eduia-swal-brand);
	animation: eduiaFxSpin 0.85s linear infinite;
}

html.eduia-swal-identity-on .eduia-fx-ticks {
	list-style: none;
	margin: 0.35rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.28rem;
}

html.eduia-swal-identity-on .eduia-fx-ticks li {
	font-size: 0.84rem;
	color: var(--eduia-swal-muted);
	padding-left: 1.1rem;
	position: relative;
}

html.eduia-swal-identity-on .eduia-fx-ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35rem;
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: #c5d8ef;
}

html.eduia-swal-identity-on .eduia-fx-ticks li.is-on::before { background: var(--eduia-swal-ok); }
html.eduia-swal-identity-on .eduia-fx-ticks li.is-run::before {
	background: var(--eduia-swal-brand);
	box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.15);
}

html.eduia-swal-identity-on .eduia-swal--implementing .swal2-loader,
html.eduia-swal-identity-on .eduia-swal__loader {
	border-color: #d7e8ff transparent #d7e8ff transparent !important;
}

html.eduia-swal-identity-on .eduia-swal--fx .swal2-timer-progress-bar {
	background: var(--eduia-swal-brand) !important;
	height: 3px !important;
}

html.eduia-swal-identity-on .eduia-swal--success .swal2-timer-progress-bar {
	background: var(--eduia-swal-ok) !important;
}

html.eduia-swal-identity-on .eduia-swal--error .swal2-timer-progress-bar {
	background: var(--eduia-swal-err) !important;
}

/* ——— Toast esquina (solo opt-in) ——— */
html.eduia-swal-identity-on .eduia-swal.eduia-swal--toast.swal2-popup {
	font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
	width: auto !important;
	max-width: min(94vw, 24rem) !important;
	padding: 0.7rem 0.9rem !important;
	border-radius: 14px !important;
	border: 1px solid var(--eduia-swal-line) !important;
	background: #fff !important;
	color: var(--eduia-swal-ink) !important;
	box-shadow: 0 14px 34px rgba(15, 35, 55, 0.16) !important;
	display: grid !important;
	grid-template-columns: auto 1fr !important;
	align-items: center !important;
	gap: 0.55rem 0.7rem !important;
}

html.eduia-swal-identity-on .eduia-swal--toast .swal2-icon {
	width: 1.75rem !important;
	height: 1.75rem !important;
	margin: 0 !important;
	grid-row: 1 / span 2;
}

html.eduia-swal-identity-on .eduia-swal--toast .swal2-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.92rem !important;
	font-weight: 700 !important;
	color: var(--eduia-swal-ink) !important;
	text-align: left !important;
	line-height: 1.3 !important;
}

html.eduia-swal-identity-on .eduia-swal--toast .swal2-html-container {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.8rem !important;
	color: var(--eduia-swal-muted) !important;
	text-align: left !important;
}

html.eduia-swal-identity-on .eduia-swal--toast .swal2-timer-progress-bar {
	background: var(--eduia-swal-brand) !important;
	height: 2px !important;
}

/* Fallback popups sin clase EduIA */
html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) {
	font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif !important;
	border-radius: 16px !important;
	border: 1px solid var(--eduia-swal-line) !important;
	background: #fff !important;
	color: var(--eduia-swal-ink) !important;
	box-shadow: 0 22px 48px rgba(15, 35, 55, 0.18) !important;
	width: min(30rem, 94vw) !important;
}

html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) .swal2-title {
	color: var(--eduia-swal-ink) !important;
	font-weight: 700 !important;
}

html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) .swal2-html-container,
html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) .swal2-content {
	color: var(--eduia-swal-muted) !important;
}

html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) .swal2-confirm {
	border-radius: 12px !important;
	font-weight: 700 !important;
	background: var(--eduia-swal-brand) !important;
	color: #fff !important;
	border: 0 !important;
}

html.eduia-swal-identity-on .swal2-popup:not(.eduia-swal) .swal2-cancel {
	border-radius: 12px !important;
	font-weight: 700 !important;
	background: #fff !important;
	color: var(--eduia-swal-ink) !important;
	border: 1px solid var(--eduia-swal-line) !important;
}

/* Anula reglas legacy de sweetalert-custom.css que colapsan el contenedor */
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-end,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-right,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-start,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-top-left,
html.eduia-swal-identity-on body.swal2-toast-shown .swal2-container.swal2-center,
html.eduia-swal-identity-on body.swal2-no-backdrop .swal2-shown {
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	transform: none !important;
	width: 100% !important;
	height: 100% !important;
}

@keyframes eduiaFxSpin {
	to { transform: rotate(360deg); }
}
