/* Look carried over from the original pdf.js-based page: teal gradient, light box with a dashed inset outline. */
:root {
	--box: #c8dadf;
	--outline: #92b0b3;
	--text: #000;
	--accent: #14746f;
	--accent-hover: #0d4f4b;
	--error: #8a1c1c;
	--done: #1d7a3a;
}

html {
	min-height: 100%;
}

body {
	margin: 0;
	padding: 4em 0 2em;
	font-family: sans-serif;
	color: var(--text);
	background: #031203;
	background: linear-gradient(0deg, rgb(34, 193, 195) 0%, rgb(20, 116, 111) 20%, rgb(3, 18, 3) 100%) fixed;
}

#containerContainer {
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	text-align: center;
	font-size: 18px;
}

.container {
	outline: 2px dashed var(--outline);
	outline-offset: -10px;
	transition: outline-offset .15s ease-in-out, background-color .15s linear;
	background-color: var(--box);
	padding: 100px 20px;
	box-sizing: border-box;
	border: 0;
}

h1 {
	margin: 0 0 0.8em;
	font-size: 1.7em;
	line-height: 1.2;
}

.container > p {
	margin: 0;
	line-height: 1.3;
}

/* The file picker's label, styled as a big button. */
.choose {
	display: inline-block;
	min-height: 56px;
	box-sizing: border-box;
	padding: 14px 36px;
	border-radius: 6px;
	background: var(--accent);
	color: #fff;
	font-size: 1.3em;
	font-weight: bold;
	cursor: pointer;
}

.choose:hover {
	background: var(--accent-hover);
}

/* Dragging only makes sense with a mouse. */
.drag-hint {
	display: none;
	margin-top: 0.5em !important;
}

@media (hover: hover) and (pointer: fine) {
	.drag-hint {
		display: block;
	}
}

/* Keep the file input reachable by keyboard and show focus on its label. */
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

#fileElem:focus-visible + label {
	outline: 3px solid var(--accent-hover);
	outline-offset: 4px;
}

.animated {
	outline-offset: -20px;
	outline-color: var(--box);
	background-color: #fff;
}

.privacy {
	margin-top: 1em !important;
	font-weight: bold;
	color: var(--accent-hover);
}

a {
	color: var(--accent-hover);
}

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

/* File list */
.files {
	list-style: none;
	margin: 1.5em 0 0;
	padding: 0;
	text-align: left;
}

.file {
	position: relative;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	background: #fff;
	border: 1px solid var(--outline);
	border-radius: 4px;
	padding: 12px;
	margin-bottom: 10px;
}

.thumb {
	flex: none;
	width: 64px;
	min-height: 84px;
	background: #eef3f5;
	border: 1px solid #ccc;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
}

.thumb.has-image {
	min-height: 0;
	background: #fff;
}

.info {
	flex: 1;
	min-width: 0;
	padding-right: 36px; /* room for the remove button */
}

.remove {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: none;
	color: #75878c;
	line-height: 0;
}

.remove:hover {
	background: #f1f4f5;
	color: var(--error);
}

.info p {
	margin: 0 0 4px;
}

.name {
	font-weight: bold;
	overflow-wrap: anywhere;
}

.meta {
	color: #444;
	font-size: 0.9em;
}

/* Status line with an icon, so the state is clear without reading the words. */
.status {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.status-icon {
	flex: none;
	width: 1.2em;
	height: 1.2em;
	margin-top: 0.05em;
	background: center / contain no-repeat;
}

.status[data-kind=wait] .status-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-width='3'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23c8dadf'/%3E%3Cpath d='M12 3a9 9 0 0 1 9 9' stroke='%2314746f' stroke-linecap='round'/%3E%3C/svg%3E");
	animation: spin 1s linear infinite;
}

.status[data-kind=lock] .status-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}

.status[data-kind=done] .status-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%231d7a3a'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status[data-kind=info] .status-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%2314746f'/%3E%3Cpath d='M12 11v6M12 7.5v.01' stroke='white' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.status[data-kind=error] .status-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5L1.5 21h21z' fill='%238a1c1c' stroke='%238a1c1c' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M12 9.5v5.5M12 18v.01' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.status[data-kind=done] {
	color: var(--done);
	font-weight: bold;
}

.status[data-kind=error] {
	color: var(--error);
	font-weight: bold;
}

@keyframes spin {
	to {
		transform: rotate(1turn);
	}
}

/* Password: label on its own row, field and Show/Hide side by side, then the hint and Unlock. */
.password {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: end;
	margin-top: 10px;
}

.password-label {
	grid-column: 1 / -1;
	margin-bottom: -2px;
	font-weight: bold;
}

.password input {
	min-width: 0;
	min-height: 48px;
	box-sizing: border-box;
	font: inherit;
	font-weight: normal;
	font-size: 18px; /* at least 16px stops iOS zooming in on focus */
	padding: 8px 10px;
	border: 1px solid #666;
	border-radius: 3px;
}

.password input:focus-visible {
	outline-offset: 0;
}

.password input.masked {
	-webkit-text-security: disc;
}

.password .hint {
	grid-column: 1 / -1;
	margin: 0;
	color: #333;
	font-size: 0.9em;
}

.password button[type=submit] {
	grid-column: 1 / -1;
	justify-self: start;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

button,
.button {
	font: inherit;
	font-size: 18px;
	min-height: 48px;
	box-sizing: border-box;
	padding: 10px 18px;
	border: 1px solid var(--accent-hover);
	border-radius: 3px;
	background: #fff;
	color: var(--accent-hover);
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

button[type=submit],
.button {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

button[type=submit]:hover,
.button:hover {
	background: var(--accent-hover);
}

[hidden] {
	display: none !important;
}

/* More details */
.how {
	margin-top: 2em;
	text-align: left;
	line-height: 1.4;
}

.how summary {
	cursor: pointer;
	font-weight: bold;
	text-align: center;
}

.how p,
.how li {
	margin: 0.5em 0;
}

@media (max-width: 600px) {
	body {
		padding-top: 1em;
	}

	.container {
		padding: 40px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.container {
		transition: none;
	}

	.status[data-kind=wait] .status-icon {
		animation: none;
	}
}
