:root {
	--bg1: #050817;
	--bg2: #0d1228;
	--panel: rgba(16, 24, 48, 0.8);
	--panel-border: rgba(80, 120, 255, 0.2);
	--text: #e9eefb;
	--muted: #9db0d3;
	--brand1: #6aa0ff;
	--brand2: #00e0ff;
	--ok: #2ecc71;
	--err: #e74c3c;
	--danger-bg: #7a1f2a;
	--danger-border: #b53644;
}

/* smooth text */
* {
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	margin: 0;
	padding: 0;
}

html, body {
	min-height: 100%;
	background: radial-gradient(circle at 30% 30%, var(--bg2) 0%, var(--bg1) 100%);
	color: var(--text);
	font-family: "Segoe UI", Roboto, Ubuntu, system-ui, sans-serif;
	line-height: 1.55;
}

/* subtle animated glow backdrop */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	background:
		radial-gradient(circle at 20% 20%, #6aa0ff22 0%, transparent 60%),
		radial-gradient(circle at 80% 30%, #00e0ff18 0%, transparent 60%);
	filter: blur(80px);
	animation: pulse 10s infinite alternate;
	pointer-events: none;
	z-index: 0;
}

@keyframes pulse {
	0% { opacity: 0.4; }
	100% { opacity: 0.7; }
}

/* WRAPPERS -------------------------------------------------- */

.wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 16px;
	position: relative;
	z-index: 1;
}

/* HEADER / NAV -------------------------------------------- */

.topbar {
	background: rgba(10, 15, 35, 0.8);
	border-bottom: 1px solid #1e2750;
	backdrop-filter: blur(12px);
	box-shadow: 0 10px 30px #00000080;
	position: sticky;
	top: 0;
	z-index: 10;
}

.topbar .wrap {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 56px;
}

.topbar h1 {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: var(--brand1);
	text-shadow: 0 0 8px #6aa0ff60;
}

.topbar h1 a {
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 6px;
}

