
:root {
	color-scheme: light;
	font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-synthesis: none;
	--background: #ffffff;
	--border: #dedede;
	--danger: #a52a22;
	--ink: #111111;
	--muted: #5f6360;
	--soft: #eeeeee;
}

* {
	box-sizing: border-box;
}

html,
body {
	min-width: 320px;
	min-height: 100%;
	background: var(--background);
}

body {
	margin: 0;
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
}

button,
input {
	font: inherit;
}

button {
	-webkit-tap-highlight-color: transparent;
}

[hidden] {
	display: none !important;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.page-shell {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 40px 20px;
}

.auth-card {
	width: min(100%, 420px);
	padding: 40px 38px 34px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--background);
	box-shadow: 0 14px 42px rgba(17, 17, 17, 0.08);
}

.brand-header {
	text-align: center;
}

.brand-logo {
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto 24px;
	object-fit: contain;
}

.brand-header h1 {
	margin: 0;
	font-size: 25px;
	font-weight: 650;
	letter-spacing: -0.035em;
	line-height: 1.2;
	text-wrap: balance;
}

.destination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 24px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f5f5f5;
	font-size: 12px;
}

.destination span {
	color: var(--muted);
}

.destination strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 650;
	text-align: right;
}

.state-region {
	min-height: 190px;
	margin-top: 30px;
}

.auth-form,
.success-state {
	animation: state-in 240ms ease-out both;
}

.form-heading {
	margin-bottom: 24px;
	text-align: center;
}

.form-heading h2,
.success-state h2 {
	margin: 0;
	font-size: 22px;
	font-weight: 650;
	letter-spacing: -0.025em;
	line-height: 1.25;
}

.form-heading p,
.success-state > p {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.55;
	text-wrap: pretty;
}

