/* ============================================================
   COMMON.CSS — Ubique Korea
   공통 컴포넌트: 디자인 토큰 · Header · CTA · Footer · Back-to-Top
   ============================================================ */

/* ============================================================
   00: DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --color-primary:        #7061ff;
  --color-primary-light:  #eaeaff;
  --color-blue:           #5c95ff;
  --color-blue-2:         #368ff6;
  --color-dark:           #1a1a2e;
  --color-text:           #555555;
  --color-text-secondary: #5e5e5e;
  --color-white:          #ffffff;
  --color-footer-bg:      #0f0626;
  --color-border:         #f0f0f0;
  --color-border-2:       #dddddd;
  --color-faq-bg:         #eff3ff;
  --color-services-bg:    #f3f8ff;

  /* Gradients */
  --grad-hero-1:    linear-gradient(93.25deg, #6e4cff 48.08%, #769eff 84.78%);
  --grad-hero-2:    linear-gradient(95.81deg, #654dff 31.87%, #769eff 65.24%);
  --grad-heading:   linear-gradient(92.30deg, #7566ff 0.41%, #7493ff 29.96%);
  --grad-primary:   linear-gradient(93.51deg, #7a55ff 0.41%, #7882ff 99.55%);
  --grad-services:  linear-gradient(90deg, rgba(114,143,255,0.03) 0%, #f3f8ff 100%);

  /* Typography */
  --font-base:   'Pretendard', 'Noto Sans KR', sans-serif;
  /* 본문 폰트를 SUIT 에서 Pretendard 로 교체. 변수 이름은 참조 77곳 때문에 유지한다. */
  --font-suit:   var(--font-base);
  --font-noto:   'Noto Sans KR', sans-serif;

  /* Spacing */
  --section-px:    160px;
  --content-max:   1600px;

  /* Border Radius */
  --radius-card:   24px;
  --radius-btn:    9999px;
  --radius-badge:  9999px;
  --radius-logo:   18.57px;

  /* Shadows */
  --shadow-card:   12.38px 12.38px 37.14px 0 rgba(0,0,0,0.06);
  --shadow-header: 0 2px 20px rgba(0,0,0,0.08);

  /* Transitions */
  --transition:    0.3s ease;
}

/* ============================================================
   01: BASE
   ============================================================ */
body {
  font-family: var(--font-suit);
  color: var(--color-dark);
  background: var(--color-white);
  overflow-x: hidden;
}

.inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--section-px);
}

.container-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--section-px);
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px 6px 9px;
  align-items: center;
  gap: 6px;
  border-radius: 100px;
  font-family: var(--font-suit);
  font-weight: 700;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

/* ============================================================
   02: HEADER
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition), transform 0.3s ease;
}

.header.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-header);
}

/* 어두운 히어로 배경 페이지 — 스크롤 전(투명 상태)에서 헤더 텍스트/아이콘 흰색 처리 */
.page-dark-hero .header:not(.scrolled):not(.show) .header__nav-link {
  color: rgba(255, 255, 255, 0.90);
}

.page-dark-hero .header:not(.scrolled):not(.show) .header__nav-link:hover {
  color: #ffffff;
}

.page-dark-hero .header:not(.scrolled):not(.show) .header__logo img {
  content: url('../common/logos/logo-ubique-white.png');
}

.page-dark-hero .header:not(.scrolled):not(.show) .header__menu-btn span {
  background: #ffffff;
}

/* 스크롤 방향에 따른 헤더 숨김/표시 */
.header.hide {
  transform: translateY(-100%);
}

.header.show {
  transform: translateY(0);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-header);
}

.header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header__logo img {
  height: 42px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 50px;
}

.header__nav-link {
  font-family: var(--font-suit);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-dark);
  white-space: nowrap;
  transition: color var(--transition);
  padding: 4px 0;
}

.header__nav-link:hover {
  color: var(--color-primary);
}

.header__cta {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f65cb4;
  color: var(--color-white);
  padding: 10px 26px 11px;
  border-radius: var(--radius-btn);
  font-family: var(--font-suit);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--transition), transform var(--transition);
}

.header__cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.header__cta img {
  width: 16px;
  height: 16px;
}

