/* ---- 색상 변수 ---- */
:root {
  --bg-primary: #5c7180;
  --bg-secondary: #3f5866;
  --blue: #003b9b;
  --gray: #adb5bd;
  --white: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  background: url("../images/main.jpg") center/cover no-repeat,
    var(--bg-primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  /*overflow: hidden;*/
}

/* 오버레이 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: -1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- 헤더 ---- */
header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
}

.login-link {
  font-size: 0.9rem;
}

/* ---- 메인 ---- */
main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 104px);
  padding: 0;
}

/* ---- 메세지 버튼 ---- */
.message-icon {
  position: fixed; /* 전체 화면 기준으로 위치 */
  top: 80px; /* 헤더 아래로 약간 내림 */
  right: 20px;
  width: 60px;
  height: 60px;
  z-index: 1100;
  cursor: pointer;
  object-fit: contain;
  display: none;
}

.fab-container {
  position: fixed;
  bottom: 95px;
  right: 30px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 메인 + 버튼 */
.fab-main-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); /* 반투명 흰색 */
  backdrop-filter: blur(10px); /* 유리처럼 흐림 효과 */
  -webkit-backdrop-filter: blur(10px); /* Safari 지원용 */
  color: #ffffff; /* 아이콘 색상 */
  font-size: 32px;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.25); /* 테두리 살짝 */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* 부드러운 그림자 */
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fab-main-btn.open {
  transform: rotate(45deg);
}

/* 펼쳐지는 버튼 그룹 */
.fab-actions {
  display: none;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  align-items: center;
}

.fab-actions.show {
  display: flex;
}

/* 아이콘 버튼 */
.floating-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  position: relative;
  transition: background 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.floating-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 아이콘 이미지 */
.floating-btn img {
  width: 50px;
  height: 50px;
}

/* 버튼 라벨 */
.floating-btn span {
  position: absolute;
  bottom: -24px;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.floating-btn:hover span {
  opacity: 1;
  bottom: -20px;
}

/* ---- 카드 박스 ---- */
.card {
  background: transparent;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 1200px;
  overflow: hidden;
  padding: clamp(1rem, 4vw, 2.5rem) 2rem; /* ← 수정 */
  text-align: center;
}

.card h2 {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  margin-bottom: 3rem;
}

.main-title {
  text-align: center;
  font-weight: 800 !important;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 2rem;
}

/* ---- 버튼 스타일 ---- */
.dw-btn {
  min-width: 260px;
  height: clamp(110px, 22vh, 200px); /* ← 수정 */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--blue);
  border-radius: 0.75rem;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: rgba(0, 59, 155, 0.2);
  color: var(--white);
  transition: background 0.25s, color 0.25s;
}

.dw-btn:hover {
  background: var(--blue);
  color: var(--white);
}

/* 비활성 버튼 */
.btn-outline-light.dw-btn {
  background: rgba(173, 181, 189, 0.18);
  border-color: var(--gray);
  color: var(--gray);
}

.btn-outline-light.dw-btn:hover {
  background: rgba(128, 128, 128, 0.55);
  border-color: transparent;
  color: var(--white);
}

.btn-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}

/* ---- 플로우 ---- */
.flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.flow-step {
  position: relative; /* 화살표 절대 배치 기준 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-right: 2.5rem; /* → 화살표 들어올 공간 */
}

.flow-step::after {
  content: "➔"; /* 원하면 \f138(아이콘) 등으로 교체 */
  position: absolute;
  top: 50%;
  right: 0; /* step 오른쪽 끝 */
  transform: translateY(-50%);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
}

.flow-step:last-child::after {
  display: none;
}

.flow-step .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.flow-step small {
  font-size: 1.5rem;
  color: #ffffff;
}

#bottomArea {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  flex-shrink: 0; /* 줄어들지 않음 */
  background: #24435a;
  color: #fff;
  text-align: center;
  padding: 15px 0; /* 높이 조절 */
  font-size: 12px;
}

.welcome-text {
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: 0.05em;
}

