/* 로그인세무사 웹 — 공통 컴포넌트 (토스 톤). tokens.css 위에서 동작. */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Typography (app_typography 매핑) */
.t-display { font-size: 28px; font-weight: 700; line-height: 1.3; }
.t-h1 { font-size: 24px; font-weight: 700; line-height: 1.3; }
.t-h2 { font-size: 22px; font-weight: 700; line-height: 1.3; }
.t-title1 { font-size: 20px; font-weight: 700; line-height: 1.4; }
.t-title2 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.t-title3 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.t-body1 { font-size: 16px; font-weight: 400; line-height: 1.6; }
.t-body2 { font-size: 15px; font-weight: 400; line-height: 1.6; }
.t-label1 { font-size: 16px; font-weight: 600; }
.t-label2 { font-size: 14px; font-weight: 500; }
.t-caption1 { font-size: 13px; color: var(--text-secondary); }
.t-caption2 { font-size: 12px; color: var(--text-tertiary); }
.c-secondary { color: var(--text-secondary); }
.c-tertiary { color: var(--text-tertiary); }
.c-primary { color: var(--primary); }

/* Layout */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--s-xl); }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: var(--s-2xl); height: 64px; }
.site-header .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.site-header .brand .dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--primary); }
.site-header nav { display: flex; gap: var(--s-xl); margin-left: auto; }
.site-header nav a { color: var(--text-secondary); font-weight: 500; font-size: 15px; }
.site-header nav a:hover { color: var(--text-primary); }

/* Buttons (app_theme CTA 54h 라운드12) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 54px; padding: 0 22px; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-pressed); }
.btn-ghost { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-sm { height: 44px; padding: 0 16px; font-size: 15px; }

/* Card (AppCard: 흰 카드 + 헤어라인 + 은은한 그림자) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s-lg);
}
.card-flat { box-shadow: none; }

/* Chip */
.chip {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: var(--r-sm); background: var(--surface-alt);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
}

/* Presence dot */
.dot-presence { width: 10px; height: 10px; border-radius: var(--r-full); display: inline-block; }
.dot-online { background: var(--presence-online); }
.dot-away { background: var(--presence-away); }
.dot-busy { background: var(--presence-busy); }
.dot-offline { background: var(--presence-offline); }

