/* common.css — 전 페이지 공통 스타일 (색상/버튼/헤더/푸터) */

/* ===== 색상 토큰 (Brand Navy 팔레트 · 정의: 브랜드-컬러.md) ===== */
:root {
  --color-primary: #2f5d9f; /* Brand Navy (기존 Toss #3182f6에서 전환) */
  --color-primary-hover: #244b80; /* hover/focus 상태 */
  --color-primary-dark: #17375e; /* 가장 어두운 톤 (active/그라데이션 끝) */
  --color-primary-soft: #eef2f7; /* 네이비 8% 틴트 — 선택 상태 배경 */
  --color-primary-faint: #f7f9fb; /* 네이비 4% 틴트 — 배너/행 배경 */
  --color-primary-line: #cbd7e7; /* 네이비 25% 틴트 — 연한 테두리 */
  --color-text: #191f28; /* Toss 거의 검정 (헤딩) */
  --color-text-muted: #4e5968; /* Toss 본문 회색 */
  --color-text-light: #6b7684; /* 보조 회색 (대비 강화) */
  --color-bg: #ffffff;
  --color-bg-soft: #f9fafb;
  --color-bg-gray: #f2f4f6; /* Toss 섹션 배경 회색 */
  --color-border: #e5e8eb;
  --radius: 16px; /* Toss는 큰 라운드 */
  --radius-sm: 12px;
  --container: 1120px;
}

/* ===== 리셋 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
/* 모바일 가로 오버플로우 가드 (섹션 목업/티커가 뷰포트를 넘겨 페이지가 밀리는 것 방지) */
html,
body {
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family:
    "SUIT",
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  letter-spacing: -0.02em; /* Toss 특유의 살짝 좁은 자간 */
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 헤더 ===== */
.site-header {
  /* 대시보드(dashboard.css body)와 동일한 폰트 스택 — 페이지 간 헤더 크기·굵기 렌더링 통일 */
  font-family: "SUIT", sans-serif;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-primary);
}
/* 브랜드 로고 마크 — logo_car.png 락업(428x427)에서 자동차 부분(x75~357, y132~243)만 크롭 */
.logo-mark {
  display: inline-block;
  flex: none;
  width: 61px;
  height: 24px;
  background: url("../images/logo_car.png") no-repeat -16.2px -28.5px / 92.5px
    auto;
}
/* 어두운 배경(네이비 패널·다크 푸터)용 흰색 마크 */
.logo-mark--white {
  filter: brightness(0) invert(1);
}
/* DI3 로고 이미지 (di3-logo.svg, 원본 88x52) */
.logo-img {
  display: block;
  height: 30px;
  width: auto;
}
.logo-img--white {
  filter: brightness(0) invert(1);
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 500;
}
.nav a:hover {
  color: var(--color-text);
}
.nav-login {
  font-weight: 600;
}
/* auth 슬롯 */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 로그인 후 헤더 아이콘 링크 (내 계정 / 구독관리) — 아이콘 + 작은 글자 병기 */
.nav-icon-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-muted);
}
.nav-icon-link i {
  font-size: 16px;
}
.nav-icon-link:hover {
  color: var(--color-primary);
}

/* ===== 메인 페이지 헤더 (블루 배경 + 흰 텍스트 + 가운데 섹션 네비) ===== */
.site-header-home {
  /* background: var(--color-primary); */
  background-color: #fff;
  backdrop-filter: none;
}
.site-header-home .header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.site-header-home .logo {
  color: var(--color-primary);
  justify-self: start;
}
.site-header-home .nav-sections {
  justify-self: center;
}
.site-header-home .nav-auth {
  justify-self: end;
}

/* 헤더 텍스트 흰색 */
.site-header-home .nav a {
  color: var(--color-text);
}
.site-header-home .nav a:hover {
  color: var(--color-text);
}
.site-header-home .nav-login {
  color: var(--color-text);
}

/* 시작하기·로그아웃 버튼: 블루 위에서 흰 글씨 유지 (테두리형) */
.site-header-home .btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.site-header-home .btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: none;
}
.site-header-home.is-scrolled {
  border-bottom-color: transparent;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.15);
}

