/* ════════════════════════════════════════════════════════════════════════════ */
/* ── base.css — Reset, typography, buttons, forms, utilities ───────────────── */
/* ════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html, body {
	height: 100%;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text-primary);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	transition: background 0.3s ease, color 0.3s ease;
	font-size: 15px;
	line-height: 1.55;
}

/* ── Custom scrollbars (subtle) ────────────────────────────────────────────── */
* {
	scrollbar-width: thin;
	scrollbar-color: var(--scrollbar-thumb) transparent;
}

::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--scrollbar-thumb); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Accessibility: skip link ──────────────────────────────────────────────── */
.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	background: var(--accent);
	color: var(--accent-contrast);
	padding: 10px 18px;
	font-weight: 700;
	font-size: 0.9rem;
	border-radius: 0 0 var(--radius-sm) 0;
	z-index: 9999;
	text-decoration: none;
	transition: top 0.15s ease;
}

.skip-link:focus { top: 0; }

/* ── Global focus indicator ────────────────────────────────────────────────── */
*:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
	border-radius: var(--radius-xs);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Message chips ─────────────────────────────────────────────────────────── */
.error-msg {
	color: var(--danger-dark);
	font-size: 0.85rem;
	margin-top: 8px;
	padding: 9px 13px;
	background: var(--danger-soft);
	border-radius: var(--radius-sm);
	line-height: 1.5;
}

.success-msg {
	color: var(--success-dark);
	font-size: 0.85rem;
	margin-top: 8px;
	padding: 9px 13px;
	background: var(--success-soft);
	border-radius: var(--radius-sm);
	line-height: 1.5;
}

.msg {
	font-size: 0.85rem;
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	min-height: 0;
	line-height: 1.5;
}

.msg.success { color: var(--success-dark); background: var(--success-soft); }
.msg.error   { color: var(--danger-dark);  background: var(--danger-soft); }

/* ── Form Groups ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-group input {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.95rem;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text-primary);
	transition: var(--transition);
	outline: none;
}

.form-group input:focus {
	border-color: var(--accent);
	background: var(--surface);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Screens ───────────────────────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border: none;
	border-radius: var(--radius-sm);
	font-size: 0.92rem;
	font-family: var(--font);
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	gap: 7px;
	line-height: 1.2;
}

.btn-primary {
	background: var(--accent);
	color: var(--accent-contrast);
	width: 100%;
	margin-top: 4px;
	box-shadow: var(--shadow-xs);
}
.btn-primary:hover  { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
	background: var(--surface);
	color: var(--text-primary);
	border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--sidebar-bg); border-color: var(--border-strong); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Generic icon button ───────────────────────────────────────────────────── */
.icon-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-sm);
	color: var(--text-secondary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: var(--transition);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text-primary); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger-dark); }

/* ── Pin button active state ───────────────────────────────────────────────── */
#pin-note-btn.active { color: var(--accent-hover); background: var(--accent-soft); }
#pin-note-btn.active:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* ── PRO badge ─────────────────────────────────────────────────────────────── */
.pro-badge {
	display: inline-block;
	background: var(--accent);
	color: var(--accent-contrast);
	font-size: 0.62rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 7px;
	border-radius: var(--radius-xs);
	line-height: 1.5;
	vertical-align: middle;
	margin-left: 4px;
	flex-shrink: 0;
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}