@import url('theme.css');

/* Poppins */
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('fonts/poppins/pxiEyp8kv8JHgFVrJJfecg.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('fonts/poppins/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('fonts/poppins/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('fonts/poppins/pxiByp8kv8JHgFVrLCz7Z1xlFQ.woff2') format('woff2');
}

/* Material Symbols */
@font-face {
	font-family: 'Material Symbols Outlined';
	font-style: normal;
	font-weight: 100 700;
	font-display: block;
	src: url('fonts/material-symbols-outlined/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVY.woff2')
		format('woff2');
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

body {
	font-family: 'Poppins', sans-serif;
	font-weight: 400;
	background-color: var(--color-background);
	color: var(--color-text);
}

.material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-weight: normal;
	font-style: normal;
	font-size: 24px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
	font-variation-settings:
		'FILL' 0,
		'wght' 200,
		'GRAD' 0,
		'opsz' 24;
}

.light .material-symbols-outlined {
	font-variation-settings:
		'FILL' 0,
		'wght' 300,
		'GRAD' 0,
		'opsz' 24;
}

/* Layout */
.auth-page {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	padding: 2.5rem 1rem 2rem;
	background-color: var(--color-ui-main);
}

.auth-lang {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: flex;
	gap: 0.25rem;
}

.auth-lang-btn {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border-radius: var(--radius-xs);
	border: 1px solid var(--color-ui-element);
	background-color: var(--color-ui-element);
	color: var(--color-text);
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.15s;
}

.auth-lang-btn:hover {
	background-color: var(--color-ui-element-hover);
	border-color: var(--color-ui-element-hover);
}

.auth-lang-btn .material-symbols-outlined {
	font-size: 20px;
	opacity: 1;
}

.auth-lang-menu {
	position: absolute;
	top: calc(100% + 0.25rem);
	right: 0;
	min-width: 8rem;
	background-color: var(--color-ui-secondary);
	border: 1px solid var(--color-ui-element);
	border-radius: var(--radius-xs);
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	overflow: hidden;
	z-index: 100;
}

.auth-lang-menu[hidden] {
	display: none;
}

.auth-lang-option {
	display: block;
	width: 100%;
	padding: 0.375rem 0.5rem;
	font-family: inherit;
	font-size: 0.875rem;
	text-align: left;
	background: none;
	border: none;
	color: var(--color-text);
	cursor: pointer;
	transition: background-color 0.15s;
}

.auth-lang-option:hover {
	background-color: var(--color-ui-element);
}

.auth-logo {
	margin-bottom: 5rem;
}

.auth-logo img {
	height: 3.5rem;
	width: auto;
}

.auth-card {
	width: 100%;
	max-width: 32rem;
	background-color: var(--color-ui-secondary);
	border-radius: var(--radius-xs);
	box-shadow:
		0 4px 6px -1px rgb(0 0 0 / 0.1),
		0 2px 4px -2px rgb(0 0 0 / 0.1);
	padding: 1.5rem;
}

.auth-card-with-back {
	position: relative;
}

.auth-back {
	position: absolute;
	top: 0.625rem;
	left: 0.625rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius-xs);
	color: var(--color-text-muted);
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

.auth-back:hover {
	background-color: var(--color-ui-element);
	color: var(--color-text);
}

.auth-back .material-symbols-outlined {
	font-size: 20px;
	opacity: 1;
}

.auth-title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 300;
	text-align: center;
	color: var(--color-text);
}

.auth-info {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	text-align: left;
	color: var(--color-text-muted);
}

.auth-info-center {
	text-align: center;
}

.auth-success-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 0.75rem;
}

.auth-success-icon .material-symbols-outlined {
	font-size: 3rem;
	color: var(--color-secondary);
}

.auth-success-icon .auth-error-icon {
	color: var(--color-error);
}

/* Render anchors styled as buttons (e.g. the post-change "Back to app" action) like real buttons. */
a.auth-btn {
	display: inline-block;
	text-align: center;
	text-decoration: none;
}

.auth-error {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--radius-xs);
	background-color: rgba(248, 113, 113, 0.15);
	color: var(--color-error);
	font-size: 0.875rem;
	text-align: center;
}

/* Informational notice (e.g. the auth-migration password-reset prompt). Boxed like
   .auth-error but tinted with the primary colour so it reads as a notice, not an error. */
.auth-notice {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--radius-xs);
	background-color: rgba(0, 157, 204, 0.12);
	color: var(--color-text);
	font-size: 0.875rem;
	line-height: 1.4;
	text-align: left;
}

.auth-notice[hidden] {
	display: none;
}

.auth-error[hidden] {
	display: none;
}

/* Form */
.auth-form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
}

