/* =========================================================
   FluxHub Common — 통합 마이페이지 키트 (fxm-)
   =========================================================
   색은 쓰지 않는다 — 전부 var(--acct-*) (account-tokens.css). scripts/validate.sh 13번.
   본문 안(대시보드 지표·주문·쿠폰·폼·버튼 …)은 mypage-content.css 가 같은 문법으로 그린다.

   문법: 흰 바탕 + 검정 + 얇은 선. 카드 그림자·큰 모서리 없음.
     · 왼쪽 메뉴  글자만 — 얇은 선으로 나누고 활성은 굵게 + 왼쪽 대표색 막대. 사용자 이름은 크게.
     · 본문       카드 대신 굵은 위선·얇은 아래선과 크기 위계. 숫자가 주인공(tabular-nums).
     · 강조색     사이트 대표색 — 활성 막대·밑줄에만 좁게.

   1. 틀 · 내비  2. 첫 화면 지표  3. 섹션 제목  4. 목록·표  5. 배지
   6. 빈 상태  7. 페이지 넘김  8. 필드  9. 버튼  10. 금액·날짜
   11. 반응형  12. 모션 줄이기
   ========================================================= */

/* ===================
   1. 틀 — 내비 + 본문
   =================== */
.fxm-shell {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: clamp(32px, 6vw, 80px);
	max-width: 1120px;
	margin: 0 auto;
	padding: 40px clamp(16px, 4vw, 24px) clamp(64px, 9vw, 112px);
	box-sizing: border-box;
	font-family: var(--fxm-font);
	color: var(--acct-ink);
}

/* 0.19.6 — 버튼·입력칸은 브라우저 기본값이 글꼴을 물려받지 않는다(Arial 등으로 그려져 본문과 섞였다).
   틀 안의 모든 폼 요소가 틀의 글꼴을 쓰게 한다. 각 모듈이 따로 정한 글꼴(같은 Pretendard 계열)은 그대로 이긴다. */
.fxm-shell :where(button, input, select, textarea, optgroup) {
	font-family: inherit;
}

.fxm-nav {
	align-self: start;
	position: sticky;
	top: 100px;
	min-width: 0;
}

/* 사용자: 이름 크게 + 이메일. 원형 이니셜·그림자 없음 */
.fxm-nav__user {
	padding: 0 0 20px;
	margin: 0 0 8px;
	border-bottom: 1px solid var(--acct-ink);
}

.fxm-nav__user-name {
	display: block;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.3;
	color: var(--acct-ink);
	overflow-wrap: anywhere;
}

.fxm-nav__user-name::after { content: '님'; font-weight: 400; margin-left: 2px; }

.fxm-nav__user-grade {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--acct-muted);
}

.fxm-nav__user-email {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--acct-muted);
	overflow: hidden;
	text-overflow: ellipsis;
}

.fxm-nav__group { margin: 0 0 8px; }

.fxm-nav__group-title {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--acct-muted);
	padding: 20px 0 6px;
}

.fxm-nav__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 13px 0 13px 14px;
	border-bottom: 1px solid var(--acct-line);
	color: var(--acct-ink-2);
	text-decoration: none;
	font-size: 15px;
	letter-spacing: -0.01em;
	background: transparent;
	transition: color 0.2s ease, padding-left 0.2s ease;
}

.fxm-nav__item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 2px;
	height: 0;
	background: var(--acct-brand);
	transform: translateY(-50%);
	transition: height 0.2s ease;
}

.fxm-nav__item:hover { color: var(--acct-ink); padding-left: 18px; }
.fxm-nav__item:hover::before { height: 12px; }

.fxm-nav__item:focus-visible {
	outline: 2px solid var(--acct-ink);
	outline-offset: 2px;
}

.fxm-nav__item--active { color: var(--acct-ink); font-weight: 700; }
.fxm-nav__item--active::before { height: 18px; }

/* 아이콘 그림은 쓰지 않는다 — 글자만 */
.fxm-nav__icon { display: none; }

.fxm-nav__label { flex: 1 1 auto; min-width: 0; }
.fxm-nav__badge { flex: 0 0 auto; }

.fxm-content {
	min-width: 0; /* grid 자식이 내용으로 밀려 가로 스크롤을 만들지 않게 */
}

/* ===================
   2. 첫 화면 지표 — 카드 대신 굵은 위선 + 큰 숫자
   =================== */
.fxm-summary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 32px clamp(24px, 3vw, 40px);
	margin-bottom: 48px;
}

.fxm-summary-card {
	border-top: 1px solid var(--acct-ink);
	padding: 16px 0 0;
	background: transparent;
}

.fxm-summary-card__value {
	font-size: clamp(30px, 3.4vw, 40px);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 8px 0 4px;
	color: var(--acct-ink);
}

.fxm-summary-card__label {
	font-size: 14px;
	font-weight: 500;
	color: var(--acct-muted);
}

/* ===================
   3. 섹션 제목
   =================== */
.fxm-section-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.4;
	margin: 0 0 14px;
	color: var(--acct-ink);
}

/* ===================
   4. 목록 · 표 (모바일 행 전환)
   =================== */
.fxm-table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	background: transparent;
	border: 0;
}

.fxm-table th,
.fxm-table td {
	padding: 16px 8px;
	text-align: left;
	border-bottom: 1px solid var(--acct-line);
	font-size: 15px;
}

.fxm-table th {
	padding: 12px 8px;
	color: var(--acct-muted);
	font-weight: 500;
	font-size: 13px;
	background: transparent;
	border-top: 1px solid var(--acct-ink);
}

