/* =====================================================================
   회원가입 v2 추가 스타일
   - 기본 디자인은 individual-sign-up.css 재사용
   - 여기는 v2 전용 신규 요소만 정의
   ===================================================================== */

/* =====================
   필드 설명 (왜 필요한지)
   ===================== */
.field-why {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0 10px;
    padding: 10px 12px;
    background: #F0F7F8;
    border-left: 3px solid #3C8D99;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #4b5563;
}

.field-why i {
    color: #3C8D99;
    font-size: 12px;
    margin-top: 1px;
    flex: 0 0 auto;
}

.field-why strong {
    color: #3C8D99;
    font-weight: 600;
}

.field-why-inline {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.5;
}

.field-why-inline i {
    color: #3C8D99;
    margin-right: 3px;
    font-size: 11px;
}

/* =====================
   광주소식통 프리필 배너
   ===================== */
.koreanews-banner {
    display: none;
    margin: 12px 16px 16px;
    background: linear-gradient(135deg, #eef6f8 0%, #f0faf5 100%);
    border: 1.5px solid #3C8D99;
    border-radius: 14px;
    overflow: hidden;
    animation: koreanews-slide 0.35s ease-out;
}

.koreanews-banner.show { display: block; }

.koreanews-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    position: relative;
}

.koreanews-banner-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #3C8D99;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.koreanews-banner-content {
    flex: 1;
    min-width: 0;
}

.koreanews-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.koreanews-banner-desc {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}

.koreanews-banner-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    background: #3C8D99;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s;
}

.koreanews-banner-btn:hover { background: #2a6b75; }

.koreanews-banner-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
}

.koreanews-banner-close:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
}

.koreanews-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(60, 141, 153, 0.1);
    color: #3C8D99;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    letter-spacing: -0.2px;
}

@keyframes koreanews-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================
   소득 칩 금액 표시
   ===================== */
#incomeGroup .chip {
    min-height: 44px;
    line-height: 1.3;
    padding: 6px 12px;
}

#incomeGroup .chip-amount {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #6b7280;
    margin-top: 1px;
}

#incomeGroup .chip.selected .chip-amount {
    color: #fff;
    font-weight: 500;
}

/* =====================
   네이버 버튼 (기존 디자인 스타일 보조)
   ===================== */
.btn-naver-login {
    width: 100%;
    height: 50px;
    border: none;
    background: #03C75A;
    color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: -0.2px;
    transition: background 0.2s;
    margin-bottom: 12px;
}

