:root {
    --primary-color: #006EB4;
    --danger-color: #CD3C4B;
    --text-color: #4C4C4C;
    --text-light-color: #888B91;
    --background-color: #F2F2F2;
    --white-color: #fff;
    --border-color: #E0E0E0;
    --light-gray-bg: #F7F7F7;
    --light-sky-bg: #F1F6FA;
    --dark-gray: #192D41;
    --gray-btn-bg: #D7D7DC;
    --dimmed-bg: rgba(0, 0, 0, 0.55);
}

* {
    /*/ 탭 하이라이트 색상 투명 처리 /*/
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-text-size-adjust: 100%;
    text-decoration: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--white-color);
    color: var(--text-color);
}

body {
    margin: 0;
    background-color: var(--white-color);
    color: var(--text-color);
    /*/ iOS 글자 크기 자동 조절 방지 /*/
    -webkit-text-size-adjust: 100%;
    /*/ 오버스크롤 바운스 효과 제거 /*/
    overscroll-behavior: none;
    min-height: 100vh; /* fallback */
    min-height: 100dvh; /* modern browsers */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
}

body.bg-gray {
    background-color: var(--light-gray-bg);
}

/* 각 섹션의 배경색을 화면 전체 너비에 적용하기 위한 기본 스타일 */
header {
    background-color: var(--white-color);
    border-bottom: 1px solid var(--border-color);
}

main {
    flex-grow: 1;
    background-color: var(--white-color); /* main 영역의 배경색 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}


        footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 20px 24px 40px; background: #fff; }
        .btn-primary-bold { 
            display: flex; align-items: center; justify-content: center;
            width: 100%; height: 60px; background: #0076be; color: #fff; 
            border: none; border-radius: 12px; font-size: 17px; font-weight: 700; 
            box-shadow: 0 8px 16px rgba(0, 118, 190, 0.2); cursor: pointer;
        }

/* 콘텐츠의 최대 너비와 가운데 정렬을 위한 컨테이너 */
.page-container {
    width: 100%;
    /* max-width: 600px; */ /* 제거 */
    margin: 0 auto;
    box-sizing: border-box; /* 패딩이 너비에 포함되도록 설정 */
    padding: 0 16px;
}

footer > .page-container {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 30%, rgba(255, 255, 255, 1) 100%);
}

footer > .page-container > .page_box {
    padding: 16px 0 0 0;
    background: #ffffff;
    border-radius: 20px;
    /*box-shadow: 2px 2px 6px rgba(100,100,100,0.25);*/
}

.footer_inner_box {
    padding: 20px 20px 0 20px;
    font-size: 14px;
}

.footer_inner_box .logo-text {
    font-weight: 500;
}

/* 헤더 내부 타이틀 */
.header-content {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    display: block;
    color: #191919;
    font-size: 18px;
    font-weight: 700;
    padding: 20px;
    text-align: center;
}

/* 채팅 말풍선 섹션 */
.chat-bubble-container {
    position: relative;
    padding: 32px 20px;
    background: var(--primary-color);
    border-radius: 0 40px 40px 40px;
    margin-top: 40px;
}

.chat-title {
    color: var(--white-color);
    font-size: 20px;
    font-weight: 700;
    word-break: keep-all;
}

.chat-message {
    color: var(--white-color);
    font-size: 14px;
    font-weight: 400;
    word-break: keep-all;
}

/* 주요 정보 텍스트 */
.main-text {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 700;
    margin-top: 40px;
    text-align: center;
}

