/* ===================
   1. Variables (팀 설정 프론트 화면)
   포인트 색상 3종(--fxt-brand, --fxt-brand-deep, --fxt-on-brand)은
   assets/js/team-settings.js 가 입력에 따라 바꾼다. 아래는 스크립트 실행 전 기본값이다.
   =================== */
.fxt-page {
	--fxt-brand: #1565C0;
	--fxt-brand-deep: #0D3F7A;
	--fxt-on-brand: #FFFFFF;
	--fxt-ink: #16181D;
	--fxt-ink-2: #4B5160;
	--fxt-muted: #626877;
	--fxt-line: #E4E6EB;
	--fxt-line-strong: #868B97;
	--fxt-canvas: #F4F5F7;
	--fxt-surface: #FFFFFF;
	--fxt-danger: #B3261E;
	--fxt-radius: 16px;
	--fxt-radius-sm: 12px;
	--fxt-font: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, system-ui, "Malgun Gothic", sans-serif;
}

/* ===================
   2. Base
   =================== */
body.fxt-screen {
	margin: 0;
	background: #F4F5F7;
}

.fxt-page {
	min-height: 100vh;
	background: var(--fxt-canvas);
	color: var(--fxt-ink);
	font-family: var(--fxt-font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-text-size-adjust: 100%;
}

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

.fxt-page [hidden] {
	display: none;
}

.fxt-page :where(p, h1, h2) {
	margin: 0;
}

.fxt-page :focus-visible {
	outline: 3px solid var(--fxt-ink);
	outline-offset: 2px;
}

/* ===================
   3. Layout
   =================== */
.fxt-top {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 640px;
	margin: 0 auto;
	padding: 8px 8px 0;
}

.fxt-top__back {
	display: inline-flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--fxt-radius-sm);
	color: var(--fxt-ink-2);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.fxt-top__back:hover {
	background: var(--fxt-line);
}

.fxt-top__title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.fxt-main {
	max-width: 640px;
	margin: 0 auto;
	padding: 8px 16px 0;
}

/* ===================
   4. Components
   =================== */

/* 미리보기: 커버 + 로고 + 견본 */
.fxt-preview {
	overflow: hidden;
	border-radius: var(--fxt-radius);
	background: var(--fxt-surface);
}

.fxt-preview__cover {
	height: 128px;
	background-color: var(--fxt-brand);
	background-image: linear-gradient(135deg, var(--fxt-brand) 0%, var(--fxt-brand-deep) 100%);
}

.fxt-preview__body {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 16px;
	padding: 0 20px 20px;
}

.fxt-preview__logo {
	display: grid;
	flex: none;
	place-items: center;
	width: 72px;
	height: 72px;
	margin-top: -36px;
	border: 4px solid var(--fxt-surface);
	border-radius: var(--fxt-radius);
	background-color: var(--fxt-brand);
	color: var(--fxt-on-brand);
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.fxt-preview__meta {
	flex: 1 1 200px;
	min-width: 0;
}

.fxt-preview__name {
	overflow: hidden;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fxt-preview__hint {
	color: var(--fxt-muted);
	font-size: 14px;
	line-height: 1.5;
}

.fxt-preview__sample {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 88px;
	min-height: 44px;
	padding: 0 24px;
	border-radius: 999px;
	background-color: var(--fxt-brand);
	color: var(--fxt-on-brand);
	font-size: 16px;
	font-weight: 600;
}

/* 설정 묶음: 카드를 따로 만들지 않고 한 장의 면 위에서 선으로 나눈다 */
.fxt-group {
	padding: 24px 20px;
	background: var(--fxt-surface);
}

.fxt-preview + .fxt-group {
	margin-top: 16px;
	border-radius: var(--fxt-radius) var(--fxt-radius) 0 0;
}

.fxt-group + .fxt-group {
	border-top: 1px solid var(--fxt-line);
}

.fxt-group:last-of-type {
	border-radius: 0 0 var(--fxt-radius) var(--fxt-radius);
}

.fxt-group__title {
	margin-bottom: 16px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.fxt-group__desc {
	margin: -8px 0 16px;
	color: var(--fxt-muted);
	font-size: 14px;
}

.fxt-field {
	margin-top: 16px;
}

.fxt-group__title + .fxt-field,
.fxt-grid > .fxt-field {
	margin-top: 0;
}

.fxt-field__label {
	display: block;
	margin-bottom: 8px;
	color: var(--fxt-ink-2);
	font-size: 14px;
	font-weight: 600;
}

.fxt-field__help {
	margin-top: 8px;
	color: var(--fxt-muted);
	font-size: 14px;
	line-height: 1.5;
}

.fxt-input {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--fxt-line-strong);
	border-radius: var(--fxt-radius-sm);
	background: var(--fxt-surface);
	color: var(--fxt-ink);
	font: inherit;
	transition: border-color 0.2s ease;
}

.fxt-input:hover {
	border-color: var(--fxt-ink-2);
}

.fxt-input--hex {
	max-width: 200px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.fxt-money {
	display: flex;
	align-items: center;
	gap: 8px;
}

.fxt-money .fxt-input {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.fxt-money__unit {
	color: var(--fxt-ink-2);
	font-size: 14px;
}

.fxt-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.fxt-check {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	margin-top: 16px;
	cursor: pointer;
}

.fxt-check input {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--fxt-ink);
}

/* 프리셋 색상 */
.fxt-swatches {
	display: grid;
	grid-template-columns: repeat(6, minmax(44px, 1fr));
	gap: 8px;
	margin-bottom: 16px;
}

.fxt-swatch {
	min-width: 44px;
	min-height: 44px;
	aspect-ratio: 1;
	padding: 0;
	border: 2px solid var(--fxt-surface);
	border-radius: 50%;
	background-color: var(--fxt-line);
	cursor: pointer;
	transition: transform 0.2s ease;
}

.fxt-swatch:hover {
	transform: scale(1.06);
}

.fxt-swatch:active {
	transform: scale(0.96);
}

.fxt-swatch[aria-pressed="true"] {
	box-shadow: 0 0 0 2px var(--fxt-ink);
}

/* 저장 바 */
.fxt-savebar {
	position: sticky;
	bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 -16px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--fxt-line);
	background: var(--fxt-surface);
}

.fxt-btn {
	min-height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: var(--fxt-radius-sm);
	background-color: var(--fxt-brand);
	color: var(--fxt-on-brand);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.2s ease, transform 0.2s ease;
}

.fxt-btn:hover {
	filter: brightness(0.92);
}

.fxt-btn:active {
	transform: translateY(1px);
}

.fxt-btn:disabled {
	cursor: progress;
	opacity: 0.6;
}

.fxt-msg {
	font-size: 14px;
	font-weight: 600;
}

.fxt-msg--ok {
	color: var(--fxt-ink);
}

.fxt-msg--error {
	color: var(--fxt-danger);
}

/* ===================
   6. Responsive
   =================== */
@media (min-width: 768px) {
	.fxt-main {
		padding-top: 16px;
	}

	.fxt-grid {
		grid-template-columns: 1fr 1fr;
	}

	.fxt-preview__cover {
		height: 160px;
	}

	.fxt-savebar {
		flex-direction: row-reverse;
		align-items: center;
		justify-content: space-between;
		margin: 0;
		border: 1px solid var(--fxt-line);
		border-radius: var(--fxt-radius);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fxt-page * {
		transition: none;
	}
}
