@import "../../style/CommonStyle.module.less";
@import "../../style/utils.module.less";

@COLOR_GREEN: #207847;
@COLOR_RED: #c91d53;
@COLOR_GRAY: #807f81;
@COLOR_GRAY02: #cfcfcf;
@COLOR_GRAY03: #57585a;
@COLOR_GRAY04: #c5c6c9;
@COLOR_GRAY05: #f8f8f8;
@COLOR_GRAY06: #57585a;

.panel {
  > section {
    color: @COLOR_GRAY06;
  }
}

.introLayout {
  width: 100%;
  height: 100%;
  padding-top: 45.5px;
  padding-bottom: 45.5px;
  padding-left: 43px;
  padding-right: 43px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  display: inline-flex;
  background-color: @BG_COLOR_03;

  // 첫 번째 영역: 헤더 섹션 (타이틀 + 설명)
  .headerSection {
    width: 1834px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
    display: flex;

    .titleContainer {
      align-self: stretch;
      justify-content: center;
      align-items: center;
      gap: 14px;
      display: inline-flex;

      .welcomeText {
        color: #807f81;
        font-size: 62px;
        font-family: "LG Smart UI";
        font-weight: 400;
        line-height: 62px;
        word-wrap: break-word;
      }

      .brandContainer {
        .shopText {
          color: #57585a;
          font-size: 70px;
          font-family: "LG Smart_Korean";
          font-weight: 700;
          line-height: 75px;
          word-wrap: break-word;
        }

        .oText {
          color: #c91d53;
          font-size: 70px;
          font-family: "LG Smart_Korean";
          font-weight: 700;
          line-height: 75px;
          word-wrap: break-word;
        }

        .timeText {
          color: #57585a;
          font-size: 70px;
          font-family: "LG Smart_Korean";
          font-weight: 700;
          line-height: 75px;
          word-wrap: break-word;
        }
      }
    }

    .descriptionContainer {
      align-self: stretch;
      justify-content: center;
      align-items: center;
      gap: 10px;
      display: inline-flex;

      .descriptionText {
        width: 1012.49px;
        text-align: center;
        color: #807f81;
        font-size: 36px;
        font-family: "LG Smart UI";
        font-weight: 400;
        line-height: 43px;
        word-wrap: break-word;
      }
    }
  }

  // 두 번째 영역: 약관 선택 섹션
  .termsSection {
    align-self: stretch;
    justify-content: center;
    align-items: flex-start;
    display: inline-flex;

    .termsLeftPanel {
      flex: 1 1 0;
      padding-left: 60px;
      padding-right: 60px;
      flex-direction: column;
      justify-content: center;
      align-items: flex-end;
      // gap: 20px;
      display: inline-flex;

      .termsItem {
        justify-content: flex-start;
        align-items: center;
        // gap: 20px;
        display: inline-flex;
        .checkbox {
          /* TCheckBoxSquare 컴포넌트가 스타일링을 담당 */
          width: 45px;
          height: 45px;
          // margin-right: 40px;
        }

        .termsButton {
          width: 530px;
          height: 120px;
          padding: 0 50px;
          background: @COLOR_WHITE;
          box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.2);
          border-radius: 6px;
          border: 1px solid #cfcfcf;
          justify-content: space-between;
          align-items: center;
          display: flex;
          cursor: pointer;
          transition: all 0.3s ease;
          // will-change: transform;
          margin-bottom: 20px;
          margin-left: 30px;

          .termsText {
            color: black;
            font-size: 35px;
            font-family: "LG Smart UI";
            font-weight: 700;
            line-height: 35px;
            word-wrap: break-word;
            transition: color 0.3s ease;

            &.required {
              color: @COLOR_GREEN;
            }
          }

          // ✅ 포커스 및 호버 상태 (통합)
          &.focused,
          &:focus,
          // &:focus-visible,
          &:hover {
            outline: 4px #c91d53 solid !important;
            transform: translateY(-2px) !important;
            .termsText {
              font-weight: bold !important;
            }
          }
        }
      }
    }
    .termsRightPanel {
      flex: 1 1 0;
      align-self: stretch;
      padding-left: 60px;
      padding-right: 60px;
      border-left: 1px #c5c6c9 solid;
      justify-content: center;
      align-items: flex-start;
      display: flex;
      flex-direction: column;
    }
  }

  // 세 번째 영역: Select All
  .selectAllSection {
    justify-content: center;
    align-items: center;
    // gap: 15px;
    display: inline-flex;
    .selectAllCheckbox {
      /* TCheckBoxSquare 컴포넌트가 스타일링을 담당 */
      width: 45px;
      height: 45px;
    }

    .selectAllText {
      color: @COLOR_BLACK;
      font-size: 35px;
      font-family: "LG Smart UI";
      font-weight: 700;
      line-height: 40px;
      word-wrap: break-word;
      margin-left: 15px;
    }
  }

  // 네 번째 영역: 버튼 섹션
  .buttonSection {
    width: 940px;
    height: 100px;
    position: relative;
    display: flex;
    gap: 40px;
    justify-content: center;

    .agreeButton,
    .disagreeButton {
      width: 450px;
      height: 100px;
      margin: 0 20px;
      font-size: 30px;
      border-radius: 10px;
      box-sizing: border-box;
      line-height: normal;
      background-color: #999999;
      color: @COLOR_WHITE;
      box-shadow: 0 5px 5px #003 0 6px 7px #0000001a;
      .flex();

      &:focus,
      &:hover {
        background-color: @PRIMARY_COLOR_RED;
        color: @COLOR_WHITE;
        box-shadow: 0px 18px 28.2px 1.8px rgba(0, 0, 0, 0.4);
      }
    }

    // Agree 버튼이 disabled 상태일 때 포커스/호버 스타일 오버라이드
    .agreeButton.disabled {
      &:focus,
      &:hover {
        background-color: rgba(201, 29, 83, 0.3) !important;
        color: @COLOR_WHITE !important;
        box-shadow: 0 5px 5px #003 0 6px 7px #0000001a !important;
      }
    }
  }
}

