/* Backup reminder card (ui/backup-reminder-card.js) */

/* Announcer for screen readers; the card itself is announced through it. */
.backup-card-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.backup-card {
	/* A popover is centred by the browser; put it in the corner instead. */
	position: fixed;
	inset: auto 20px 20px auto;
	margin: 0;
	z-index: 2100;

	box-sizing: border-box;
	width: min(22.5rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	overflow: auto;
	padding: 1rem 1.1rem 0.9rem;

	background: var(--theme-bg-secondary);
	color: var(--theme-text-primary);
	border: 1px solid var(--theme-border-primary);
	border-left: 3px solid var(--theme-primary);
	border-radius: 10px;
	box-shadow: var(--theme-shadow-secondary);
	font-size: 0.85rem;
	line-height: 1.5;

	opacity: 1;
	translate: 0;
	transition: opacity 0.25s ease-out, translate 0.25s ease-out;
}

/* Entry: slide up from below when the card is first rendered */
@starting-style {
	.backup-card {
		opacity: 0;
		translate: 0 16px;
	}
}

/* Exit: set by the script, which removes the card when the transition ends */
.backup-card[data-closing] {
	opacity: 0;
	translate: 0 16px;
}

.backup-card-title {
	margin: 0 1.75rem 0.35rem 0;
	font-size: 0.95rem;
	font-weight: 600;
}

.backup-card-text {
	margin: 0 0 0.85rem;
	color: var(--theme-text-secondary);
}

.backup-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.backup-card-btn {
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--theme-border-primary);
	border-radius: 6px;
	background: transparent;
	color: var(--theme-text-primary);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.backup-card-btn:hover {
	background: var(--theme-bg-hover);
}

.backup-card-btn-primary {
	border-color: transparent;
	background: var(--theme-primary);
	color: var(--theme-on-primary);
}

.backup-card-btn-primary:hover {
	background: var(--theme-primary-hover);
}

.backup-card-optout {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--theme-text-muted);
	font-size: 0.8rem;
	cursor: pointer;
}

.backup-card-optout input {
	margin: 0;
	accent-color: var(--theme-primary);
}

.backup-card-close {
	position: absolute;
	top: 0.4rem;
	right: 0.45rem;
	width: 1.75rem;
	height: 1.75rem;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--theme-text-muted);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}

.backup-card-close:hover {
	background: var(--theme-bg-hover);
	color: var(--theme-text-primary);
}

.backup-card-btn:focus-visible,
.backup-card-close:focus-visible,
.backup-card-optout input:focus-visible {
	outline: 2px solid var(--theme-text-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.backup-card {
		translate: none;
		transition-duration: 0.1s;
	}

	@starting-style {
		.backup-card {
			translate: none;
		}
	}

	.backup-card[data-closing] {
		translate: none;
	}
}
