/* ============================================================
 * Authentication pages
 * ============================================================ */

.auth-page {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-right: 1rem;
	padding-left: 1rem;
}

.auth-page__container {
	width: 100%;
	max-width: 28rem;
}

.auth-card {
	padding: 2rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.75rem;
	background-color: var(--bg-white);
}

body.dark-mode .auth-card {
	background-color: #23262d;
	border-color: rgba(255, 255, 255, 0.08);
}

.auth-card__header {
	margin-bottom: 2rem;
	text-align: center;
}

.auth-card__brand {
	display: inline-block;
	margin-bottom: 1rem;
}

.auth-card__logo {
	width: auto;
	height: 1.25rem;
	margin-right: auto;
	margin-left: auto;
}

.auth-card__title {
	font-size: 1.25rem;
	font-weight: 700;
}

.auth-card__subtitle {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	opacity: 0.6;
}

.auth-message {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
}

.auth-message.hidden {
	display: none;
}

.auth-message.is-error {
	background-color: #fee2e2;
	color: #b91c1c;
}

.auth-message.is-success {
	background-color: #dcfce7;
	color: #15803d;
}

.auth-form__field {
	margin-bottom: 1.25rem;
}

.auth-form__field--large {
	margin-bottom: 1.5rem;
}

.auth-form__label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.auth-form__password {
	position: relative;
}

.auth-form__input {
	width: 100%;
	padding: 0.625rem 1rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	background: #fff;
	font-size: 0.875rem;
}

body.dark-mode .auth-card .auth-form__input,
body.dark-mode .auth-card input[type="text"],
body.dark-mode .auth-card input[type="password"],
body.dark-mode .auth-card input[type="email"],
body.dark-mode .auth-card input[type="tel"] {
	background-color: #23262d !important;
	color: #e5e7eb !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .auth-card input:-webkit-autofill,
body.dark-mode .auth-card input:-webkit-autofill:hover,
body.dark-mode .auth-card input:-webkit-autofill:focus,
body.dark-mode .auth-card input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #23262d inset !important;
	box-shadow: 0 0 0 1000px #23262d inset !important;
	-webkit-text-fill-color: #e5e7eb !important;
	caret-color: #e5e7eb !important;
}

.auth-form__input--with-toggle {
	padding-right: 2.75rem;
}

.auth-form__input:focus {
	border-color: var(--primary);
	outline: none;
	box-shadow: 0 0 0 4px rgba(18, 62, 138, 0.1);
}

body.dark-mode .auth-card .auth-form__input:focus,
body.dark-mode .auth-card input[type="text"]:focus,
body.dark-mode .auth-card input[type="password"]:focus,
body.dark-mode .auth-card input[type="email"]:focus {
	border-color: #60a5fa !important;
	box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15) !important;
}

.auth-form__password-toggle {
	position: absolute;
	top: 50%;
	right: 0.75rem;
	border: 0;
	background: transparent;
	opacity: 0.5;
	cursor: pointer;
	transform: translateY(-50%);
}

.auth-form__password-toggle:hover {
	opacity: 1;
}

body.dark-mode .auth-form__password-toggle {
	color: #9ca3af;
}

body.dark-mode .auth-form__password-toggle:hover {
	color: #f3f4f6;
}

.auth-form__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	font-size: 0.875rem;
}

.auth-form__checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	user-select: none;
}

.auth-form__checkbox {
	border-radius: 0.25rem;
}

.auth-link {
	color: #3b82f6;
	font-weight: 600;
	text-decoration: none;
	opacity: 1;
}

.auth-link:hover {
	text-decoration: underline;
}

.auth-form__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.75rem;
	border: 0;
	border-radius: 0.5rem;
	background-color: var(--primary);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity var(--transition-fast);
}

.auth-form__submit:hover {
	opacity: 0.8;
}

.auth-spinner {
	width: 1rem;
	height: 1rem;
	animation: auth-spin 1s linear infinite;
}

.auth-spinner.hidden {
	display: none;
}

@keyframes auth-spin {
	to {
		transform: rotate(360deg);
	}
}

.auth-divider {
	position: relative;
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.auth-divider__line {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
}

.auth-divider__rule {
	width: 100%;
	border-top: 1px solid #e5e7eb;
}

body.dark-mode .auth-divider__rule {
	border-color: #374151;
}

.auth-divider__label-wrap {
	position: relative;
	display: flex;
	justify-content: center;
	font-size: 0.875rem;
}

.auth-divider__label {
	padding-right: 0.75rem;
	padding-left: 0.75rem;
	background-color: var(--bg-white);
	color: #6b7280;
	user-select: none;
}

body.dark-mode .auth-divider__label {
	background-color: #23262d;
	color: #9ca3af;
}

body.dark-mode .auth-divider__rule {
	border-top-color: rgba(255, 255, 255, 0.1);
}

.auth-google-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	width: 100%;
	padding: 0.625rem 1rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	background: #fff;
	color: var(--text-body);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.auth-google-button:hover {
	background-color: #f9fafb;
}

body.dark-mode .auth-google-button {
	background-color: #23262d;
	border-color: rgba(255, 255, 255, 0.12);
	color: #e5e7eb;
}

body.dark-mode .auth-google-button:hover {
	background-color: rgba(255, 255, 255, 0.05);
}

.auth-google-button svg {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

.auth-google-button__label {
	color: var(--text-body);
}

body.dark-mode .auth-google-button__label {
	color: #e5e7eb;
}

.auth-card__footer {
	margin-top: 1.5rem;
	font-size: 0.875rem;
	text-align: center;
	opacity: 0.6;
}

.auth-strength {
	display: flex;
	gap: 0.25rem;
	margin-top: 0.5rem;
}

.auth-strength__bar {
	flex: 1 1 0%;
	height: 0.25rem;
	border-radius: 9999px;
	background-color: #e5e7eb;
	transition: background-color var(--transition-fast);
}

.auth-strength__bar.is-level-1 {
	background-color: #f87171;
}

.auth-strength__bar.is-level-2 {
	background-color: #fb923c;
}

.auth-strength__bar.is-level-3 {
	background-color: #facc15;
}

.auth-strength__bar.is-level-4 {
	background-color: #22c55e;
}

@media (min-width: 768px) {
	.auth-card {
		padding: 2.5rem;
	}
}
