/*
 * client-auth — the bits injected into the certificate / report generator pages:
 * the account bar, the save-status pill, the "مسح البيانات" button and its undo.
 *
 * Self-contained tokens because auth.css is not loaded on these pages. Every
 * class is ca- prefixed: admin-library's global stylesheet is present on every
 * page of this site and owns .modal, .form-group, .submit-btn, .spinner, .badge
 * and @keyframes spin.
 */

.ca-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	direction: rtl;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, sans-serif;
	font-size: 0.92em;
	line-height: 1.6;
	padding: 12px 16px;
	border-radius: 14px;
	margin-bottom: 14px;
}

.ca-bar--in {
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
	border: 1px solid rgba(102, 126, 234, 0.25);
	color: #3f3f57;
}

.ca-bar--out {
	background: #fff8e6;
	border: 1px solid #f2d78d;
	color: #7a5c12;
}

.ca-bar--offer {
	background: #eef7ff;
	border: 1px solid #b6d9f6;
	color: #1c4f75;
}

.ca-bar__msg {
	flex: 1 1 260px;
}

.ca-bar__links {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

.ca-bar__links a {
	display: inline-block;
	padding: 7px 15px;
	border-radius: 20px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	color: #667eea;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.ca-bar__links a:hover {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-color: transparent;
	color: #fff;
	text-decoration: none;
}

/* ---------------------------------------------------------- Clear button */

/*
 * Deliberately quieter than the generator's own "إنشاء" button: this is a
 * destructive action and must not out-shout the primary one.
 */
.ca-clear-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid #dfe3e6;
	border-radius: 10px;
	background: #fff;
	color: #6c757d;
	font-family: inherit;
	font-size: 0.88em;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: all 0.3s ease;
	vertical-align: middle;
}

.ca-clear-btn:hover {
	background: #dc3545;
	border-color: #dc3545;
	color: #fff;
}

.ca-clear-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

/* ------------------------------------------------------------------ Undo */

.ca-undo-wrap {
	display: none;
	align-items: center;
	gap: 8px;
	margin-inline-start: 10px;
	padding: 6px 12px;
	border-radius: 10px;
	background: #f1f3f5;
	color: #495057;
	font-size: 0.88em;
	vertical-align: middle;
}

.ca-undo-wrap.is-visible {
	display: inline-flex;
	animation: ca-fade-in 0.25s ease;
}

.ca-undo-btn {
	background: none;
	border: 0;
	padding: 0;
	color: #667eea;
	font-family: inherit;
	font-size: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: underline;
}

.ca-undo-btn:hover {
	color: #764ba2;
}

/* ------------------------------------------------------------ Status pill */

.ca-save-status {
	display: none;
	align-items: center;
	margin-inline-start: 10px;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.84em;
	font-weight: 600;
	line-height: 1.4;
	background: #f1f3f5;
	color: #6c757d;
	vertical-align: middle;
	white-space: nowrap;
}

.ca-save-status.is-visible {
	display: inline-flex;
}

.ca-save-status.is-saving {
	background: #eef1ff;
	color: #4a5bbf;
}

.ca-save-status.is-saved {
	background: #d1fae5;
	color: #056d43;
}

.ca-save-status.is-local {
	background: #fff3cd;
	color: #7a5c12;
}

.ca-save-status.is-error {
	background: #fee2e2;
	color: #b32330;
}

/* Uniquely named — admin-library already owns @keyframes float/spin/ripple. */
@keyframes ca-fade-in {
	from {
		opacity: 0;
		transform: translateY(-3px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 600px) {
	.ca-bar {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.ca-bar__links {
		justify-content: center;
	}

	.ca-undo-wrap,
	.ca-save-status {
		margin: 8px 0 0;
	}
}