.fxm-table td { font-variant-numeric: tabular-nums; }

@media (max-width: 768px) {
	.fxm-table,
	.fxm-table thead,
	.fxm-table tbody,
	.fxm-table th,
	.fxm-table td,
	.fxm-table tr {
		display: block;
	}
	.fxm-table { border-top: 1px solid var(--acct-ink); }
	.fxm-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
	.fxm-table tr {
		border-bottom: 1px solid var(--acct-line);
		padding: 12px 0;
	}
	.fxm-table td {
		border-bottom: 0;
		padding: 4px 0;
		display: flex;
		justify-content: space-between;
		gap: 12px;
	}
	.fxm-table td::before {
		content: attr(data-label);
		color: var(--acct-muted);
		font-size: 13px;
		flex: 0 0 auto;
	}
}

/* ===================
   5. 상태 배지 — 색 알약 대신 글자 + 얇은 테두리
   =================== */
.fxm-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 8px;
	border: 1px solid var(--acct-line-strong);
	border-radius: var(--acct-radius-pill);
	background: transparent;
	color: var(--acct-ink);
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* 강조(알림 개수 등): 검정 채움 — 색이 아니라 명도 대비로 눈에 띈다 */
.fxm-badge--accent {
	background: var(--acct-ink);
	border-color: var(--acct-ink);
	color: var(--acct-white);
}

.fxm-badge--ok { border-color: var(--acct-ink); }
.fxm-badge--warn { border-style: dashed; }
.fxm-badge--danger { border-color: var(--acct-danger-line); color: var(--acct-danger); }

/* ===================
   6. 빈 상태 — 다음 행동 안내
   =================== */
.fxm-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 56px 16px;
	background: var(--acct-warm);
	border-radius: var(--acct-radius);
	color: var(--acct-muted);
}

.fxm-empty__title {
	font-size: 15px;
	color: var(--acct-ink);
	margin: 0 0 6px;
}

.fxm-empty__desc {
	font-size: 14px;
	margin: 0 0 16px;
}

/* ===================
   7. 페이지 넘김
   =================== */
.fxm-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	margin-top: 24px;
}

.fxm-pagination__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	border-radius: var(--acct-radius);
	color: var(--acct-ink-2);
	text-decoration: none;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.fxm-pagination__item:hover { background: var(--acct-warm); color: var(--acct-ink); }
.fxm-pagination__item:focus-visible { outline: 2px solid var(--acct-ink); outline-offset: 2px; }
.fxm-pagination__item--active { background: var(--acct-ink); color: var(--acct-white); font-weight: 700; }

/* ===================
   8. 필드
   =================== */
.fxm-field { margin-bottom: 20px; }

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

.fxm-field__input {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	padding: 0 14px;
	box-sizing: border-box;
	background: var(--acct-white);
	border: 1px solid var(--acct-field-line);
	border-radius: var(--acct-radius);
	color: var(--acct-ink);
	font-size: 15px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fxm-field__input:focus {
	outline: 0;
	border-color: var(--acct-ink);
	box-shadow: var(--acct-focus-ring);
}

/* ===================
   9. 버튼 — 알약: 기본=검정 채움 / 보조=흰 바탕+테두리
   =================== */
.fxm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 28px;
	border-radius: var(--acct-radius-pill);
	border: 1px solid var(--acct-line-strong);
	background: var(--acct-white);
	color: var(--acct-ink);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.fxm-btn:hover { border-color: var(--acct-ink); }
.fxm-btn:focus-visible { outline: 2px solid var(--acct-ink); outline-offset: 3px; }

.fxm-btn--primary {
	background: var(--acct-ink);
	border-color: var(--acct-ink);
	color: var(--acct-white);
}

.fxm-btn--primary:hover { background: var(--acct-black); border-color: var(--acct-black); }

/* ===================
   10. 금액 · 날짜 표기
   =================== */
.fxm-amount {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.fxm-date {
	color: var(--acct-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

/* ===================
   11. 반응형 — 태블릿·모바일
   세로 메뉴 → 가로로 밀어 넘기는 탭 (페이지 가로 스크롤은 만들지 않는다)
   =================== */
@media (max-width: 1024px) {
	.fxm-shell {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		padding-top: 28px;
	}
	.fxm-nav { position: static; }
	.fxm-nav__user { padding-bottom: 16px; margin-bottom: 0; border-bottom: 1px solid var(--acct-ink); }
	.fxm-nav__list {
		display: flex;
		gap: 22px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		border-bottom: 1px solid var(--acct-line);
		scrollbar-width: none;
	}
	.fxm-nav__list::-webkit-scrollbar { display: none; }
	.fxm-nav__group { display: flex; gap: 22px; margin: 0; flex: 0 0 auto; }
	.fxm-nav__group-title { display: none; }
	.fxm-nav__item {
		flex: 0 0 auto;
		white-space: nowrap;
		padding: 14px 0;
		border-bottom: 2px solid transparent;
	}
	.fxm-nav__item::before { display: none; }
	.fxm-nav__item:hover { padding-left: 0; }
	.fxm-nav__item--active { border-bottom-color: var(--acct-ink); }
}

@media (max-width: 768px) {
	.fxm-summary-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
}

@media (max-width: 480px) {
	.fxm-summary-grid { grid-template-columns: 1fr; }
}

/* ===================
   12. 모션 줄이기
   =================== */
@media (prefers-reduced-motion: reduce) {
	.fxm-nav__item,
	.fxm-nav__item::before,
	.fxm-btn,
	.fxm-field__input { transition: none; }
}
