/**
 * Styles pour [makaria_install_app] : bouton + modal d'instructions iOS animé + banner persistant.
 * Palette Makaria : bleu nuit #1f3a5f / bronze #a98a55 / beige #f7f6f1 / rouge accent #b3251c
 */

/* ============================================================
   Bouton « Installer l'app »
   ============================================================ */

.es-install-wrap { display: inline-block; }

/* Masquage robuste : prioritaire sur display:inline-flex du bouton */
.es-install-btn--hidden,
.es-install-btn[hidden] {
	display: none !important;
}

.es-install-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.8rem 1.5rem;
	border-radius: 8px;
	border: 0;
	font: inherit;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
	line-height: 1.2;
}
.es-install-btn:active { transform: scale(0.98); }

.es-install-btn--primary {
	background: #1f3a5f;
	color: #fff;
	box-shadow: 0 2px 6px rgba(31,58,95,0.25);
}
.es-install-btn--primary:hover { background: #16294a; }

.es-install-btn--secondary {
	background: #a98a55;
	color: #fff;
}
.es-install-btn--secondary:hover { background: #8c6d3e; }

.es-install-btn--ghost {
	background: transparent;
	color: #1f3a5f;
	border: 1.5px solid #1f3a5f;
}
.es-install-btn--ghost:hover { background: rgba(31,58,95,0.08); }

/* ============================================================
   Modal iOS — illustration + 3 étapes
   ============================================================ */

.es-install-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.es-install-modal[hidden] { display: none; }

.es-install-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	animation: es-fade-in 0.2s ease-out;
}
@keyframes es-fade-in { from { opacity: 0; } to { opacity: 1; } }

.es-install-modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 480px;
	width: 100%;
	padding: 1.5rem 1.5rem 1.25rem;
	box-shadow: 0 16px 56px rgba(0, 0, 0, 0.28);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #222b3a;
	animation: es-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	max-height: 92vh;
	overflow-y: auto;
}
@keyframes es-slide-up {
	from { transform: translateY(40px) scale(0.95); opacity: 0; }
	to { transform: translateY(0) scale(1); opacity: 1; }
}

.es-install-modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	background: transparent;
	border: 0;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	z-index: 2;
}
.es-install-modal-close:hover { background: #f0f0f1; color: #222b3a; }

/* ============================================================
   Illustration animée : iPhone SVG + flèche pulse + icône bounce
   ============================================================ */

.es-install-illustration {
	position: relative;
	width: 200px;
	height: 280px;
	margin: 0.5rem auto 1.25rem;
}

.es-illu-iphone {
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.18));
}

/* Bouton « ⋯ » de la barre Safari (iOS 15+) : pulse en cercle */
.es-illu-share-btn {
	transform-origin: 168px 258px;
	animation: es-share-pulse 1.8s ease-in-out infinite;
}
@keyframes es-share-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.35); opacity: 0.9; }
}

/* Flèche rouge qui pointe vers le bouton « ⋯ » (à droite de la barre) */
.es-illu-arrow {
	position: absolute;
	width: 38px;
	height: 54px;
	right: 18px;
	bottom: -6px;
	animation: es-arrow-bounce 1.5s ease-in-out infinite;
	filter: drop-shadow(0 3px 6px rgba(179, 37, 28, 0.35));
}
@keyframes es-arrow-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

/* Icône Makaria qui « saute » depuis la barre Safari vers le haut */
.es-illu-icon {
	position: absolute;
	width: 56px;
	height: 56px;
	top: 18%;
	left: 50%;
	transform: translateX(-50%);
	border-radius: 12px;
	box-shadow: 0 6px 16px rgba(31, 58, 95, 0.35);
	opacity: 0;
	animation: es-icon-jump 3s ease-out 0.5s infinite;
}
@keyframes es-icon-jump {
	0% { transform: translate(-50%, 130px) scale(0.4); opacity: 0; }
	35% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; }
	50% { transform: translate(-50%, 0) scale(1); opacity: 1; }
	85% { transform: translate(-50%, 0) scale(1); opacity: 1; }
	100% { transform: translate(-50%, 0) scale(1); opacity: 0; }
}