.form-heading strong {
	color: var(--ink);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.field-group {
	display: grid;
	gap: 8px;
}

.field-group label {
	font-size: 13px;
	font-weight: 600;
}

.field-group input {
	width: 100%;
	height: 52px;
	border: 1px solid #9e9e9e;
	border-radius: 10px;
	background: var(--background);
	color: var(--ink);
	padding: 0 15px;
	outline: none;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-group input::placeholder {
	color: var(--muted);
	opacity: 1;
}

.field-group input:hover {
	border-color: #686868;
}

.field-group input:focus-visible {
	border-color: var(--ink);
	box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.13);
}

.field-group input[aria-invalid="true"] {
	border-color: var(--danger);
	box-shadow: 0 0 0 3px rgba(165, 42, 34, 0.11);
}

.code-input {
	font-variant-numeric: tabular-nums;
	font-size: 22px !important;
	font-weight: 650;
	letter-spacing: 0.3em;
	text-align: center;
}

.field-help,
.field-error {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
}

.field-help {
	color: var(--muted);
}

.field-error {
	color: var(--danger);
	font-weight: 600;
}

.primary-button {
	position: relative;
	width: 100%;
	height: 52px;
	margin-top: 18px;
	border: 1px solid var(--ink);
	border-radius: 10px;
	background: var(--ink);
	color: #ffffff;
	font-size: 14px;
	font-weight: 650;
	cursor: pointer;
	overflow: hidden;
	transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.primary-button:hover:not(:disabled) {
	background: #2b2b2b;
	border-color: #2b2b2b;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.provider-connect-button:focus-visible,
.text-button:focus-visible,
.legal-copy a:focus-visible {
	outline: 3px solid rgba(17, 17, 17, 0.22);
	outline-offset: 3px;
}

.primary-button:active:not(:disabled) {
	transform: translateY(1px);
}

.primary-button:disabled {
	cursor: wait;
	opacity: 0.7;
}

.secondary-button {
	position: relative;
	min-height: 46px;
	border: 1px solid var(--ink);
	border-radius: 10px;
	background: var(--background);
	color: var(--ink);
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	transition: background 160ms ease, transform 120ms ease;
}

.secondary-button:hover:not(:disabled) {
	background: #f3f3f3;
}

.secondary-button:active:not(:disabled) {
	transform: translateY(1px);
}

.secondary-button:disabled {
	cursor: wait;
	opacity: 0.62;
}

.button-progress {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 38%;
	height: 2px;
	background: rgba(255, 255, 255, 0.72);
	opacity: 0;
	transform: translateX(-120%);
}

.primary-button.is-loading .button-progress {
	opacity: 1;
	animation: button-progress 1s ease-in-out infinite;
}

.login-mode-button {
	display: block;
	margin: 14px auto 0;
	padding: 5px;
}

.password-login-field {
	margin-top: 14px;
}

.signing-in-identity {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 4px;
	margin: -10px 0 24px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.55;
	text-align: center;
}

.signing-in-identity label {
	flex: 0 0 auto;
}

.signing-in-identity input {
	min-width: 0;
	width: min(28ch, 100%);
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-weight: 600;
	line-height: inherit;
	overflow: hidden;
	text-align: left;
	text-overflow: ellipsis;
}

.signing-in-identity input:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

#password-login-form input:-webkit-autofill {
	animation-name: appverse-autofill;
	animation-duration: 1ms;
}

.secondary-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-top: 18px;
}

.text-button {
	padding: 3px 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: color 160ms ease, text-decoration-color 160ms ease;
}

.text-button:hover:not(:disabled) {
	color: #3e3e3e;
	text-decoration-color: currentColor;
}

.text-button:disabled {
	color: #777777;
	cursor: default;
}

.danger-button {
	color: var(--danger);
}

.legal-copy {
	margin-top: 14px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.55;
	text-align: center;
}

.legal-copy a {
	border-radius: 2px;
	color: var(--ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.success-state {
	padding-top: 2px;
	text-align: left;
}

.success-state h2 {
	font-size: 20px;
}

.account-notice {
	margin: 12px 0 0;
	color: var(--danger);
	font-size: 12px;
	line-height: 1.5;
}

.account-summary {
	margin: 20px 0 0;
	border-top: 1px solid var(--border);
}

.account-row {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	align-items: center;
	gap: 18px;
	min-height: 52px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.account-row dt {
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
}

.account-row dd {
	min-width: 0;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.45;
	overflow-wrap: anywhere;
	text-align: right;
}

.account-row-editable {
	position: relative;
	margin-inline: -10px;
	padding-inline: 10px;
	transition: background 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-row-editable dd {
	padding-right: 28px;
}

.account-row-editable:hover {
	background: #f7f7f7;
}

.account-row-action {
	position: absolute;
	inset: 2px 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.account-row-action:disabled {
	cursor: wait;
}

.account-row-action:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.account-edit-icon {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-set-label {
	font-size: 12px;
	font-weight: 650;
}

.account-row-action:active:not(:disabled) .account-edit-icon,
.account-row-action:active:not(:disabled) .account-set-label {
	transform: translateY(1px);
}

.connection-value {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.provider-connect-button {
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--ink);
	border-radius: 8px;
	background: var(--background);
	color: var(--ink);
	font-size: 11px;
	font-weight: 650;
	cursor: pointer;
}

.provider-connect-button:hover:not(:disabled) {
	background: #f3f3f3;
}

.provider-connect-button:disabled {
	border-color: var(--border);
	color: var(--muted);
	cursor: not-allowed;
}

.account-actions {
	display: flex;
	align-items: center;
	margin-top: 24px;
}

.account-actions .text-button {
	padding: 12px 0;
}

.login-notice {
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f1f4f1;
	color: #29492f;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.45;
}

.profile-dialog {
	width: min(calc(100% - 40px), 430px);
	max-height: calc(100dvh - 40px);
	margin: auto;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--background);
	color: var(--ink);
	box-shadow: 0 24px 70px rgba(17, 17, 17, 0.18);
	overflow: hidden;
}

.profile-dialog::backdrop {
	background: rgba(17, 17, 17, 0.34);
}

.profile-dialog[open] {
	animation: dialog-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile-dialog-shell {
	max-height: inherit;
	padding: 24px;
	overflow-y: auto;
}

.profile-dialog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--border);
}

.profile-kicker {
	margin: 0 0 5px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-transform: uppercase;
}

.profile-dialog-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 650;
	letter-spacing: -0.025em;
	line-height: 1.25;
}

.profile-description {
	max-width: 34ch;
	margin: 7px 0 0;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.5;
}

.dialog-close-button {
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--background);
	color: var(--ink);
	font: inherit;
	font-size: 11px;
	font-weight: 650;
	cursor: pointer;
}

.dialog-close-button:hover {
	background: #f5f5f5;
}

.profile-editor {
	animation: state-in 180ms ease-out both;
}

.profile-form {
	display: grid;
	margin-top: 20px;
}

.profile-form + .profile-form {
	margin-top: 16px;
}

.form-button {
	width: 100%;
	margin-top: 12px;
}

.confirm-field {
	margin-top: 12px;
}

.verification-form {
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: #fafafa;
}

.verification-form .cancel-button {
	justify-self: center;
	margin-top: 12px;
}

.loading-state {
	display: grid;
	gap: 12px;
	padding-top: 1px;
}

.skeleton {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	background: var(--soft);
}

.skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	transform: translateX(-110%);
	animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-field,
.skeleton-button {
	width: 100%;
	height: 52px;
}

.skeleton-button {
	margin-top: 6px;
	background: #d4d4d4;
}

@keyframes state-in {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes dialog-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes drawer-in {
	from {
		opacity: 0;
		transform: translateY(28px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes appverse-autofill {
	from {
		opacity: 0.99;
	}
	to {
		opacity: 1;
	}
}

@keyframes button-progress {
	to {
		transform: translateX(370%);
	}
}

@keyframes skeleton-shimmer {
	to {
		transform: translateX(110%);
	}
}

@media (max-width: 480px) {
	.page-shell {
		place-items: start center;
		padding: 24px 20px 32px;
	}

	.auth-card {
		width: 100%;
		padding: 18px 0 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.brand-logo {
		width: 58px;
		height: 58px;
		margin-bottom: 20px;
	}

	.brand-header h1 {
		font-size: 23px;
	}

	.state-region {
		margin-top: 26px;
	}

	.secondary-actions {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}

	.account-actions {
		margin-top: 20px;
	}

	.account-row {
		grid-template-columns: 90px minmax(0, 1fr);
		gap: 12px;
	}

}

@media (max-width: 640px) {
	.profile-dialog {
		inset: auto 0 0;
		width: 100%;
		max-width: none;
		max-height: 82dvh;
		margin: 0;
		border-width: 1px 0 0;
		border-radius: 18px 18px 0 0;
	}

	.profile-dialog[open] {
		animation-name: drawer-in;
	}

	.profile-dialog-shell {
		padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