.main-title br {
  display: block;
  margin-top: 0.5rem;
}

.main-title .sub-text {
  font-size: 3rem;
  display: block;
  margin-top: 0.5rem;
}

.company-name {
  font-size: 5rem;
  font-weight: 780;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.flow-icon {
  width: 80px;
  height: 80px;
  background-image: url("../images/date.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.commit-icon {
  width: 80px;
  height: 80px;
  background-image: url("../images/commit.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.check-icon {
  width: 80px;
  height: 80px;
  background-image: url("../images/check.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.visit-icon {
  width: 80px;
  height: 80px;
  background-image: url("../images/visit.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.modal-content {
  color: #212529; /* 부트스트랩 기본 텍스트 색 */
}

.terms-box {
  max-height: 360px;
  overflow-y: auto;
}

.logo {
  display: inline-block;
  width: 250px;
  height: 48px;
  background: url("../images/dongwon.png") center/contain no-repeat;
}

.foot {
  font-size: 1rem;
}

/* ---- 모바일 대응 ---- */
@media (max-width: 740px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  main {
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
  }
  /* 실제 화면 높이에 따라 적응하는 버튼 */
  .dw-btn {
    min-width: 100%;
    height: calc(var(--vh, 1vh) * 13); /* 약 100px (100 / 7.7) 비율 */
  }

  .flow {
    gap: 1rem;
  }

  .flow-step::after {
    display: none;
  }

  /* 타이틀 여백도 vh 기준으로 조정 */
  .main-title {
    font-size: 1rem;
    margin-top: calc(var(--vh, 1vh) * 3.5);
  }

  .welcome-text {
    font-size: 0.9rem;
  }

  .main-title .company-name .sub-text {
    font-size: 1.5rem;
  }

  /* 아이콘 위치도 vh 기준으로 조정 */
  .message-icon {
    top: calc(var(--vh, 1vh) * 11); /* 대략 110px */
    right: 10px;
    width: 60px;
    height: 60px;
    z-index: 1100;
  }
}

/* ---- 모바일 대응 ---- */
@media (max-width: 600px) {
  /* 버튼 높이 고정 대신 뷰포트 기준으로 */
  .dw-btn {
    min-width: 100%;
    height: calc(var(--vh, 1vh) * 13); /* 대략 100px */
  }

  .flow {
    gap: 1rem;
  }

  .flow-step::after {
    display: none;
  }

  /* 폰트 크기는 그대로 두되, 위치 여백은 --vh로 설정 가능 */
  .main-title {
    font-size: 1rem;
    margin-top: calc(var(--vh, 1vh) * 4.5); /* 필요 시 여백 추가 가능 */
  }

  .welcome-text {
    font-size: 0.9rem;
  }

  .main-title .company-name .sub-text {
    font-size: 1.5rem;
  }
  .logo {
    background-image: url("../images/mobiledongwon.png");
    width: 200px; /* 필요 시 폭·높이 조정 */
    height: 80px !important;
  }
}

/* ---- 초소형 모바일 대응: max-width 375px ---- */
@media (max-width: 375px) {
  .main-title {
    font-size: 1rem;
    margin-top: calc(var(--vh, 1vh) * 4); /* 약 4vh */
  }

  .welcome-text {
    font-size: 0.85rem;
  }

  .main-title .company-name {
    font-size: 2.5rem;
  }

  .main-title .company-name .sub-text {
    font-size: 1.2rem;
  }

  .message-icon {
    top: calc(var(--vh, 1vh) * 8); /* 80px 대체 */
    right: 8px;
    width: 50px;
    height: 50px;
  }

  .dw-btn {
    min-width: 100%;
    height: calc(var(--vh, 1vh) * 11.5); /* 약 90px */
  }

  .flow-icon,
  .commit-icon,
  .check-icon,
  .visit-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .flow-step small {
    font-size: 0.75rem;
  }

  .foot {
    font-size: 0.65rem;
  }
}

/* ---- 세로 길이 900px 이상 기기 대응 (예: 아이폰 Pro Max, 갤럭시 Ultra 계열) ---- */
@media (min-height: 900px) and (max-width: 440px) and (orientation: portrait) {
  .message-icon {
    top: calc(var(--vh, 1vh) * 9); /* 약 90px */
    right: 10px;
    width: 70px;
    height: 70px;
  }

  .main-title {
    font-size: 1rem;
    margin-top: calc(var(--vh, 1vh) * 6); /* 약 6rem */
  }

  .flow-step {
    margin-top: calc(var(--vh, 1vh) * 3); /* 약 3rem */
  }

  .bottom-area {
    margin-top: calc(var(--vh, 1vh) * 2); /* 약 2rem */
  }
}

/* ---- 반응형: 세로 비율 화면용 이미지 처리 ---- */
@media (max-aspect-ratio: 3/4) {
  body {
    background:
      /* ① 아래로 갈수록 bg-primary 로 자연스럽게 잇기 */ linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 60%,
        /* 투명 → */ var(--bg-primary) 100% /* → 딥 블루-그레이 */
      ),
      /* ② 원본 이미지: 가로폭에 맞추고 전체 보여주기 */
        url("../images/Mobilemain.png") top center/contain no-repeat,
      /* ③ 폴백 색상 */ var(--bg-primary);
  }
}

/* ---- 태블릿 세로 방향 대응 ---- */
@media (min-width: 740px) and (max-width: 1024px) and (orientation: portrait) {
  body {
    background-position: top center;
    background-size: contain;
  }
}

@media (max-height: 740px) {
  main {
    align-items: flex-start;
  }
}

@media (max-width: 740px) {
  /* 실제 뷰포트 높이에 따라 main 영역 높이 설정 */
  main {
    height: calc(var(--vh, 1vh) * 100);
    align-items: normal;
  }
  .card {
    padding: 1rem 2rem;
    /* 필요 시 높이 적용: 예) min-height: calc(var(--vh, 1vh) * 60); */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, #181819 100%),
      url("../images/Mobilemain.png") top center/contain no-repeat, #181819;
  }

  .flow {
    flex-wrap: wrap;
    row-gap: 2rem;
    column-gap: 1.5rem;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
  }

  .flow-step .flow-icon {
    width: 56px;
    height: 56px;
  }

  .flow-step::after {
    display: none;
  }

  .flow-icon,
  .commit-icon,
  .check-icon,
  .visit-icon {
    width: 48px !important;
    height: 48px !important;
    background-size: contain !important;
  }

  .flow-step small {
    font-size: 0.9rem;
  }

  .company-name {
    font-size: 3rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 0.3rem;
  }

  .main-title .sub-text {
    font-size: 1.5rem;
    font-weight: 800;
  }

  .flow-step {
    padding-right: 0rem;
  }

  /* 버튼 섹션 여백을 vh 기준으로 보정 */
  .btn-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 0 0 calc(var(--vh, 1vh) * 0.7); /* 아래 여백만 최소 유지 */
  }

  .btn-section a.dw-btn {
    margin-top: calc(var(--vh, 1vh) * -0.7); /* 버튼만 살짝 위로 */
  }

  .flow {
    margin-top: calc(
      var(--vh, 1vh) * 0.5
    ); /* 위쪽 간격 줄여서 더 위로 붙이기 */
  }

  .foot {
    font-size: 0.7rem;
  }
  .fab-container {
    bottom: calc(var(--vh, 1vh) * 11); /* footer 위로 띄움 */
    right: 10px;
    z-index: 1200;
  }

  .fab-main-btn {
    width: 56px;
    height: 56px;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
  }

  .fab-actions {
    gap: 12px;
    margin-bottom: 12px;
  }

  .floating-btn {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.05);
  }

  .floating-btn img {
    width: 40px;
    height: 40px;
  }
}

@media (max-aspect-ratio: 3/4) {
  body {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 60%,
        var(--bg-primary) 100%
      ),
      url("../images/Mobilemain.png") top center/contain no-repeat,
      var(--bg-primary);
  }
}