.btn-naver-login:hover { background: #02b853; }

.btn-naver-login i {
    font-size: 18px;
    font-weight: 900;
    background: rgba(255,255,255,0.2);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-login-section {
    padding: 16px 16px 0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 16px;
    color: #9ca3af;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

.divider-text {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

/* =====================
   섹션 안내 (왜 받는지 - 카드 상단)
   ===================== */
.section-intro {
    font-size: 12.5px;
    color: #6b7280;
    margin: -8px 0 14px;
    line-height: 1.5;
    padding: 10px 12px;
    background: #F9FAFB;
    border-radius: 8px;
}

.section-intro strong { color: #3C8D99; font-weight: 600; }

/* =====================
   광주소식통 연결 모달
   ===================== */
.koreanews-modal-content {
    max-width: 340px;
    width: calc(100% - 40px);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.koreanews-modal-body {
    padding: 28px 24px 20px;
    text-align: center;
}

.koreanews-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3C8D99 0%, #2a6b75 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}

.koreanews-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}

.koreanews-modal-desc {
    font-size: 14px;
    color: #3C8D99;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
}

.koreanews-modal-hint {
    font-size: 12.5px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.koreanews-modal-footer {
    display: flex;
    gap: 8px;
    padding: 20px;
}

.koreanews-modal-footer .btn {
    flex: 1;
    height: 46px;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 10px;
}

.koreanews-modal-footer .btn-secondary {
    background: #F3F4F6;
    color: #4b5563;
    border: none;
}

.koreanews-modal-footer .btn-secondary:hover { background: #E5E7EB; }

.koreanews-modal-footer .btn-primary {
    background: #3C8D99;
    color: #fff;
    border: none;
}

.koreanews-modal-footer .btn-primary:hover { background: #2a6b75; }

/* =====================
   자녀 상세 1줄 레이아웃
   ===================== */
.child-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.child-label {
    flex: 0 0 72px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: -0.2px;
}

.child-inputs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.child-age-input {
    width: 68px;
    flex: 0 0 68px;
    height: 38px;
    padding: 6px 10px;
    font-size: 13px;
    text-align: center;
}

.chip-small {
    display: flex;
    gap: 6px;
    flex: 1;
}

.chip-small .chip {
    flex: 1;
    min-height: 38px;
    padding: 4px 10px;
    font-size: 12.5px;
    justify-content: center;
}

/* =====================
   복지대상 그룹핑 (소득·가구 / 생애주기 / 취약·우대 / 직종 / 해당없음)
   ===================== */
.welfare-group-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.welfare-sub {
    padding: 0;
}

.welfare-sub-title {
    font-size: 12px;
    font-weight: 700;
    color: #3C8D99;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    padding-left: 2px;
    text-transform: none;
}

.welfare-sub-none {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px dashed #E5E7EB;
}

/* =====================
   복지대상 자동 힌트 (입력값 기반 추천)
   선택 전에만 점선/하이라이트. 선택되면 원래 .chip.selected 스타일을 그대로 쓰도록.
   ===================== */
#welfareGroup .chip.suggested:not(.selected) {
    border: 2px dashed #3C8D99;
    background: rgba(60, 141, 153, 0.08);
    position: relative;
    color: #1a1a1a;
}

#welfareGroup .chip.suggested:not(.selected) i,
#welfareGroup .chip.suggested:not(.selected) span {
    color: #1a1a1a;
}

#welfareGroup .chip.suggested:not(.selected)::after {
    content: '추천';
    position: absolute;
    top: -7px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #3C8D99;
    padding: 2px 6px;
    border-radius: 8px;
    letter-spacing: -0.3px;
    line-height: 1;
}

/* =====================
   가구원수 세그먼트 컨트롤
   ===================== */
.segment-group {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: #F3F4F6;
    border-radius: 12px;
}

.segment-group .segment {
    flex: 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    letter-spacing: -0.3px;
}

.segment-group .segment.selected {
    background: #fff;
    color: #1a1a1a;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.segment-group .segment:hover:not(.selected) {
    color: #1a1a1a;
}

/* =====================
   소득 chip — 금액 먼저, 중위 % 작게
   ===================== */
#incomeGroup {
    gap: 10px;
    margin-top: 4px;
}

#incomeGroup .chip {
    flex: 0 0 auto;
    min-width: 130px;
    padding: 10px 14px;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.3;
}

#incomeGroup .chip-main {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

#incomeGroup .chip-sub {
    font-size: 10.5px;
    color: #6b7280;
    font-weight: 500;
    margin-top: 2px;
}

#incomeGroup .chip.selected .chip-main,
#incomeGroup .chip.selected .chip-sub {
    color: #fff;
}

/* 소득 설명 — 좌측 정렬, 박스 형태로 명확히 */
.form-field > p.password-hint.income-hint {
    text-align: left;
    color: #4b5563;
    font-size: 12.5px;
    line-height: 1.5;
    background: #F0F7F8;
    border-left: 3px solid #3C8D99;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 6px 0 12px;
}

/* =====================
   부모/조부모 보너스 입력 (선택)
   ===================== */
.bonus-field {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFF4D6 100%);
    border: 1px dashed #E0B872;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 12px;
}

.bonus-field .field-label {
    font-weight: 700;
    color: #8B6914;
}

.bonus-field .field-label i {
    color: #D4A017;
}

.bonus-field .optional-badge {
    margin-left: auto;
    background: #D4A017;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: -0.3px;
}

.bonus-field .field-why-inline {
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 4px 0 10px;
    color: #6b4f00;
    font-size: 12px;
    line-height: 1.45;
}

.bonus-field .field-why-inline strong {
    color: #B8860B;
}

.bonus-field .family-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.bonus-field .family-member-label {
    flex: 0 0 56px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.bonus-field .family-input {
    flex: 1;
    height: 40px;
    font-size: 14px;
    background: #fff;
}

.bonus-field .hidden-cb {
    display: none;
}

/* 라벨 여백 — 아버지·어머니 등 양쪽에 텍스트 여유 + 줄바꿈 방지 */
.bonus-field .family-member-label {
    padding-left: 8px;
    padding-right: 12px;
    margin-right: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 72px;
}

/* 자녀 rows 라벨도 동일 */
.child-row-v2 .family-member-label {
    padding-left: 8px;
    padding-right: 12px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 56px;
}

/* 자녀 전용 톤 (민트/그린) */
.bonus-field.children-field {
    background: linear-gradient(135deg, #E8F5E9 0%, #EAF7ED 100%);
    border: 1px dashed #7AB888;
}

.bonus-field.children-field .field-label {
    color: #2E6B3A;
}

.bonus-field.children-field .field-label i {
    color: #3FAE56;
}

.bonus-field.children-field .optional-badge {
    background: #3FAE56;
}

.bonus-field.children-field .field-why-inline {
    color: #245C30;
}

.bonus-field.children-field .field-why-inline strong {
    color: #2E6B3A;
}

.children-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 12px;
}

.children-count-row .children-count-label {
    flex: 0 0 64px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    padding-right: 4px;
}

.children-count-row .form-select {
    flex: 1;
    height: 40px;
    font-size: 14px;
    background: #fff;
}

/* 제출 버튼 꽉 차게 */
#submitBtn,
#submitBtn.btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-container {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
}

