/* ─── Install Prompt — Core Academy ──────────────────────────────────────────
   Bottom sheet en móvil / tarjeta flotante en escritorio.
   El prompt está oculto por defecto; JS añade .psa-prompt--visible para mostrarlo.
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Contenedor raíz ────────────────────────────────────────────────────── */

#psa-install-prompt {
	position: fixed;
	inset: 0;
	z-index: 99998;
	visibility: hidden;
	pointer-events: none;
}

#psa-install-prompt.psa-prompt--visible {
	visibility: visible;
	pointer-events: auto;
}

/* ─── Fondo oscuro ───────────────────────────────────────────────────────── */

.psa-prompt__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, .45 );
	opacity: 0;
	transition: opacity .3s ease;
}

#psa-install-prompt.psa-prompt--visible .psa-prompt__backdrop {
	opacity: 1;
}

/* ─── Hoja / sheet ───────────────────────────────────────────────────────── */

.psa-prompt__sheet {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: var( --psa-bg, #fff );
	border-radius: 22px 22px 0 0;
	padding: 0 24px 40px;
	transform: translateY( 100% );
	transition: transform .38s cubic-bezier( .32, .72, 0, 1 );
	max-width: 540px;
	margin: 0 auto;
	box-shadow: 0 -6px 48px rgba( 0, 0, 0, .14 );
}

#psa-install-prompt.psa-prompt--visible .psa-prompt__sheet {
	transform: translateY( 0 );
}

/* Indicador de arrastre (pill) */
.psa-prompt__handle {
	width: 40px;
	height: 4px;
	background: #ddd;
	border-radius: 2px;
	margin: 12px auto 20px;
}

/* ─── Botón de cierre ────────────────────────────────────────────────────── */

.psa-prompt__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 30px;
	height: 30px;
	border: none;
	background: #f0f0f0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #555;
	padding: 0;
	flex-shrink: 0;
	transition: background .15s;
}

.psa-prompt__close:hover {
	background: #e0e0e0;
}

.psa-prompt__close svg {
	width: 14px;
	height: 14px;
	display: block;
}

/* ─── Cabecera: ícono + nombre ───────────────────────────────────────────── */

.psa-prompt__header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}

.psa-prompt__icon img {
	width: 58px;
	height: 58px;
	border-radius: 14px;
	object-fit: cover;
	flex-shrink: 0;
}

.psa-prompt__icon-placeholder {
	width: 58px;
	height: 58px;
	border-radius: 14px;
	background: var( --psa-primary, #c97b8a );
	color: #fff;
	font-size: 26px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-family: var( --psa-font, sans-serif );
}

.psa-prompt__app-name {
	font-size: 17px;
	font-weight: 700;
	color: var( --psa-text, #1a1a1a );
	margin: 0 0 4px;
	font-family: var( --psa-font, sans-serif );
	line-height: 1.2;
}

.psa-prompt__app-desc {
	font-size: 13px;
	color: #777;
	margin: 0;
	font-family: var( --psa-font, sans-serif );
	line-height: 1.3;
}

/* ─── Pasos (iOS) ────────────────────────────────────────────────────────── */

.psa-prompt__steps {
	list-style: none;
	padding: 0;
	margin: 0 0 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.psa-prompt__steps li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 14px;
	color: var( --psa-text, #1a1a1a );
	font-family: var( --psa-font, sans-serif );
	line-height: 1.5;
}

.psa-prompt__step-num {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var( --psa-primary, #c97b8a );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

/* Íconos inline dentro de los pasos */
.psa-prompt__icon-inline {
	display: inline-flex;
	vertical-align: middle;
	width: 20px;
	height: 20px;
	margin: 0 2px;
	color: var( --psa-primary, #c97b8a );
	position: relative;
	top: -1px;
}

/* ─── Texto de ayuda (Desktop) ───────────────────────────────────────────── */

.psa-prompt__desktop-hint {
	font-size: 14px;
	color: #666;
	font-family: var( --psa-font, sans-serif );
	line-height: 1.5;
	margin: 0 0 20px;
}

/* ─── Botones ────────────────────────────────────────────────────────────── */

.psa-prompt__btn-primary {
	width: 100%;
	padding: 14px;
	background: var( --psa-primary, #c97b8a );
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	font-family: var( --psa-font, sans-serif );
	transition: opacity .2s;
	margin-bottom: 10px;
	letter-spacing: .01em;
}

.psa-prompt__btn-primary:hover { opacity: .9; }
.psa-prompt__btn-primary:active { opacity: .85; }

.psa-prompt__btn-secondary {
	display: block;
	width: 100%;
	padding: 10px;
	background: none;
	border: none;
	font-size: 14px;
	color: #999;
	cursor: pointer;
	font-family: var( --psa-font, sans-serif );
	text-align: center;
	transition: color .15s;
}

.psa-prompt__btn-secondary:hover { color: #555; }

/* ─── iPad: modal centrado ───────────────────────────────────────────────── */

.psa-device--ipad .psa-prompt__sheet {
	position: absolute;
	top: 50%;
	left: 50%;
	bottom: auto;
	right: auto;
	width: calc( 100% - 48px );
	max-width: 440px;
	border-radius: 18px;
	transform: translate( -50%, calc( -50% + 24px ) );
	opacity: 0;
	transition: transform .32s ease, opacity .32s ease;
	box-shadow: 0 12px 60px rgba( 0, 0, 0, .22 );
}

#psa-install-prompt.psa-prompt--visible.psa-device--ipad .psa-prompt__sheet {
	transform: translate( -50%, -50% );
	opacity: 1;
}

.psa-device--ipad .psa-prompt__handle {
	display: none;
}

/* ─── Desktop: tarjeta flotante en esquina inferior derecha ──────────────── */

.psa-device--desktop .psa-prompt__backdrop {
	display: none;
}

.psa-device--desktop .psa-prompt__sheet {
	bottom: 24px;
	right: 24px;
	left: auto;
	top: auto;
	max-width: 360px;
	border-radius: 18px;
	transform: translateY( 20px );
	opacity: 0;
	transition: transform .3s ease, opacity .3s ease;
	box-shadow: 0 8px 48px rgba( 0, 0, 0, .18 );
}

#psa-install-prompt.psa-prompt--visible.psa-device--desktop .psa-prompt__sheet {
	transform: translateY( 0 );
	opacity: 1;
}

.psa-device--desktop .psa-prompt__handle {
	display: none;
}

@media ( max-width: 420px ) {
	.psa-device--desktop .psa-prompt__sheet {
		right: 12px;
		bottom: 12px;
		max-width: calc( 100% - 24px );
	}
}

/* ─── Micro-animación del botón instalar ─────────────────────────────────── */

@keyframes psa-pulse {
	0%, 100% { transform: scale( 1 ); }
	50%       { transform: scale( 1.02 ); }
}

.psa-prompt__btn-primary.psa-pulse {
	animation: psa-pulse 1.8s ease-in-out infinite;
}