.auth-form-row {
	display: flex;
	gap: 0.25rem;
	align-items: stretch;
}

.auth-fields {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.auth-field {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	font-size: 0.875rem;
	background-color: var(--color-input-bg);
	border: 1px solid var(--color-input-border);
	border-radius: var(--radius-xs);
	color: var(--color-text);
}

.auth-field .material-symbols-outlined {
	opacity: 0.2;
	font-size: 20px;
	flex-shrink: 0;
}

.auth-field input {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}

.auth-field input::placeholder {
	color: var(--color-text-muted);
}

.auth-field-label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	color: var(--color-text-muted);
}

.auth-field-group {
	margin-bottom: 0.75rem;
}

.auth-submit-side {
	flex: 0 0 auto;
	display: flex;
}

.auth-btn {
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	font-size: 0.875rem;
	border-radius: var(--radius-xs);
	border: 1px solid var(--color-ui-element);
	background-color: var(--color-ui-element);
	color: var(--color-text);
	cursor: pointer;
	padding: 0.5rem 1rem;
	transition: background-color 0.15s;
}

.auth-btn:hover {
	background-color: var(--color-ui-element-hover);
}

.auth-btn-primary {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: #ffffff;
}

.auth-btn.auth-btn-primary:hover {
	background-color: var(--color-primary-high);
	border-color: var(--color-primary-high);
}

.auth-btn-secondary {
	background-color: var(--color-secondary);
	border-color: var(--color-secondary);
	color: #ffffff;
}

.auth-btn.auth-btn-secondary:hover {
	background-color: var(--color-secondary);
	border-color: var(--color-secondary);
	filter: brightness(0.85);
}

.auth-btn-success {
	background-color: #80bc52;
	border-color: #80bc52;
	color: #ffffff;
}

.auth-btn.auth-btn-success:hover {
	background-color: #72a849;
	border-color: #72a849;
}

.auth-btn-ghost {
	background-color: transparent;
	border-color: var(--color-ui-element);
	color: var(--color-text-muted);
}

.auth-btn.auth-btn-ghost:hover {
	background-color: var(--color-ui-element);
	color: var(--color-text);
}

.auth-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.auth-btn-icon .material-symbols-outlined {
	font-size: 1.25rem;
}

.auth-btn-full {
	width: 100%;
	padding: 0.625rem 1rem;
}

.auth-btn-tall {
	flex: 1;
	min-height: 4.75rem;
	min-width: 7rem;
	padding: 0 1rem;
}

.auth-options {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.25rem;
}

.auth-checkbox {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.auth-checkbox input {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	border: 1px solid var(--color-input-border);
	background-color: var(--color-input-bg);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

.auth-checkbox input:hover {
	border-color: var(--color-secondary);
}

.auth-checkbox input:checked {
	background-color: var(--color-secondary);
	border-color: var(--color-secondary);
}

.auth-checkbox input:checked::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 6px;
	width: 5px;
	height: 9px;
	border: 2px solid #ffffff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}

.auth-checkbox input:focus-visible {
	outline: 2px solid var(--color-secondary);
	outline-offset: 1px;
}

.auth-checkbox label {
	font-size: 0.875rem;
	color: var(--color-text-muted);
	cursor: pointer;
}

.auth-link {
	font-size: 0.875rem;
	color: var(--color-text-muted);
	text-decoration: none;
}

.auth-link:hover {
	color: var(--color-secondary);
	text-decoration: underline;
}

.auth-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 0.5rem;
}

.auth-actions {
	margin-top: 1.25rem;
}

/* Passkeys */
.auth-help {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	text-align: left;
	color: var(--color-text-muted);
}

.auth-passkey-list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.auth-passkey-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--color-ui-element);
	border-radius: var(--radius-xs);
	background-color: var(--color-ui-secondary);
}

.auth-passkey-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.auth-passkey-name {
	font-size: 0.875rem;
	color: var(--color-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.auth-passkey-meta {
	font-size: 0.75rem;
	color: var(--color-text-muted);
}

.auth-passkey-remove {
	flex-shrink: 0;
	padding: 0.375rem 0.625rem;
	border: 1px solid var(--color-ui-element);
	border-radius: var(--radius-xs);
	background-color: transparent;
	color: var(--color-error);
	font-size: 0.8125rem;
	cursor: pointer;
}

.auth-passkey-remove:hover {
	background-color: rgba(248, 113, 113, 0.15);
}

@media (max-width: 480px) {
	.auth-form-row {
		flex-direction: column;
	}

	.auth-btn-tall {
		min-height: 2.25rem;
		width: 100%;
	}

	.auth-logo {
		margin-bottom: 3rem;
	}
}
