/* ─── Ecto Button Widget ─── */

.ecto-btn-wrap {
	display: flex;
	justify-content: flex-start;
}

.ecto-btn-wrap--full .ecto-btn {
	width: 100%;
}

.ecto-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	line-height: 24px;
	text-decoration: none !important;
	cursor: pointer;
	border: 1px solid transparent;
	transition-property: background-color, color, border-color, box-shadow;
	transition-duration: 0.2s;
	transition-timing-function: ease;
	white-space: nowrap;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	vertical-align: middle;
}

/* ── Sizes ── */

.ecto-btn--lg {
	height: 56px;
	padding: 10px 24px;
}

.ecto-btn--md {
	height: 40px;
	padding: 10px 16px;
}

/* ── Primary ── */

.ecto-btn--primary {
	background-color: #2f6af7;
	color: #ffffff;
	border-color: transparent;
}

.ecto-btn--primary:not(.ecto-btn--disabled):hover {
	background-color: #1336d2;
	color: #ffffff;
}

/* ── Neutral ── */

.ecto-btn--neutral {
	background-color: #ffffff;
	color: #52525a;
	border-color: transparent;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

.ecto-btn--neutral:not(.ecto-btn--disabled):hover {
	background-color: #18181b;
	color: #ffffff;
	box-shadow: none;
}

/* ── Outline ── */

.ecto-btn--outline {
	background-color: transparent;
	color: #52525a;
	border-color: #d4d4d8;
}

.ecto-btn--outline:not(.ecto-btn--disabled):hover {
	color: #18181b;
	border-color: #717179;
}

/* ── Ghost ── */

.ecto-btn--ghost {
	background-color: transparent;
	color: #52525a;
	border-color: transparent;
}

.ecto-btn--ghost:not(.ecto-btn--disabled):hover {
	background-color: #f4f4f5;
	color: #18181b;
}

/* ── Disabled ── */

.ecto-btn--disabled {
	background-color: #fafafa !important;
	color: #d4d4d8 !important;
	border-color: transparent !important;
	box-shadow: none !important;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Icons ── */

.ecto-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ecto-btn__icon svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
}

.ecto-btn__icon i {
	font-size: 20px;
	line-height: 1;
}

/* ── Text ── */

.ecto-btn__text {
	transition: opacity 0.15s ease;
}

/* ── Loading ── */

.ecto-btn--loading .ecto-btn__text,
.ecto-btn--loading .ecto-btn__icon {
	visibility: hidden;
}

.ecto-btn--loading {
	pointer-events: none;
}

.ecto-btn__spinner {
	display: none;
	position: absolute;
	left: 50%;
	top: 50%;
	margin-left: -10px;
	margin-top: -10px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: ecto-btn-spin 0.65s linear infinite;
}

.ecto-btn--loading .ecto-btn__spinner {
	display: block;
}

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