/* ===== 버튼 ===== */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 8px 20px rgba(47, 93, 159, 0.28);
}
.btn-sm {
  padding: 9px 18px;
  font-size: 14px;
}
.btn-lg {
  padding: 17px 34px;
  font-size: 17px;
  border-radius: var(--radius);
}
.btn-block {
  display: block;
  width: 100%;
}

/* 보조 버튼 (대시보드) */
.btn-ghost {
  background: var(--color-bg-gray);
  color: var(--color-text);
  padding: 13px 22px;
  font-size: 15px;
}
.btn-ghost:hover {
  background: #e5e8eb;
}
.btn-danger-ghost {
  background: transparent;
  color: #e5484d;
  border: 1px solid #f3c7c9;
  padding: 13px 22px;
  font-size: 15px;
}
.btn-danger-ghost:hover:not(:disabled) {
  background: #fdecec;
}
.btn-danger-ghost:disabled {
  color: var(--color-text-light);
  border-color: var(--color-border);
  cursor: default;
}

/* ===== 섹션 공통 ===== */
.section {
  padding: 84px 0;
}
.section-title {
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 44px;
}

/* ===== 푸터 개편 ===== */
.site-footer {
  background: #11161e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 64px 0;
  color: #8b95a1;
  font-size: 11.5px;
  text-align: left;
}
.footer-container {
  display: flex;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-col {
  display: flex;
  flex-direction: column;
}
.footer-logo-col {
  flex: 0 0 20%;
}
.footer-logo {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}
.footer-tagline {
  font-size: 12px;
  line-height: 1.6;
  color: #8b95a1;
}
.footer-info-col {
  flex: 1;
  max-width: 50%;
  line-height: 1.8;
}
.footer-info-row {
  margin-bottom: 2px;
}
.footer-legal-links {
  margin-top: 6px;
}
.footer-terms-link {
  color: #8b95a1;
  text-decoration: underline;
  padding-right: 12px;
  margin-right: 12px;
  border-right: 1px solid #3d4552;
}
.footer-terms-link:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: none;
}
.footer-terms-link:hover {
  color: #ffffff;
}
.footer-links-col {
  flex: 0 0 12%;
}
.footer-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}
.footer-text-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-text-list li {
  color: #8b95a1;
  list-style: none;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 32px;
  }
  .footer-info-col {
    max-width: 100%;
  }
}

/* ===== 인증/폼 페이지 (login, subscribe 공용) ===== */
.auth {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--color-bg-soft);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 40px 34px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}
.auth-card-wide {
  max-width: 480px;
}
.auth-title {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}
.auth-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

/* 입력 필드 */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.field input.is-invalid {
  border-color: #d64545;
}
.field-error {
  color: #d64545;
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* 체크박스 */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  cursor: pointer;
}

/* 폼 메시지 */
.form-message {
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--color-text-muted);
}
.form-message.is-success {
  color: #1a7f4b;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 22px;
}
.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
}
.auth-footer-sub {
  margin-top: 8px;
}

/* 비밀번호 찾기 등 폼 내 보조 링크 */
.auth-links {
  text-align: right;
  margin: -8px 0 18px;
}
.auth-links a {
  font-size: 13px;
  color: var(--color-text-muted);
}
.auth-links a:hover {
  color: var(--color-primary);
}

/* 주문 요약 (subscribe) */
.order-summary {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 26px;
}
.order-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  padding: 4px 0;
}
.order-note {
  color: var(--color-text-muted);
  font-size: 13px;
}
.order-total {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
}
.order-total strong {
  color: var(--color-primary);
  font-size: 18px;
}

.pay-note {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 12px;
}

/* ===== 대시보드 (내 구독관리) ===== */
.dashboard {
  min-height: calc(100vh - 68px);
  background: var(--color-bg-gray);
  padding: 64px 20px 96px;
}
.dashboard-inner {
  max-width: 640px;
}
.dashboard-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.dashboard-hello {
  color: var(--color-text-muted);
  font-size: 17px;
  margin-bottom: 32px;
}
.dashboard-hello strong {
  color: var(--color-text);
}