/* 정보 카드 섹션 */
.info-card {
    padding: 20px;
    background: var(--light-gray-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.info-icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

.info-icon-wrapper img {
    height: 24px;
}

.info-text-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    background: var(--light-gray-bg);
    border-radius: 16px;
}

.info-title {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 700;
}

.info-description {
    color: var(--text-light-color);
    font-size: 16px;
    font-weight: 400;
}

/* 버튼 스타일 통합 */
.button {
    padding: 16px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
}

.button-primary {
    background: var(--primary-color);
}

.button-secondary {
    background: transparent;
}

.button-text {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 16px;
}

.button-primary.button-text {
    color: var(--white-color);
}

.button-secondary.button-text {
    color: var(--text-light-color) !important;
    font-size: 14px;
    font-weight: 400;
}

/* 폼 섹션 */
.form-section {
    padding: 40px 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.form-title {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 700;
}

.step-icon {
    width: 20px;
    height: 20px;
    background-color: var(--white-color);
}

/* 입력 필드 그룹 */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-field {
    position: relative;
    padding: 0;
    background: var(--light-gray-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
}

/* 실제 체크박스 요소를 숨깁니다. */
.agreement-section input[type="checkbox"] {
    display: none; /* 또는 opacity: 0; */
}

/* 모든 체크박스 라벨에 기본 체크박스 모양을 만듭니다. */
.agreement-section input[type="checkbox"] + label {
    position: relative;
    padding-left: 30px; /* 가상 요소가 들어갈 공간을 만듭니다. */
    cursor: pointer;
}

/* 체크박스의 '체크되지 않은' 상태를 만듭니다. */
.agreement-section input[type="checkbox"] + label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('../img/ic_Check_gr_gr.svg'); /* 체크되지 않은 이미지 경로 */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 체크박스의 '체크된' 상태를 만듭니다. */
.agreement-section input[type="checkbox"]:checked + label::before {
    background-image: url('../img/ic_Check_bl_gr.svg'); /* 체크된 이미지 경로 */
}

.agreement-section .all-agree-box input[type="checkbox"]:checked + label::before {
    background-image: url('../img/ic_Check_bl_wh.svg'); /* 체크된 이미지 경로 */
}

.agreement-section input[type="checkbox"]:checked + label {
    color: var(--text-color);
    font-weight: 400;
}

.input-field-row {
    display: flex;
    gap: 8px;
}

.input-field-row > * {
    flex: 1 1 0;
    min-width: 0;
}

/* input, select: 통일 스타일 */
.input-field-row input[type="text"],
.input-field-row select {
    width: 100%;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--white-color);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    box-sizing: border-box;
    outline: none;
    appearance: none;
}

.input-field-row input[type="text"]::placeholder {
    color: var(--text-light-color);
}

/* select: 우측 화살표 없애기 or 맞춤 적용 가능(통일감 위해) */
.input-field-row select {
    background-image: none;
}

/* ======== 두번째 줄: 성별(gender-buttons) ======== */
.gender-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

.gender-buttons label {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #F7F7F7;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    box-sizing: border-box;
    transition: border 0.18s, color 0.18s, background 0.18s;
}

.gender-buttons input[type="radio"] {
    /* display: none; 대신 접근성을 고려한 숨김 처리 */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

/* 선택 효과: label > input[type="radio"]:checked + span */
.gender-buttons input[type="radio"]:checked + span {
    background: #FFFFFF;
    border-radius: 16px;
    color: var(--text-color);
    font-weight: 700;
}

.gender-buttons label span {
    width: 100%;
    padding: 20px;
    text-align: center;
    display: block;
    font-size: 1rem;
    font-weight: 500;
}

.input-field input {
    flex: 1;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: var(--light-gray-bg);
    font-size: 1rem;
    font-weight: 500;
}

.input-field input::placeholder {
    color: var(--text-light-color);
}

.input-field select {
    flex: 1;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid transparent;
    color: var(--text-light-color);
    background: var(--light-gray-bg);
    background-image: url('../img/ic_caretdown.svg');
    background-repeat: no-repeat;
    background-position: right 20px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 1rem;
    font-weight: 500;
}

/* Autofill 배경색 변경 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 32px #F7F7F7 inset !important;
    box-shadow: 0 0 0 32px #F7F7F7 inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

input.is-focused,
select.is-focused {
    outline: none;
    border: 1px solid #006EB4 !important;
    box-shadow: 0 0 0 1px #006EB4;
    color: var(--text-color);
    background: #F7F7F7;
}

select.is-focused {
    background-image: url('../img/ic_caretdown.svg');
    background-repeat: no-repeat;
    background-position: right 20px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input.is-filled,
select.is-filled {
    width: 100%;
    border: 1px solid #E0E0E0;
    background: #F7F7F7;
    font-weight: bold;
    color: var(--text-light-color);
}

select.is-filled {
    background-image: url('../img/ic_caretdown.svg');
    background-repeat: no-repeat;
    background-position: right 20px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.gender-buttons label.is-focused {
    border: 1px solid #006EB4 !important;
    box-shadow: 0 0 0 1px #006EB4;
    background: var(--white-color);
}

/* 기본 라디오 버튼을 숨깁니다. 기능은 유지됩니다. */
input[type="radio"] {
    /* display: none; 대신 접근성을 고려한 숨김 처리 */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

/* 라벨에 커스텀 라디오 버튼 스타일을 적용하기 위한 기본 설정입니다. */
input[type="radio"] + label {
    position: relative;
    color: var(--text-light-color);
    font-size: 14px;
    cursor: pointer;
}

/* 버튼 및 기타 UI */
.action-button-group {
    flex: 1;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-button {
    position: absolute;
    right: 12px;
    top: calc(50% - 16.5px);
    min-width: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--white-color);
    background-color: var(--dark-gray);
    cursor: pointer;
}

.action-button.disabled {
    background-color: var(--gray-btn-bg);
    color: var(--text-color);
    cursor: pointer;
}

/* 동의 체크박스 섹션 */
.agreement-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

.agreement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.all-agree-box {
    padding: 18px;
    background: var(--light-gray-bg);
    border-radius: 16px;
    cursor: pointer;
}

.all-agree-box.is-selected {
    border: 2px solid var(--primary-color) !important;
    background: var(--white-color);
    padding: 16px; /* 18px - 2px(border) = 16px */
}

.agree-box {
    padding: 0 18px;
}

.agreement-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agreement-row label {
    font-size: 14px;
    color: var(--text-light-color);
}

.checkbox-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background-color: var(--light-gray-bg);
    border: 1.83px solid var(--icon-outline-color);
}

.checkbox-icon.checked {
    background-color: var(--white-color);
}

.agreement-label {
    color: var(--text-light-color);
    font-size: 12px;
    font-weight: 400;
}

.agreement-title {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 700;
}

.more-info-icon {
    width: 20px;
    height: 20px;
}

/* 하단 버튼 섹션 */
.bottom-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 0 20px 0;
}

.info-text-box .input-text {
    padding: 30px;
    font-size: 12px;
    color: var(--text-light-color);
}

.dimmed-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dimmed-bg);
    z-index: 9;
}

