/* ============================================================
   The login popup — Oxedyne
   ============================================================
   Covers the page rather than sitting in it, because a passphrase is
   the one thing here worth a reader's whole attention. Themed to the
   site's own tokens (see css/variables.css); Oxedyne is dark only.
   ============================================================ */

.login-popup {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(0, 0, 0, 0.62);
	/* Centred, and pushed off the top edge on a short screen so the card
	   never sits under a browser's own furniture. */
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
}
.login-popup.open { display: flex; }

.login-card {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 32px;
}
.login-card .close-btn {
	position: absolute;
	top: 18px;
	right: 18px;
	cursor: pointer;
	width: 16px;
	height: 16px;
	opacity: 0.7;
}
.login-card .close-btn:hover { opacity: 1; }

.login-card h2 {
	font-family: var(--font);
	font-size: 24px;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 8px;
}
.login-lede {
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.5;
	color: var(--text-secondary);
	margin-bottom: 16px;
}
.login-note {
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text-muted);
	margin-bottom: 16px;
}

/* --- The field --- */
.login-field {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-2);
	border-radius: var(--radius);
	padding: 10px 14px;
}
.login-field input {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	outline: none;
	font-family: var(--font);
	font-size: 17px;
	color: var(--text-primary);
}
.login-field input::placeholder { color: var(--text-muted); }
/* Monospace once revealed, so a word can be checked letter by letter against
   whatever it was written on. */
.login-field input.login-revealed {
	font-family: var(--font-mono);
	letter-spacing: 0.02em;
}
.login-eye {
	flex-shrink: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	font-family: var(--font);
	font-size: 12px;
	color: var(--accent-text);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0;
}
.login-eye:hover { text-decoration: underline; }

/* --- The word count --- */
.login-count {
	min-height: 1.2em;
	margin: 4px 0 0;
	font-family: var(--font);
	font-size: 13px;
	color: var(--text-muted);
}
.login-count-ok { color: var(--ok); }

/* --- What went wrong --- */
.login-msg {
	min-height: 1.2em;
	margin: 4px 0 8px;
	font-family: var(--font);
	font-size: 13px;
	color: var(--text-secondary);
}
.login-msg-bad { color: var(--danger); }

/* --- The buttons --- */
.login-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.login-btn {
	background: var(--accent);
	color: #fff;
	font-family: var(--font);
	font-size: 16px;
	border: none;
	border-radius: var(--radius);
	padding: 10px 28px;
	cursor: pointer;
	transition: opacity 120ms ease, background 120ms ease;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.5; cursor: default; }
/* The second way out of the card, which is not the main one. */
.login-btn-quiet {
	background: transparent;
	color: var(--text-secondary);
	padding-left: 0;
	padding-right: 0;
	text-decoration: underline;
}
.login-btn-quiet:hover { background: transparent; color: var(--text-primary); }

/* --- The passphrase just made ---
   Big, monospaced and selectable: it is going to be copied onto paper, and
   every word has to be legible without doubt about which letter is which. */
.login-made-pp {
	font-family: var(--font-mono);
	font-size: 19px;
	line-height: 1.8;
	color: var(--text-primary);
	background: var(--bg-tertiary);
	border: 1px solid var(--border-2);
	border-radius: var(--radius);
	padding: 12px;
	margin-bottom: 12px;
	word-spacing: 0.4em;
	user-select: all;
}

@media (max-width: 767px) {
	.login-card { padding: 20px; }
}

/* The account's public id, shown after Join so a new admin can copy it straight
   to the operator without hunting for it. Monospaced and freely selectable; it
   wraps because a 64-hex string is wider than the card. */
.login-id-lbl {
	margin-top: 0.9em;
}
.login-made-id {
	font-family: var(--font-mono);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--text-primary);
	background: var(--bg-tertiary);
	border: 1px solid var(--border-2);
	border-radius: var(--radius-sm);
	padding: 0.6em 0.7em;
	margin-top: 0.4em;
	word-break: break-all;
	user-select: all;
	-webkit-user-select: all;
}
