:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
	margin: 0;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background: radial-gradient(circle at top left, #eef2ff, transparent 60%),
		radial-gradient(circle at bottom right, #ecfeff, transparent 55%),
		#f8fafc;
	color: #0f172a;
}

/* --- Language switcher (home/_language_switcher.php), shared by both pages --- */
.lang-switcher {
	position: relative;
}
.auth-page .lang-switcher {
	position: absolute;
	top: 24px;
	right: 24px;
}
.lang-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 10px;
	border-radius: 8px;
	cursor: pointer;
}
.lang-toggle:hover {
	background: #f8fafc;
}
.lang-flag {
	display: block;
	width: 22px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}
.lang-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 150px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.2);
	padding: 6px;
	display: none;
	z-index: 60;
}
.lang-switcher.is-open .lang-menu {
	display: block;
}
.lang-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 7px;
	font-size: 13px;
	color: #334155;
	text-decoration: none;
}
.lang-option:hover {
	background: #f8fafc;
}
.lang-option.is-active {
	color: #4f46e5;
	font-weight: 600;
}
@media (max-width: 480px) {
	.lang-name {
		display: none;
	}
}

/* --- Login page (home/login.php) --- */
.auth-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	position: relative;
}
.auth-card {
	width: 100%;
	max-width: 380px;
	background: #fff;
	border-radius: 16px;
	padding: 32px 28px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -8px rgba(15, 23, 42, 0.12);
}
.auth-logo {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	margin-bottom: 20px;
	display: block;
	object-fit: cover;
}
.auth-card h1 {
	font-size: 20px;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 4px;
}
.subtitle {
	font-size: 14px;
	color: #64748b;
	margin: 0 0 24px;
}
.error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 13px;
	padding: 10px 12px;
	border-radius: 8px;
	margin-bottom: 16px;
}
.auth-card label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #334155;
	margin-bottom: 6px;
}
.field {
	margin-bottom: 16px;
}
input[type="email"],
input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	color: #0f172a;
	transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="email"]:focus,
input[type="password"]:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auth-card button[type="submit"] {
	width: 100%;
	padding: 11px;
	border: none;
	border-radius: 8px;
	background: #4f46e5;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}
.auth-card button[type="submit"]:hover {
	background: #4338ca;
}
.divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 20px 0;
	color: #94a3b8;
	font-size: 12px;
}
.divider::before,
.divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e2e8f0;
}
.google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 10px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: #334155;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}
.google-btn:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

/* --- Dashboard page (home/dashboard.php) --- */
.wrap {
	max-width: 640px;
	margin: 0 auto;
	padding: 32px 24px;
}
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 16px;
}
.topbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}
.logo {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	object-fit: cover;
	display: block;
}
.logout-btn {
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
	font-size: 13px;
	font-weight: 500;
	padding: 7px 14px;
	border-radius: 8px;
	cursor: pointer;
}
.logout-btn:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}
.card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -8px rgba(15, 23, 42, 0.10);
	margin-bottom: 24px;
	overflow: hidden;
}
.identity {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 24px;
}
.avatar {
	width: 56px;
	height: 56px;
	border-radius: 999px;
	background: #4f46e5;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 20px;
	flex-shrink: 0;
	overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; flex-shrink: 0; margin: 0; }
.avatar-edit-btn {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: #4f46e5;
	color: #fff;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 2px solid #fff;
}
.avatar-edit-btn:hover { background: #4338ca; }
.avatar-file-input { display: none; }
.avatar-error { margin: 6px 0 0; font-size: 12px; color: #b91c1c; }
.spinner {
	display: block;
	width: 12px;
	height: 12px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast-container {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.toast {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
	animation: toast-in 0.2s ease-out;
}
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
@keyframes toast-in {
	from { opacity: 0; transform: translateX(16px); }
	to { opacity: 1; transform: translateX(0); }
}
.identity h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.identity p { margin: 0; font-size: 13px; color: #64748b; }
.badge {
	display: inline-block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 600;
	color: #4f46e5;
}
h3 {
	margin: 28px 0 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
}
.row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	border-top: 1px solid #f1f5f9;
}
.row:first-child { border-top: none; }
.row .icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: #eef2ff;
	color: #4f46e5;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 14px;
}
.row .main { flex: 1; min-width: 0; }
.row .main p { margin: 0; }
.row .title { font-size: 14px; font-weight: 500; }
.row .meta { font-size: 12px; color: #64748b; margin-top: 2px; word-break: break-word; }
.empty { padding: 16px 20px; font-size: 13px; color: #94a3b8; }
.revoke-btn {
	flex-shrink: 0;
	border: 1px solid #fecaca;
	background: #fff;
	color: #b91c1c;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 10px;
	border-radius: 7px;
	cursor: pointer;
}
.revoke-btn:hover { background: #fef2f2; }
.status-pill {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	white-space: nowrap;
}
.status-active { background: #d1fae5; color: #047857; }
.status-expired { background: #fef3c7; color: #b45309; }
.status-ended { background: #f1f5f9; color: #64748b; }

/* --- Shared custom confirm dialog (replaces the browser's native confirm()) --- */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 50;
}
.modal-backdrop.is-open { display: flex; }
.modal-box {
	width: 100%;
	max-width: 360px;
	background: #fff;
	border-radius: 14px;
	padding: 24px;
	box-shadow: 0 20px 60px -12px rgba(15, 23, 42, 0.35);
}
.modal-message {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.5;
	color: #0f172a;
}
.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}
.modal-btn {
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid transparent;
}
.modal-btn-cancel {
	background: #fff;
	border-color: #cbd5e1;
	color: #334155;
}
.modal-btn-cancel:hover { background: #f8fafc; }
.modal-btn-confirm {
	background: #dc2626;
	color: #fff;
}
.modal-btn-confirm:hover { background: #b91c1c; }