.help-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white-color);
    border-radius: 32px 32px 0 0;
    padding: 40px;
}

.help-title {
    color: #191919;
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    margin: 0 0 24px 0;
}

.help-popup-close {
    position: absolute;
    top: -60px;
    right: 0;
    color: var(--white-color);
    font-size: 14px;
    padding: 20px 30px;
    cursor: pointer;
}

.title-box {
    display: none; /* 기본적으로 숨김 */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    padding: 60px 20px 40px 20px;
}

.title-box.show {
    display: flex;
}

.title-img {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.title-img img {
    height: 130px;
}

.title-text {
    font-size: 16px;
    text-align: center;
}

.title-text p {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-color);
    font-weight: 700;
}

/* Content Section */
.content-banner {
    border: 1px solid #efefef;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    justify-content: center;
    border-radius: 16px;
}

.ic-tcimg {
    border-radius: 16px;
    width: 60px;
    height: 60px;
}

.banner-text {
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.4;
}

.logo-text {
    color: var(--primary-color);
}

/* Action Buttons */
.actions {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-button {
    background: #192D41;
    color: white;
    font-weight: bold;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    border: none;
}

.continue-button {
    color: var(--text-light-color);
    font-size: 12px;
    background: none;
    border: none;
}

.linkview {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.linkview a {
    display: block;
    background: rgba(25, 45, 65, 0.5);
    color: white;
    font-size: 12px;
    padding: 2px;
    border-radius: 8px;
    min-width: 40px;
    text-align: center;
}

.divider {
    margin: 0;
    padding: 0;
    height: 12px;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
}

.agreement-dimmed {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.agreement-popup {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    width: 90vw; /* max-width 제거 */
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
    position: relative;
    animation: popupShow .24s;

    /* 추가: Flex 레이아웃 및 최대 높이 설정 */
    display: flex;
    flex-direction: column;
    height: 90vh; /* 화면 높이의 90% */
}

@keyframes popupShow {
    from {
        transform: translateY(30px);
        opacity: 0
    }
    to {
        transform: translateY(0);
        opacity: 1
    }
}

.agreement-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    font-size: 20px;
    color: #888;
    transition: color .2s;
}

.agreement-popup-close:hover {
    color: #333;
}

.agreement-popup-title {
    font-size: 1.15em;
    font-weight: bold;
    margin-bottom: 14px;
}

.agreement-popup-body {
    /* max-height: 50vh; 제거 */
    height: 100%; /* 부모(popup)의 남은 공간 채우기 */
    overflow: hidden; /* 스크롤 제거 */
    margin-top: 10px; /* 타이틀과 간격 */
    font-size: 1em;
    flex: 1; /* Flex 아이템으로서 남은 공간 차지 */
}

/* iframe 스타일 추가 */
.agreement-popup-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 수수료 안내 박스 스타일 */
.fee-info-box {
    background-color: var(--light-sky-bg); /* #F1F6FA */
    /* border: 1px solid var(--primary-color); */ /* 제거 */
    border-radius: 16px;
    margin-top: 20px;
    padding: 20px;
    text-align: center;
}

.fee-amount {
    color: var(--primary-color); /* #006EB4 */
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.fee-amount span {
    font-size: 14px;
    font-weight: 400;
    color: var(--primary-color); /* #006EB4 */
}

.fee-desc {
    color: #888888;
    font-size: 12px;
}

/* 커스텀 Alert 스타일 */
.alert-dimmed {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
}

.alert-popup {
    background: #fff;
    border-radius: 20px;
    width: 90vw;
    max-width: 320px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
    overflow: hidden;
    animation: popupShow .2s;
}

.alert-body {
    padding: 24px 20px;
    text-align: center;
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.5;
    word-break: keep-all;
}

.alert-btn-area {
    margin: 0 20px;
    border-top: 1px solid #eee;
    display: flex;
}

.alert-btn {
    flex: 1;
    padding: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    background: #fff;
}

.alert-btn:active {
    background: #f9f9f9;
}

/* 모바일 화면에서 terms-item의 자간 조정 */
@media (max-width: 768px) {
    .terms-item {
        letter-spacing: -1px;
    }

    .feature-desc {
        font-size: 12px;
    }
}