.sub-card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 34px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}
.sub-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.sub-badge {
  background: rgba(47, 93, 159, 0.12);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.sub-badge.is-canceled {
  background: #fdecec;
  color: #e5484d;
}
.sub-plan {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub-detail {
  border-top: 1px solid var(--color-border);
}
.sub-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.sub-row dt {
  color: var(--color-text-muted);
  font-size: 15px;
}
.sub-row dd {
  font-weight: 600;
  font-size: 15px;
}

.sub-message {
  font-size: 14px;
  margin: 20px 0 4px;
  min-height: 20px;
}
.sub-message.is-info {
  color: var(--color-primary);
}

.sub-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.dashboard-note {
  color: var(--color-text-light);
  font-size: 13px;
  margin-top: 20px;
  text-align: center;
}

/* ===== 결제 카드 패널 ===== */
.card-panel {
  background: #fff;
  border-radius: 24px;
  padding: 32px 34px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}
.card-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-panel-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card-empty {
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* 등록된 카드 목업 */
.cc-mock {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 24px 26px;
  aspect-ratio: 1.6 / 1;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 30px rgba(47, 93, 159, 0.3);
}
.cc-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.cc-number {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.cc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 14px;
}
.cc-holder {
  font-weight: 600;
  text-transform: uppercase;
}
.cc-exp {
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}

.card-manage {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.card-manage .btn {
  padding: 8px 16px;
  font-size: 13px;
}

/* 카드 등록 폼 */
.card-form {
  margin-top: 4px;
}
.card-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.card-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.card-form-actions .btn {
  flex: 1;
  padding: 13px;
}

/* ===== 반응형 ===== */
@media (max-width: 640px) {
  .nav {
    gap: 14px;
  }
  .nav a:not(.btn):not(.nav-login) {
    display: none;
  }
  .section {
    padding: 56px 0;
  }
  .section-title {
    font-size: 24px;
  }
  .auth-card {
    padding: 32px 24px;
  }
  .dashboard-title {
    font-size: 27px;
  }
  .sub-card {
    padding: 28px 22px;
  }
  .sub-actions {
    flex-direction: column;
  }
}

/* ===== Floating Quick Menu ===== */
.floating-menu {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
  pointer-events: none;
}
.floating-menu * {
  pointer-events: auto;
}
.floating-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--color-bg);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-decoration: none;
}
.floating-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.08);
}
/* Material Symbols 기본 클래스 — 구글 스타일시트 로딩 실패/지연 시에도
   아이콘이 텍스트(ligature 원문)로 깨지지 않도록 명시적으로 정의 */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  vertical-align: middle; /* 아이콘과 텍스트의 세로 정렬을 맞추기 위해 설정 */
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
.floating-btn .material-symbols-outlined {
  font-size: 24px;
}
.floating-btn.btn-call {
  background-color: var(--color-primary);
  color: #ffffff;
}
.floating-btn.btn-call:hover {
  background-color: var(--color-primary-hover);
}
.floating-btn.btn-chat {
  background-color: #041627;
  color: #ffffff;
}
.floating-btn.btn-chat:hover {
  background-color: #0c253d;
}
.floating-btn.btn-top {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  visibility: hidden;
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.floating-btn.btn-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.floating-btn .btn-label {
  position: absolute;
  right: 64px;
  background-color: #191f28;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.floating-btn:hover .btn-label {
  opacity: 1;
  transform: translateX(0);
}
@media (max-width: 768px) {
  .floating-menu {
    bottom: 20px;
    right: 20px;
    gap: 8px;
  }
  .floating-btn {
    width: 48px;
    height: 48px;
  }
  .floating-btn .btn-label {
    display: none;
  }
  .call-popup {
    right: 56px !important;
  }
}

/* 플로팅 버튼 개별 컨테이너 및 팝업 */
.floating-btn-container {
  position: relative;
}
.call-popup {
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  pointer-events: none;
}
.call-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}
.call-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.btn-copy-num {
  background-color: #f2f4f6;
  color: var(--color-text-muted);
  border: none;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.btn-copy-num:hover {
  background-color: #e5e8eb;
  color: var(--color-text);
}