/* ============================================================
   Header + étapes
   ============================================================ */

.es-install-modal-header {
	text-align: center;
	margin-bottom: 1.25rem;
	padding: 0 1rem;
}
.es-install-modal-header h3 {
	margin: 0;
	font-size: 1.15rem;
	color: #1f3a5f;
	line-height: 1.35;
	font-weight: 600;
}

.es-install-modal-steps {
	margin: 0 0 1.25rem;
	padding-left: 1.5rem;
	color: #222b3a;
	font-size: 0.95rem;
	line-height: 1.55;
}
.es-install-modal-steps li {
	margin-bottom: 0.75rem;
	padding-left: 0.25rem;
}
.es-install-modal-steps li::marker {
	color: #a98a55;
	font-weight: bold;
}
.es-install-modal-steps strong { color: #1f3a5f; }

.es-install-modal-note {
	background: #f7f6f1;
	padding: 0.7rem 1rem;
	border-radius: 6px;
	border-left: 3px solid #a98a55;
	font-size: 0.85rem;
	color: #6b4a1a;
	margin: 0 0 1.25rem;
	line-height: 1.5;
}

.es-install-modal-tip {
	background: #eef0f4;
	padding: 0.6rem 0.85rem;
	border-radius: 6px;
	font-size: 0.78rem;
	color: #4a5568;
	margin: 0 0 1rem;
	line-height: 1.45;
	font-style: italic;
}

.es-install-modal-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}
.es-install-modal-ok {
	flex: 1;
}
.es-install-modal-later {
	background: transparent;
	border: 0;
	font: inherit;
	font-size: 0.9rem;
	color: #6b7280;
	cursor: pointer;
	padding: 0.6rem 1rem;
	text-decoration: underline;
}
.es-install-modal-later:hover { color: #222b3a; }

/* ============================================================
   Banner persistant en bas d'écran
   ============================================================ */

.es-install-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
	padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid #e2dfd5;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
}
.es-install-banner[hidden] { display: none; }
.es-install-banner.es-install-banner--visible {
	transform: translateY(0);
	opacity: 1;
}

.es-install-banner-icon {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	flex-shrink: 0;
	box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.es-install-banner-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.es-install-banner-text strong {
	color: #1f3a5f;
	font-size: 0.95rem;
	font-weight: 600;
}
.es-install-banner-text small {
	color: #6b7280;
	font-size: 0.8rem;
	margin-top: 0.1rem;
}

.es-install-banner-cta {
	background: #1f3a5f;
	color: #fff;
	border: 0;
	padding: 0.55rem 1rem;
	border-radius: 6px;
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}
.es-install-banner-cta:active { background: #16294a; }

.es-install-banner-close {
	background: transparent;
	border: 0;
	color: #6b7280;
	font-size: 1.5rem;
	line-height: 1;
	padding: 0.25rem 0.5rem;
	cursor: pointer;
	flex-shrink: 0;
}
.es-install-banner-close:hover { color: #222b3a; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 480px) {
	.es-install-modal-content {
		padding: 1.25rem 1rem 1rem;
		border-radius: 14px;
	}
	.es-install-illustration {
		width: 170px;
		height: 238px;
	}
	.es-install-illustration .es-illu-icon {
		width: 48px;
		height: 48px;
	}
	.es-install-banner-text small { display: none; }
}

@media (max-width: 360px) {
	.es-install-btn {
		padding: 0.7rem 1rem;
		font-size: 0.9rem;
	}
}

/* Respecte la préférence reduced-motion de l'utilisateur */
@media (prefers-reduced-motion: reduce) {
	.es-illu-share-btn,
	.es-illu-arrow,
	.es-illu-icon,
	.es-install-modal-backdrop,
	.es-install-modal-content,
	.es-install-banner {
		animation: none !important;
		transition: none !important;
	}
	.es-illu-icon { opacity: 1; }
}