/* Hero (홈 상단 — 앱 히어로 톤) */
.hero {
  background: linear-gradient(135deg, #3182F6, #1B64DA);
  color: #fff; border-radius: var(--r-xl);
  padding: 40px 32px; margin-top: var(--s-2xl);
}
.hero h1 { font-size: 32px; font-weight: 700; line-height: 1.3; }
.hero p { margin-top: 10px; font-size: 16px; color: rgba(255,255,255,.88); }
.hero .btn { margin-top: 24px; background: #fff; color: var(--primary); }
.hero .btn:hover { background: #f0f6ff; }

/* Feature grid */
.grid { display: grid; gap: var(--s-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.feature .ic {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px;
}
.feature h3 { font-size: 17px; font-weight: 700; }
.feature p { margin-top: 4px; font-size: 14px; color: var(--text-tertiary); }

/* Section */
.section { margin-top: var(--s-3xl); }
.section > h2 { font-size: 22px; font-weight: 700; margin-bottom: var(--s-lg); }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface-alt); }
.site-footer .inner { padding: 28px 0 40px; color: var(--text-tertiary); font-size: 13px; }
.site-footer a { color: var(--text-secondary); }

/* Auth (로그인·마이) */
.auth-wrap { display: flex; justify-content: center; padding: 48px 0; }
.auth-card { width: 100%; max-width: 400px; }
.sns-list { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
/* SNS 로그인 버튼 (D-117) — 각 사 공식 규격.
   카카오·네이버는 콘솔이 배포한 **완성 버튼 이미지**를 그대로 쓴다. 비율을 바꾸면
   심볼·레이블이 찌그러져 규격 위반이므로 늘리지 말고 `contain`으로만 맞춘다. */
.sns-img-btn {
  display: block; width: 100%; border-radius: var(--r-md); overflow: hidden;
  line-height: 0; /* inline 이미지 아래 여백 제거 */
}
.sns-img-btn img { width: 100%; height: auto; display: block; }
.sns-kakao { background: var(--kakao); }
.sns-naver { background: var(--naver); }
.sns-img-btn:hover { filter: brightness(0.96); }

/* 구글·애플은 로고 + 라벨을 우리가 조립한다(공식 배포 이미지가 없음). */
.sns-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600;
}
.sns-btn .sns-ic { width: 20px; height: 20px; flex: 0 0 20px; }
/* 구글 브랜드 가이드(라이트): 배경 #FFFFFF · 테두리 #747775 1px · 표준 컬러 G.
   자체 제작 아이콘은 가이드에서 명시적으로 금지한다. */
.sns-google { background: #fff; color: var(--text-primary); border: 1px solid #747775; }
.sns-google:hover { background: var(--surface-alt); }
/* 애플 HIG: 검정 배경 + 흰 로고. */
.sns-apple { background: var(--apple); color: #fff; }
.sns-apple:hover { filter: brightness(1.15); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--surface-alt); border: 1px solid transparent; font-size: 15px; color: var(--text-primary);
}
.input:focus { outline: none; border-color: var(--primary); background: var(--surface); }

/* Key-Value (마이) */
.kv { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.kv:last-child { border-bottom: none; }
.kv .k { width: 72px; color: var(--text-tertiary); font-size: 14px; flex-shrink: 0; }
.kv .v { color: var(--text-primary); font-size: 15px; font-weight: 500; word-break: break-all; }

/* 세무사 카드(디렉토리·인기) */
.tax-list { display: flex; flex-direction: column; gap: 12px; margin-top: var(--s-lg); }
.tax-card { display: flex; gap: 14px; align-items: flex-start; }
.tax-card:hover { border-color: var(--grey300); }
.avatar {
  width: 56px; height: 56px; border-radius: var(--r-lg); flex-shrink: 0;
  background: var(--surface-alt); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: var(--primary);
}
.avatar-sm { width: 44px; height: 44px; font-size: 16px; border-radius: var(--r-md); }
.tax-main { flex: 1; min-width: 0; }
.tax-name-row { display: flex; align-items: center; gap: 8px; }
.tax-name { font-size: 17px; font-weight: 700; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full);
  background: var(--primary-light); color: var(--primary);
}
/* 답변대기 등 '아직 처리 전' 상태 배지. */
.badge-pending { background: #FFF3E8; color: #C2410C; }
.tax-sub { margin-top: 3px; font-size: 13px; color: var(--text-tertiary); }
.tax-rating { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.tax-rating .star { color: var(--warning); }
.spec-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.spec { font-size: 12px; padding: 3px 8px; border-radius: var(--r-sm); background: var(--primary-light); color: var(--primary); }
.presence { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-tertiary); }

/* 필터 바 */
.filter-bar { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.filter-chip {
  padding: 8px 16px; border-radius: var(--r-full); background: var(--surface-alt);
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
}
.filter-chip.on { background: var(--primary); color: #fff; }
.search-box { display: flex; gap: 8px; margin-bottom: 8px; }
.search-box input { flex: 1; }

/* 상세 */
.detail-cover { height: 120px; border-radius: var(--r-xl); background: linear-gradient(135deg,#3182F6,#1B64DA); }
.detail-head { display: flex; gap: 16px; align-items: center; margin-top: -28px; padding: 0 8px; }
.detail-head .avatar { width: 72px; height: 72px; border: 3px solid #fff; font-size: 26px; }
.product-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.product-row:last-child { border-bottom: none; }
.price { font-weight: 700; color: var(--primary); }

/* 선택 칩 (체크박스·라디오 공용) — 분야·상담방식·전달대상 */
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; display: inline-flex; align-items: center; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; background: var(--surface); user-select: none; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 700; }
/* 상한(D-129)에 닿아 지금은 고를 수 없는 항목 — 눌리지 않는 이유를 눈으로 알려 준다. */
.choice-chip.is-locked { opacity: .45; cursor: not-allowed; }

/* 예약 슬롯 선택 */
.slot-group { margin-top: 18px; }
.slot-group-label { font-weight: 700; margin-bottom: 10px; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 62px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 500; background: var(--surface); user-select: none; }
.slot-chip input { position: absolute; opacity: 0; pointer-events: none; }
.slot-chip:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); background: var(--surface-alt); font-weight: 700; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--divider); }
.review-item:last-child { border-bottom: none; }

/* 채팅 */
.chat-msgs { margin: 16px 0; min-height: 200px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; align-items: flex-end; gap: 6px; }
.msg-row.mine { flex-direction: row-reverse; }
.bubble { max-width: 72%; padding: 10px 14px; border-radius: var(--r-lg); font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble-peer { background: var(--surface-alt); color: var(--text-primary); border-top-left-radius: 4px; }
.bubble-mine { background: var(--primary); color: #fff; border-top-right-radius: 4px; }
.msg-time { font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.chat-send { display: flex; gap: 8px; position: sticky; bottom: 12px; background: var(--background); padding-top: 8px; }
.chat-send input { flex: 1; }

/* Responsive */
@media (max-width: 720px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .site-header nav { display: none; }
  .hero { padding: 32px 22px; }
  .hero h1 { font-size: 26px; }
}
