/* © 2025 Mark Kats. Все права защищены. Копирование и переработка запрещены. */

.auth-page-wrap a:not(.btn) {
	color: var(--ui-accent, var(--ui-text));
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.page-center {
	min-height: 100svh;
	display: grid;
	place-items: center;
}

.auth-page-wrap {
	box-sizing: border-box;
	width: min(100%, 480px);
	max-width: 480px;
	margin: 0;
	padding: max(18px, env(safe-area-inset-top, 0px)) 14px max(18px, env(safe-area-inset-bottom, 0px));
}

.auth-page-wrap .auth-card {
	position: relative;
	display: block;
	box-sizing: border-box;
	width: 100%;
	padding: 0;
	border: 1px solid var(--profile-card-border, var(--ui-border));
	border-top: 2px solid rgba(148, 163, 184, 0.5);
	border-radius: var(--profile-card-radius, var(--ui-radius-lg));
	background: var(--profile-card-bg, var(--ui-surface));
	box-shadow: var(--profile-project-card-shadow, var(--ui-shadow));
	backdrop-filter: blur(8px);
}

.auth-card__head {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 26px minmax(0, 1fr);
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 7px 12px;
	border-bottom: 1px solid var(--profile-card-head-border, var(--ui-border));
	background: var(--profile-card-head-bg, var(--ui-surface-soft));
}

.auth-card__icon {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: 1px solid var(--profile-item-icon-border, var(--ui-border));
	border-radius: var(--profile-card-radius-sm, 7px);
	background: var(--profile-item-icon-bg, var(--ui-surface-soft));
	color: var(--ui-accent-strong, var(--ui-text));
}

.auth-card__title-wrap {
	min-width: 0;
}

.auth-title {
	margin: 0;
	color: var(--profile-title, var(--ui-text));
	font: 600 1.02rem/1.2 var(--profile-card-title-font, 'IBM Plex Sans Condensed', system-ui, sans-serif);
	letter-spacing: 0;
}

.auth-card__subtitle,
.subheading {
	display: block;
	margin: 4px 0 0;
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font: 400 0.78rem/1.4 var(--font-ui, 'Artifakt Element', monospace);
}

.auth-card__body {
	box-sizing: border-box;
	min-width: 0;
	padding: 14px;
}

.auth-form label {
	display: grid;
	gap: 6px;
	margin-top: 12px;
}

.auth-form .auth-card__body > label:first-child {
	margin-top: 0;
}

.auth-form .field-label,
.auth-form .auth-label {
	display: block;
	margin: 0;
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font: 600 0.64rem/1.2 var(--font-ui, 'Artifakt Element', monospace);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.auth-form .ui-input,
.auth-form .ui-select {
	width: 100%;
	height: 38px;
	min-width: 0;
	margin: 0;
	border-radius: var(--profile-card-radius-sm, 7px);
	border-color: var(--profile-item-border, var(--ui-field-border, var(--ui-border)));
	background: var(--profile-item-bg, var(--ui-surface-soft));
	color: var(--profile-title, var(--ui-text));
	font-size: 0.84rem;
}

.auth-form .ui-input:hover,
.auth-form .ui-select:hover {
	border-color: var(--profile-item-border-hover, var(--ui-border-strong));
}

.auth-form .ui-input:read-only {
	opacity: 0.78;
}

.auth-page-wrap .actions,
.auth-actions-main,
.auth-actions-sso {
	display: grid;
	gap: 8px;
	margin-top: 16px;
}

.auth-page-wrap .actions {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-actions-main {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-action,
.auth-page-wrap .actions .btn {
	box-sizing: border-box;
	min-width: 0;
	height: 34px;
	justify-content: center;
	gap: 7px;
	font-size: 0.76rem;
}

.auth-code-action-primary {
	border-color: var(--app-focus-border, var(--ui-border-strong));
	background: var(--ui-accent-soft, var(--ui-surface-raised));
	color: var(--ui-accent-strong, var(--ui-text));
	font-weight: 600;
}

.auth-code-action-primary:hover {
	border-color: var(--app-focus-border, var(--ui-border-strong));
	background: var(--ui-surface-hover);
}

.auth-actions-sso {
	margin-top: 12px;
}

.auth-sso-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.auth-actions-sso .btn.sso {
	min-width: 0;
	height: 34px;
	justify-content: center;
	border-color: var(--profile-item-border, var(--ui-border));
	background: var(--profile-item-bg, var(--ui-surface-soft));
	color: var(--profile-title, var(--ui-text));
	text-decoration: none;
}

.auth-actions-sso .btn.sso:hover {
	border-color: var(--profile-item-border-hover, var(--ui-border-strong));
	background: var(--profile-card-hover-bg, var(--ui-surface-hover));
}

.auth-sso-muted {
	padding: 8px 10px;
	border: 1px dashed var(--profile-empty-border, var(--ui-border));
	border-radius: var(--profile-card-radius-sm, 7px);
	background: var(--profile-empty-bg, var(--ui-surface-soft));
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font-size: 0.76rem;
	line-height: 1.4;
	text-align: center;
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font: 600 0.62rem/1.2 var(--font-ui, 'Artifakt Element', monospace);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	height: 1px;
	flex: 1;
	background: var(--profile-muted-border, var(--ui-border));
}

.auth-context {
	display: grid;
	gap: 5px;
	margin-bottom: 14px;
}

.auth-context > div {
	min-width: 0;
	padding: 7px 9px;
	border: 1px solid var(--profile-item-border, var(--ui-border));
	border-left: 2px solid rgba(148, 163, 184, 0.42);
	border-radius: var(--profile-card-radius-sm, 7px);
	background: var(--profile-item-bg, var(--ui-surface-soft));
	color: var(--profile-title, var(--ui-text));
	font-size: 0.76rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.auth-context span {
	margin-right: 7px;
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.password-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 36px;
	align-items: center;
	gap: 7px;
	width: 100%;
}

.toggle-password {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--profile-item-border, var(--ui-border));
	border-radius: var(--profile-card-radius-sm, 7px);
	background: var(--profile-item-bg, var(--ui-surface-soft));
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	cursor: pointer;
	font-size: 0.92rem;
	line-height: 1;
	transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
}

.toggle-password:hover {
	border-color: var(--profile-item-border-hover, var(--ui-border-strong));
	background: var(--profile-card-hover-bg, var(--ui-surface-hover));
}

.toggle-password:active {
	transform: translateY(1px);
}

.auth-page-wrap .btn--full,
.auth-page-wrap .btn.block {
	width: 100%;
	justify-content: center;
}

.auth-page-wrap .actions--stack {
	grid-template-columns: 1fr;
	margin-top: 10px;
}

.auth-page-wrap .error:not(:empty),
.auth-page-wrap .response-message:not(:empty) {
	display: block;
	margin-top: 12px;
	padding: 8px 10px;
	border: 1px solid var(--profile-item-border, var(--ui-border));
	border-radius: var(--profile-card-radius-sm, 7px);
	background: var(--profile-item-bg, var(--ui-surface-soft));
	color: var(--profile-title, var(--ui-text));
	font-size: 0.76rem;
	line-height: 1.4;
	text-align: left;
}

.auth-page-wrap .response-message {
	display: none;
}

.auth-page-wrap .response-message.error,
.auth-page-wrap .error:not(:empty) {
	border-color: var(--status-offtrack-border, rgba(220, 72, 72, 0.5));
	background: var(--status-danger-soft, rgba(220, 72, 72, 0.16));
	color: var(--status-danger-text, var(--ui-text));
}

.auth-page-wrap .response-message.success {
	border-color: var(--ui-success-border);
	background: var(--ui-success-bg);
	color: var(--ui-success-text);
}

.policy-note,
.info-text {
	margin: 12px 0 0;
	color: var(--profile-card-text-secondary, var(--ui-text-muted));
	font-size: 0.68rem;
	line-height: 1.55;
	text-align: center;
}

.policy-note a,
.info-text a {
	color: var(--ui-accent, var(--ui-text));
}

.auth-page-wrap .info-text--spaced {
	margin-top: 14px;
}

@media (max-width: 560px) {
	.auth-page-wrap {
		padding-inline: 10px;
	}

	.auth-card__head,
	.auth-card__body {
		padding-inline: 12px;
	}

	.auth-actions-main,
	.auth-page-wrap .actions,
	.auth-sso-options {
		grid-template-columns: 1fr;
	}
}
