* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Helvetica Neue", Arial, sans-serif;
	background: linear-gradient(135deg, #0f172a, #1e293b);
	color: #e2e8f0;
	min-height: 100vh;
}

.page {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	min-height: 100vh;
}

.card {
	width: 100%;
	max-width: 420px;
	background: #0b1224;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 28px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.card__header h1 {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 700;
}

.card__header .muted {
	margin: 0;
	color: #94a3b8;
	font-size: 14px;
}

.form {
	margin-top: 20px;
	display: grid;
	gap: 14px;
}

.field {
	display: grid;
	gap: 6px;
}

.field__label {
	color: #cbd5e1;
	font-size: 13px;
	letter-spacing: 0.2px;
}

input[type="text"],
input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid #1f2a44;
	background: #11192e;
	color: #e2e8f0;
	font-size: 15px;
}

input:focus {
	outline: 2px solid #22d3ee;
	outline-offset: 1px;
}

.button {
	margin-top: 4px;
	width: 100%;
	padding: 12px 14px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #22d3ee, #0ea5e9);
	color: #0b1224;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	transition: transform 120ms ease, box-shadow 120ms ease;
	display: inline-block;
	text-align: center;
	text-decoration: none;
}

.button--sm {
	width: auto;
	padding: 8px 12px;
	font-size: 13px;
	margin-top: 0;
}

.button:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 22px rgba(14, 165, 233, 0.35);
}

.button:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.message {
	min-height: 18px;
	font-size: 14px;
	color: #cbd5e1;
}

.message[data-tone="success"] {
	color: #4ade80;
}

.message[data-tone="error"] {
	color: #fb7185;
}

@media (max-width: 520px) {
	.card {
		padding: 22px;
		border-radius: 12px;
	}
}

.page--menu {
	flex-direction: column;
}

.page--gallery {
	flex-direction: column;
	align-items: center;
}

.gallery-actions {
	width: min(1100px, 100%);
	display: flex;
	justify-content: flex-start;
	gap: 10px;
	align-items: center;
	padding: 0 12px;
	margin: 12px auto 0;
	flex-wrap: wrap;
}

.upload-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

.upload-form input[type="file"] {
	font-size: 13px;
	color: #e2e8f0;
}

.capture {
	width: min(720px, 100%);
	margin: 12px auto 0;
	padding: 12px;
	background: #0b1224;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	display: none;
	gap: 10px;
}

.capture--open {
	display: grid;
}

.capture__video {
	width: 100%;
	max-height: 420px;
	background: #11192e;
	border-radius: 10px;
	object-fit: cover;
}

.capture__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
	align-items: center;
}

.capture__select {
	flex: 1 1 200px;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #1f2a44;
	background: #11192e;
	color: #e2e8f0;
}

@media (max-width: 640px) {
	body {
		background: #0f172a;
	}

	.page {
		padding: 18px 14px;
	}

	.button--sm {
		width: 100%;
		text-align: center;
	}

	.upload-form {
		flex-wrap: wrap;
		width: 100%;
	}

	.upload-form input[type="file"] {
		flex: 1 1 100%;
		width: 100%;
	}

	.gallery {
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 12px;
		margin: 16px auto;
	}

	.photo-card {
		min-height: 180px;
	}

	.capture {
		padding: 10px;
		gap: 8px;
	}

	.capture__video {
		max-height: 280px;
		border-radius: 8px;
	}

	.capture__controls {
		flex-direction: column;
		align-items: stretch;
	}

	.capture__select {
		width: 100%;
	}
}

.menu {
	display: grid;
	gap: 16px;
	width: 100%;
	max-width: 360px;
}

.menu__button {
	font-size: 17px;
	padding: 14px 16px;
}

.gallery {
	width: min(1100px, 100%);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin: 24px auto;
	padding: 0 12px;
}

.photo-card {
	background: #0b1224;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 220px;
}

.photo-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #11192e;
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	text-align: center;
	padding: 12px;
	cursor: pointer;
}

.photo-frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.photo-frame--loaded {
	color: transparent;
}

.photo-meta {
	padding: 12px;
	display: grid;
	gap: 10px;
}

.photo-name {
	margin: 0;
	color: #cbd5e1;
	font-size: 14px;
	word-break: break-all;
}

.photo-actions {
	display: grid;
	gap: 8px;
}

.button--ghost {
	background: transparent;
	border: 1px solid #1f2a44;
	color: #e2e8f0;
}

.button--ghost:hover {
	box-shadow: 0 8px 16px rgba(14, 165, 233, 0.25);
}

.viewer {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(8, 12, 24, 0.8);
	z-index: 999;
	padding: 12px;
}

.viewer--open {
	display: flex;
}

.viewer__panel {
	max-width: 100%;
	max-height: 100%;
	background: #0b1224;
	border-radius: 12px;
	padding: 10px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
	display: grid;
	gap: 8px;
	width: min(1080px, 100%);
}

.viewer__img {
	max-width: 100%;
	max-height: 70vh;
	border-radius: 10px;
	object-fit: contain;
	background: #11192e;
}

.viewer__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.viewer__name {
	margin: 0;
	color: #e2e8f0;
	font-size: 14px;
	word-break: break-all;
}