.topbar nav {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* BUTTONS -------------------------------------------------- */

.btn {
	display: inline-block;
	padding: 9px 14px;
	border-radius: 10px;
	border: 1px solid #2a3a70;
	background: #203060;
	color: #dfe7ff;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.18s ease;
}

.btn:hover {
	background: #2a3a70;
	box-shadow: 0 8px 24px #00000080;
	transform: translateY(-1px);
}

.btn.primary {
	background: linear-gradient(135deg, var(--brand1), var(--brand2));
	border: 1px solid #3a5ac5;
	box-shadow: 0 12px 28px #00e0ff40;
	color: #fff;
	font-weight: 600;
	text-align: center;
}

.btn.primary:hover {
	filter: brightness(1.08);
	box-shadow: 0 16px 32px #00e0ff66;
	transform: translateY(-2px);
}

.btn.danger {
	background: var(--danger-bg);
	border-color: var(--danger-border);
	color: #fff;
	box-shadow: 0 10px 24px #ff003355;
}

.btn.danger:hover {
	filter: brightness(1.08);
	box-shadow: 0 16px 32px #ff003377;
	transform: translateY(-2px);
}

/* MAIN LAYOUT ---------------------------------------------- */

main.wrap {
	margin-top: 24px;
	margin-bottom: 40px;
}

/* FLASH MESSAGES ------------------------------------------- */

.flash {
	list-style: none;
	margin-bottom: 20px;
}

.flash li {
	background: rgba(30, 45, 100, 0.5);
	padding: 12px 16px;
	border-left: 4px solid var(--brand1);
	border-radius: 10px;
	backdrop-filter: blur(6px);
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 10px 28px #0008;
	animation: msgIn 0.3s ease;
}

.flash li.success {
	border-left-color: var(--ok);
}

.flash li.error {
	border-left-color: var(--err);
}

@keyframes msgIn {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* PAGE TITLES ---------------------------------------------- */

.page-title {
	font-size: 24px;
	font-weight: 600;
	letter-spacing: 0.4px;
	color: var(--brand1);
	text-shadow: 0 0 12px #6aa0ff50;
	margin-bottom: 20px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}

.page-sub {
	font-size: 14px;
	color: var(--muted);
	font-weight: 400;
}

/* CARD / FORMS --------------------------------------------- */

.card {
	background: var(--panel);
	border: 1px solid var(--panel-border);
	border-radius: 16px;
	box-shadow: 0 24px 48px #00000080;
	padding: 24px;
	margin: 0 0 28px 0;
	backdrop-filter: blur(12px);
	animation: cardIn .4s ease;
}

@keyframes cardIn {
	from { opacity: 0; transform: translateY(16px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card h3 {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 16px;
	font-weight: 500;
	color: var(--muted);
	text-shadow: 0 0 6px #6aa0ff25;
}

/* form fields */

label {
	display: flex;
	flex-direction: column;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 16px;
}

label > input {
	margin-top: 6px;
}

input {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid #27305b;
	background: #0c1430;
	color: var(--text);
	font-size: 15px;
	line-height: 1.4;
	transition: all 0.22s ease;
}

input:focus {
	outline: none;
	border-color: var(--brand2);
	box-shadow: 0 0 10px #00e0ff40;
	background: #0d1738;
}

/* GRID for "Add password" in vault */

.grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

@media (max-width: 820px) {
	.grid {
		grid-template-columns: 1fr;
	}
}

/* TABLE ---------------------------------------------------- */

.table-wrap {
	overflow-x: auto;
	border-radius: 16px;
	box-shadow: 0 24px 48px #00000080;
	border: 1px solid var(--panel-border);
	background: var(--panel);
	backdrop-filter: blur(12px);
}

.table {
	width: 100%;
	border-collapse: collapse;
	min-width: 600px;
	color: var(--text);
	font-size: 14px;
}

.table thead {
	background: rgba(22, 34, 74, 0.7);
	text-align: left;
}

.table th,
.table td {
	padding: 12px 16px;
	border-bottom: 1px solid #1b2550;
	vertical-align: top;
}

.table th {
	font-weight: 600;
	font-size: 13px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}

.table tbody tr:hover td {
	background: rgba(80, 120, 255, 0.06);
}

code {
	background: #0c1430;
	border: 1px solid #27305b;
	border-radius: 6px;
	padding: 3px 6px;
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 13px;
	color: var(--brand2);
	white-space: nowrap;
}

/* "no items" row */
.muted {
	color: var(--muted);
	text-align: center;
	font-size: 14px;
	padding: 24px 0;
}

/* FOOTER --------------------------------------------------- */

.footer {
	color: var(--muted);
	border-top: 1px solid #1e2750;
	margin-top: 40px;
	padding-top: 16px;
	font-size: 13px;
	text-align: center;
	line-height: 1.4;
	opacity: 0.7;
}

/* --- Vault action buttons (Copy / Delete) --- */

.actions-cell {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 120px;
}

.inline-form {
	display: inline;
	margin: 0;
	padding: 0;
}

.copy-btn {
	background: #1d2a4f;
	border-color: #3a4d8f;
	box-shadow: 0 10px 24px #0009;
	color: #dfe7ff;
	font-weight: 500;
	text-align: center;
}

.copy-btn:hover {
	background: #2a3a70;
	box-shadow: 0 16px 32px #000d;
}

.copy-btn.copied {
	background: linear-gradient(135deg, var(--ok), #1e8a4a);
	border-color: #1e8a4a;
	color: #fff;
	box-shadow: 0 16px 32px #00ff8a55;
	transform: translateY(-2px);
}

.copy-btn.copy-error {
	background: linear-gradient(135deg, var(--err), #a31227);
	border-color: #a31227;
	color: #fff;
	box-shadow: 0 16px 32px #ff003377;
}

/* make table action column not squash weirdly on mobile */
@media (max-width: 600px) {
	.actions-cell {
		min-width: 100px;
	}
}