/* intro terms popup */
.introTermsConts {
  background-color: #f8f8f8;

  > div:nth-child(2) {
    background-color: @COLOR_WHITE;
    border: 1px solid @COLOR_GRAY02;
    width: 980px;
    height: 300px;
  }

  .termsDesc {
    padding: 30px;
    min-height: 300px;
    color: @COLOR_GRAY03;
    font-size: 24px;
    line-height: 1.27;
    letter-spacing: normal;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .tab {
    width: 980px;
  }
}

// ✅ 로컬 체크박스 스타일 (전체 교체)
.customCheckbox {
  width: 45px;
  height: 45px;
  position: relative;

  // 기본 상자 스타일
  &:before {
    content: "";
    width: 42px;
    height: 42px;
    background-color: @COLOR_WHITE;
    border: 2px solid @COLOR_GRAY02;
    border-radius: 4px;
    display: block;
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease,
      box-shadow 0.2s ease;
  }

  // ✅ 선택된 상태: 배경색과 테두리 모두 붉은색 + 굵은 테두리
  &.selected:before {
    background-color: #c91d53 !important;
    border: 4px solid #c91d53 !important; // 굵은 테두리로 변경
  }

  // 포커스 받았지만 선택 안됨
  &.focused:not(.selected):before {
    background-color: rgba(201, 29, 83, 0.1);
    border: 4px solid #c91d53 !important;
  }

  // 비활성화됨
  &.disabled:before {
    background-color: @COLOR_GRAY01;
    border-color: @COLOR_GRAY02;
    opacity: 0.5;
  }

  // 포커스 받음 (선택된 상태가 아닌 경우에만 적용)
  &.focused:not(.selected):before {
    border: 4px solid #c91d53 !important;
  }

  // 체크마크
  &.selected:after {
    content: "✓";
    color: @COLOR_WHITE;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

// ✅ [추가] 필수 약관 안내 패널 스타일
.requiredInfoPanel {
  width: 100%;
}

.infoText {
  color: @COLOR_GRAY;
  font-size: 28px;
  line-height: 1.4;
}

.warningContainer {
  margin-top: 20px;
}

.warningText {
  color: @COLOR_RED;
  font-size: 28px;
  line-height: 1.4;
  font-weight: bold;
}

.optionalDescription {
  width: 595px;
  color: #807f81;
  font-size: 26px;
  font-family: "LG Smart UI";
  font-weight: 400;
  line-height: 43px;
  word-wrap: break-word;
}

.termsButton {
  margin-left: 10px;
}

.debugInfo {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 18px;
  font-weight: bold;
  z-index: 999;
  border-radius: 8px;
  opacity: 0.8;
  text-align: right;
  line-height: 1.4;
  pointer-events: none; /* Make it non-interactive */
}