/* ── 햄버거 버튼 (데스크탑에서 숨김) ── */
.header__menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.header__menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header__menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.header__menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── 모바일 nav 드로어 (데스크탑에서 숨김) ── */
.header__mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 var(--section-px) 28px;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s;
  z-index: 999;
}

.header__mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s;
}

.header__mobile-link {
  font-family: var(--font-suit);
  font-size: 17px;
  font-weight: 500;
  color: var(--color-dark);
  padding: 17px 0;
  border-bottom: 1px solid var(--color-border);
  display: block;
  transition: color var(--transition);
}

.header__mobile-link:hover {
  color: var(--color-primary);
}

/* ============================================================
   03: CTA SECTION — 서브페이지 공통 문의 CTA (정부지원사업 GP-08 디자인, components/cta.html)
   ============================================================ */
.sub-cta { padding: 110px 0; background: #1b60d2 url('../common/images/sub-cta-bg.png') center / cover no-repeat; color: #fff; font-family: var(--font-base); word-break: keep-all; }
.sub-cta__inner { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: calc(1640px + var(--section-px) * 2); margin: 0 auto; padding: 0 var(--section-px); text-align: center; }
.sub-cta__title { margin: 0; font-size: clamp(24px, 2.5vw, 48px); font-weight: 500; line-height: 1.4; letter-spacing: -0.06em; color: #fff; }
.sub-cta__title strong { font-weight: 700; }
.sub-cta__btn { display: flex; align-items: center; justify-content: space-between; width: min(420px, 100%); margin-top: 60px; padding: 20px 32px 20px 36px; border-radius: 18px; background: #ff6087; font-size: clamp(20px, 1.35vw, 26px); font-weight: 600; line-height: 1.4; letter-spacing: -0.4px; color: #fff; text-decoration: none; transition: background-color .2s; }
.sub-cta__btn span:last-child { font-family: var(--font-base); font-weight: 500; }
.sub-cta__btn:hover { background: #ed4c78; }
.sub-cta__contact { margin-top: 80px; }
.sub-cta__lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 30px; margin: 0; font: 400 clamp(17px, 1.25vw, 24px)/1.4 var(--font-base); letter-spacing: -0.4px; }
.sub-cta__lines > span { display: inline-flex; align-items: center; gap: 8px; }
.sub-cta__lines img { display: block; width: 28px; height: 28px; }
.sub-cta__lines b { font-weight: 600; }
.sub-cta__lines a { color: inherit; text-decoration: none; }
.sub-cta__hours { margin: 8px 0 0; font-size: clamp(13px, .83vw, 16px); font-weight: 500; line-height: 1.7; color: rgba(255,255,255,.82); }
@media (max-width: 768px) {
  .sub-cta { padding: 72px 0; }
  .sub-cta__title br { display: none; }
  .sub-cta__btn { margin-top: 36px; padding: 16px 24px; }
  .sub-cta__contact { margin-top: 44px; }
  .sub-cta__lines { flex-direction: column; align-items: center; }
  .sub-cta__lines img { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .sub-cta__btn { transition: none; }
}

/* ============================================================
   04: FOOTER
   ============================================================ */
.footer {
  background: var(--color-footer-bg);
  padding: 50px var(--section-px);
}

.footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

.footer__logo img {
  height: 44px;
  width: auto;
}

.footer__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer__info-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__info-row {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 16px;
  color: var(--color-white);
  line-height: 1.5;
  white-space: nowrap;
}

.footer__info-row strong {
  font-weight: 700;
}

.footer__info-row span {
  font-weight: 400;
}

.footer__divider {
  width: 0;
  height: 14px;
  border-left: 1px solid rgba(255,255,255,0.3);
}

.footer__address {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 16px;
  color: var(--color-white);
  line-height: 1.5;
  max-width: 880px;
}

.footer__address-item {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.footer__address-item strong {
  font-weight: 700;
}

.footer__address-item span {
  font-weight: 400;
}

.footer__copyright {
  font-family: var(--font-suit);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}

.footer__right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  align-self: stretch;
  min-height: 200px;
}

.footer__support-title {
  font-family: var(--font-suit);
  font-size: 18px;
  font-weight: 600;
  color: rgba(201,181,255,0.8);
  line-height: 1.5;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-end;
}

.footer__contact-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.footer__phone {
  font-family: var(--font-suit);
  font-size: 40px;
  font-weight: 800;
  color: #c9b5ff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.footer__email {
  font-family: var(--font-suit);
  font-size: 22px;
  font-weight: 700;
  color: #c9b5ff;
  line-height: 1.5;
}

.footer__hours {
  font-family: var(--font-suit);
  font-size: 16px;
  font-weight: 700;
  color: rgba(147,130,195,0.8);
  line-height: 1.5;
  text-align: right;
}

/* ============================================================
   05: BACK TO TOP
   ============================================================ */
.btn-top {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(40px, env(safe-area-inset-bottom));
  width: 69px;
  height: 69px;
  border-radius: var(--radius-btn);
  background: var(--color-white);
  border: 1.24px solid rgba(232,232,232,0.5);
  box-shadow: 0 2.48px 17.33px rgba(227,227,227,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition), opacity var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

.btn-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.btn-top:hover {
  background: #eef1f7;
}

.btn-top img {
  width: 36px;
  height: 36px;
}

/* ============================================================
   RESPONSIVE — 공통 컴포넌트
   ============================================================ */
@media (max-width: 1280px) {
  :root {
    --section-px: 80px;
  }
}

@media (max-width: 1024px) {
  :root {
    --section-px: 48px;
  }

  .header__nav {
    gap: 30px;
  }

  .header__nav-link {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-px: 24px;
  }

  /* ── Header ── */
  .header {
    height: 64px;
  }

  .header__nav,
  .header__cta {
    display: none;
  }

  .header__menu-btn {
    display: flex;
  }

  .header__mobile-nav {
    display: flex;
    visibility: hidden;
    top: 64px;
  }

  /* ── Footer ── */
  .footer__inner {
    flex-direction: column;
  }

  .footer__right {
    align-items: flex-start;
    min-height: auto;
    gap: 16px;
    width: 100%;
  }

  .footer__contact {
    align-items: flex-start;
  }

  .footer__contact-info {
    align-items: flex-start;
  }

  .footer__phone {
    font-size: 28px;
  }

  .footer__email {
    font-size: 18px;
  }

  .footer__hours {
    text-align: left;
  }

  /* ── Back to Top ── */
  .btn-top {
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .btn-top img {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .footer__address-item {
    white-space: normal;
  }

  .footer__phone {
    font-size: 24px;
  }
}

/* 서브페이지 헤더 좌우 여백 — 1920px 미만에서 로고·메뉴가 화면 끝에 붙던 문제 보완 */
.header__inner{max-width:calc(var(--content-max) + var(--section-px) * 2);padding-left:var(--section-px);padding-right:var(--section-px)}

/* 서브페이지 헤더 문의하기 버튼 — 메인 헤더와 같은 디자인 */
.header__cta{display:inline-flex;align-items:center;justify-content:center;flex:none;gap:0;min-height:48px;padding:12px 28px;border-radius:999px;background:#ff6087;color:#fff;font-family:'Pretendard','Noto Sans KR',sans-serif;font-size:16px;font-weight:600;line-height:1.5;white-space:nowrap;transition:background-color .2s}
.header__cta:hover{opacity:1;transform:none;box-shadow:none;background:#ed4c78}
.header__cta img{display:none}
@media (max-width: 1100px){.header__cta{min-height:44px;padding:10px 22px;font-size:14px}}
@media (max-width: 768px){.header__cta{display:inline-flex;margin-left:auto;margin-right:16px}}
@media (max-width: 390px){.header__cta{padding:10px 16px;margin-right:12px}}
@media (max-width: 360px){.header__logo img{height:34px}}

/* 서브페이지 헤더 메뉴 5개(Government Programs 추가) — 1600px 이하 글자·간격 축소, 1350px 이하는 햄버거 메뉴(1281~1340px는 좌우 여백 160px라 5개 메뉴가 들어가지 않음) */
@media (max-width: 1600px){.header__nav{gap:36px}.header__nav-link{font-size:16px}}
@media (max-width: 1440px){.header__nav{gap:28px}}
@media (min-width: 769px) and (max-width: 1350px){.header__nav{display:none}.header__menu-btn{display:flex}.header__mobile-nav{display:flex;visibility:hidden}.header__cta{margin-left:auto;margin-right:20px}}