.btn-container .btn {
    width: 100%;
}

/* =====================
   input-with-button 한 줄 유지 + 모바일 높이 정상화
   ===================== */
.input-with-button {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

.input-with-button .form-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    font-size: 15px;
    padding: 0 14px;
    box-sizing: border-box;
}

.input-with-button .btn-verify,
.input-with-button .btn-icon {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 82px;
    height: 48px;
    padding: 0 14px;
    font-size: 13.5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-with-button .btn-icon {
    min-width: 48px;
    width: 48px;
    padding: 0;
}

/* iOS에서 zoom-in 방지 위해 16px 최소 + 원본 CSS의 width:100% override */
@media (max-width: 480px) {
    .input-with-button .form-input {
        font-size: 16px;
        height: 48px;
    }
    .input-with-button .btn-verify,
    .input-with-button .btn-icon {
        height: 48px;
        min-width: 78px;
        width: auto !important; /* 원본 @media의 width:100% 무효화 */
    }
    .input-with-button .btn-icon {
        min-width: 48px;
        width: 48px !important;
    }

    /* chip-group-wrap (직업·결혼·소득·복지) — 2열 그리드 균등 분배 */
    .chip-group-wrap {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
    }
    .chip-group-wrap .chip {
        width: 100%;
        min-width: 0 !important;
        flex: none;
        margin: 0;
        box-sizing: border-box;
    }

    /* 소득 chip 특화 override — 2열 그리드 안에서 작동하도록 */
    #incomeGroup .chip {
        min-width: 0 !important;
        padding: 10px 8px;
    }

    /* 기본 chip-group (성별·세대주·차량·부모/조부모 동거) — 균등 flex */
    .chip-group:not(.chip-group-wrap) {
        display: flex !important;
        gap: 8px !important;
    }
    .chip-group:not(.chip-group-wrap) .chip {
        flex: 1 1 0;
        min-width: 0 !important;
    }
}

/* =====================
   Sticky 헤더 + 진행 인디케이터 (헤더 안에 통합)
   ===================== */
.signup-header-sticky {
    position: sticky !important;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    flex-direction: row;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid #EEF1F2;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.signup-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
}

.signup-header-sticky .signup-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 10px;
    background: transparent;
    border-bottom: none;
}

.signup-progress-track {
    flex: 1;
    height: 6px;
    background: #EEF1F2;
    border-radius: 6px;
    overflow: hidden;
}

.signup-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3C8D99 0%, #2a6b75 100%);
    border-radius: 6px;
    transition: width 0.25s ease;
}

.signup-progress-text {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: #3C8D99;
    letter-spacing: -0.3px;
    min-width: 60px;
    text-align: right;
}

/* =====================
   제출 시 에러 필드 강조
   ===================== */
.form-field.has-error .form-input,
.form-field.has-error .form-select {
    border-color: #DC2626;
    background-color: rgba(220, 38, 38, 0.04);
}

.form-field.has-error .field-label {
    color: #DC2626;
}

/* =====================
   알림 (토스트) 디자인 개선
   ===================== */
.alert-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.alert-container > * {
    pointer-events: auto;
}

/* 단일 토스트 (원본 showAlert 결과: .alert-toast.success / .error) */
.alert-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.alert-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.alert-toast i {
    flex: 0 0 auto;
    font-size: 18px;
    margin-top: 1px;
}

.alert-toast.success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #14532D;
}

.alert-toast.success i {
    color: #16A34A;
}

.alert-toast.error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-toast.error i {
    color: #DC2626;
}

/* 다중 에러 요약용 (.alert.alert-error.alert-multi) */
.alert {
    display: block !important;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.alert.alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert.alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #14532D;
}

.alert strong {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}

.alert-multi ul {
    display: block;
    margin: 6px 0 0 18px;
    padding: 0;
    font-size: 12.5px;
    list-style: disc;
}

.alert-multi ul li {
    display: list-item;
    margin: 2px 0;
}

/* =====================
   거주 지역 한 줄 유지 (모바일에서도 row)
   ===================== */
.address-select-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
}

.address-select-group .form-select {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .address-select-group {
        flex-direction: row !important;
    }
}
