/* Live validation messages for the login and registration forms. */

.field-msg {
	min-height: 18px;
	margin-top: 8px;
	font-size: 12px;
	line-height: 1.35;
	text-align: center;
	color: var(--text-muted);
	transition: color 0.15s ease;
}

.field-msg.is-error { color: #ff6b6b; }
.field-msg.is-ok { color: #4cd08a; }
.field-msg.is-busy { color: var(--text-soft); }

.field-msg.is-error::before { content: '\26A0\00a0'; }
.field-msg.is-ok::before { content: '\2713\00a0'; }

/* Underline the input in the state colour (replaces the border the theme removes). */
.form-control.field-invalid,
.form-control.field-invalid:focus {
	box-shadow: inset 0 -2px 0 #ff6b6b;
}
.form-control.field-valid,
.form-control.field-valid:focus {
	box-shadow: inset 0 -2px 0 #4cd08a;
}

/* show/hide password button, injected by auth-validate.js */
.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 48px; padding-left: 48px; }
.pw-toggle {
	position: absolute;
	top: 0;
	right: 0;
	height: 60px;
	width: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--c-accent); outline: none; }
.pw-toggle svg { width: 20px; height: 20px; }

.auth-links {
	margin-top: 22px;
	text-align: center;
	font-size: 14px;
	color: var(--text-soft);
}
.auth-links .rules-link { margin-left: 4px; }

.accept-rules + .field-msg { text-align: left; margin-top: 10px; }

.submit-btn[disabled] { opacity: 0.6; cursor: wait; }

/* Show username and email exactly as typed (the theme upper-cases all inputs). Placeholders stay upper-case. */
.form-control[name="username"],
.form-control[name="email"] {
	text-transform: none;
}
.form-control[name="username"]::placeholder,
.form-control[name="email"]::placeholder {
	text-transform: uppercase;
}

/* "Where you're logged in" page */
.sessions-wrap { max-width: 760px; margin: 30px auto 0; padding: 0 16px; }
.sessions-note { text-align: center; color: var(--text-soft); line-height: 1.6; margin-bottom: 24px; }
.session-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.session-card {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 16px 20px; background: var(--bg-panel); border-left: 3px solid var(--line);
}
.session-card.is-current { border-left-color: var(--c-accent); }
.session-device { font-weight: 700; color: #fff; font-size: 16px; }
.session-badge {
	margin-left: 10px; padding: 2px 8px; font-size: 11px; text-transform: uppercase;
	letter-spacing: 0.05em; color: var(--bg-panel); background: var(--c-accent); border-radius: 3px; vertical-align: middle;
}
.session-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
/* One width for every action button on these pages (Link, Manage, View, Turn on, Remove, Sign out, ...).
   Both a link and a form-wrapped button get exactly the same box. */
:root { --session-btn-w: 170px; }
.session-action { margin: 0; flex: 0 0 var(--session-btn-w); width: var(--session-btn-w); }
.session-btn {
	width: var(--session-btn-w);
	min-width: var(--session-btn-w);
	flex: 0 0 var(--session-btn-w);
	height: 40px;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	text-decoration: none;
}
.session-action .session-btn { width: 100%; min-width: 0; flex: none; }
@media (max-width: 600px) {
	.session-card { flex-direction: column; align-items: stretch; }
	.session-btn, .session-action, .session-action .session-btn { width: 100%; min-width: 0; flex: none; }
	/* standalone buttons line up with the buttons inside the cards (card padding 20px + 3px border) */
	.passkey-add .session-btn, .sessions-all .session-btn { width: calc(100% - 43px); min-width: 0; margin: 0 auto; }
}

/* passkeys */
.passkey-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; height: 44px; margin-top: 14px;
	background: transparent; color: var(--c-accent); border: 1px solid var(--line-steel);
	font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 13px; cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.passkey-btn[hidden] { display: none; }
.passkey-btn:hover, .passkey-btn:focus-visible { background: rgba(var(--c-accent-rgb), 0.08); border-color: var(--c-accent); outline: none; }
.passkey-btn[disabled] { opacity: 0.6; cursor: wait; }
.passkey-btn svg { width: 18px; height: 18px; }
/* Google / Microsoft buttons */
.social-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
.social-sep::before, .social-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.social-btn {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; height: 44px; margin-top: 10px;
	background: #fff; color: #1f1f1f; text-decoration: none; border-radius: 2px;
	font-weight: 700; font-size: 14px; transition: background 0.15s ease;
}
.social-btn:hover, .social-btn:focus-visible { background: #e9edf0; color: #1f1f1f; outline: none; }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.passkey-rename { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.passkey-rename input, .passkey-add input {
	background: var(--bg-panel-2); border: none; color: #fff; padding: 8px 12px; min-width: 200px; font-size: 14px;
}
.passkey-add { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }

/* small cancel button under the submit button */
.cancel-btn {
	display: block;
	margin: 14px auto 0;
	padding: 6px 18px;
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: color 0.15s ease;
}
.cancel-btn:hover,
.cancel-btn:focus-visible { color: var(--c-accent); outline: none; }
