@charset "utf-8";

/* ==========================================================================
   partner media.css
   파트너 화면 전용 반응형
   ========================================================================== */

/* [TABLET AREA] 1024px 이하 브라우저 및 태블릿 PC 대응 */
@media (max-width: 1024px) {
    .header-container, .partner-container, .footer-wrap { max-width: 100%; padding-left: 24px; padding-right: 24px; }
    .join-page-wrapper { flex-direction: column; align-items: stretch; gap: 20px; margin: 20px auto; }
    .join-container,
    .benefit-sticky-box { width: 100%; max-width: none; flex: none; }
    .benefit-sticky-box { position: static; padding: 24px; }
    .profile-shell { grid-template-columns: 1fr; }
    .profile-aside { border-right: none; border-bottom: 1px solid #f1f5f9; max-width: 360px; }
    .dashboard-stat-grid { gap: 12px; }
    .grid-main-side { grid-template-columns: 1fr; }
}

/* [MOBILE CORES] 768px 이하 스마트폰 및 모바일 디바이스 표준 대응 */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .partner-container { margin: 20px auto !important; padding: 0 16px !important; position: relative; z-index: 1; clear: both; }
    .join-container,
    .benefit-sticky-box { width: 100%; max-width: none; padding: 24px 20px; border-radius: 8px; box-sizing: border-box; }
    
    /* 모바일 헤더 레이아웃 교정 및 삼선 버튼 정렬 */
    .fns-global-header { height: 60px !important; padding: 0 !important; position: relative !important; overflow: visible !important; }
    .fns-global-header .header-container { flex-direction: row !important; height: 100% !important; justify-content: space-between !important; align-items: center !important; padding: 0 16px !important; display: flex !important; }
    .fns-global-header .header-logo { font-size: 20px !important; text-align: left !important; margin: 0 !important; position: static !important; transform: none !important; display: block !important; }
    
    .fns-global-header nav,
    .fns-global-header #partner-gnb,
    .fns-global-header .user-logged-info,
    .fns-global-header .user-guest-info { 
        display: none !important; 
        opacity: 0 !important; 
        visibility: hidden !important; 
    }

    .fns-global-header .header-user-zone {
        width: auto !important;
        padding-bottom: 0 !important;
    }

    .fns-global-header .mobile-toggle-btn { 
        display: block !important; 
        opacity: 1 !important; 
        visibility: visible !important; 
        position: relative !important; 
        z-index: 999 !important; 
        color: #ffffff !important; 
        font-size: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    /* 타이틀 영역 모바일 대응 */
    .page-title-area { display: block !important; width: 100% !important; float: none !important; margin-top: 25px !important; margin-bottom: 20px !important; text-align: left !important; }
    .page-title-area h2 { font-size: 20px !important; line-height: 1.4 !important; font-weight: 800 !important; color: #0f172a !important; }
    .page-title-area p { font-size: 13px !important; margin-top: 6px !important; display: block !important; color: var(--text-sub) !important; }
    .page-title-area div:last-child { width: 100% !important; text-align: left !important; margin-top: 10px !important; display: block !important; }
    
    /* 대시보드 현황 카드 모바일 정렬 */
    .dashboard-stat-grid { display: flex !important; flex-direction: column !important; gap: 12px !important; margin-bottom: 24px !important; width: 100% !important; height: auto !important; }
    .grid-main-side { grid-template-columns: 1fr !important; }
    .dash-panel-head { flex-wrap: wrap; }
    .dash-more-link { padding-top: 0; }
    .stat-card { width: 100% !important; min-width: 100% !important; max-width: 100% !important; display: flex !important; flex-direction: row !important; align-items: center !important; background: var(--white) !important; border: 1px solid var(--border-ui) !important; border-radius: 8px !important; padding: 16px !important; gap: 14px !important; }
    .stat-info { display: flex !important; flex-direction: column !important; justify-content: center !important; text-align: left !important; }
    .stat-info .stat-num { font-size: 18px !important; margin-top: 2px !important; }

    /* 가입 단계 모바일 조절 */
    .join-step-wrapper { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 4px !important; padding: 12px 8px !important; }
    .join-step-wrapper .step-box { display: flex !important; align-items: center !important; gap: 4px !important; font-size: 12px !important; white-space: nowrap !important; flex-shrink: 0 !important; }
    .join-step-wrapper .step-number { width: 20px !important; height: 20px !important; font-size: 11px !important; flex-shrink: 0 !important; }
    .join-step-wrapper .step-divider { font-size: 10px !important; margin: 0 2px !important; flex-shrink: 0 !important; }

    /* 폼 요소 모바일 확산 */
    .form-group { margin-bottom: 20px; }
    .form-group label { font-size: 13px; margin-bottom: 8px; }
    .form-group label.cat-checkbox-item { margin-bottom: 0; font-size: 13px; }
    .form-group.login-toolbar { display: flex; flex-direction: row; justify-content: space-between; align-items: center; }
    .form-group.login-toolbar > label { margin-bottom: 0; font-weight: 500; }
    .form-control { height: 46px; font-size: 14px; padding: 0 14px; }
    .form-flex { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .form-flex .flex-phone { flex: 1 1 100%; }
    .form-flex .btn-inline-auth { flex: 1 1 calc(50% - 4px); height: 46px; } 
    .form-helper { font-size: 12px; margin-top: 6px; }
    .checkbox-group { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin-bottom: 14px; padding: 4px 0; }
    .checkbox-group input[type="checkbox"] { width: 18px; height: 18px; margin-top: 0; }
    .checkbox-group label { font-size: 13px; margin-bottom: 0; }

    /* 카드 패딩 축소 */
    .fns-card { padding: 20px; border-radius: 8px; }
    .fns-card-title { font-size: 15px; margin-bottom: 16px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .order-list-item { padding: 16px; border-radius: 6px; }
    
    div[style*="display: flex; justify-content: space-between"] { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
    div[style*="border-left"] { border-left: none !important; padding-left: 0 !important; border-top: 1px solid var(--border-ui); padding-top: 16px; text-align: left !important; }
    div[style*="text-align: right"] { text-align: left !important; min-width: 100% !important; margin-top: 4px; }

    /* 버튼 모바일 대응 */
    .btn-fns { width: 100%; height: 46px; font-size: 14px; padding: 0 16px; justify-content: center; }
    .btn-fns-submit { width: 100%; height: 50px; font-size: 15px; }
    .btn-inline-auth { padding: 0 14px; font-size: 13px; height: 46px; }
    
    .benefit-sticky-box { padding: 24px 20px; }
    .benefit-title { font-size: 16px; margin-bottom: 18px; }
    .benefit-item { gap: 10px; }
    .benefit-icon { width: 30px; height: 30px; font-size: 12px; }
    
    /* 하단 푸터 모바일 대응 */
    .fns-partner-footer { padding: 40px 16px; }
    .footer-wrap { flex-direction: column; align-items: flex-start; gap: 24px; }
    .footer-links { flex-direction: column; gap: 12px; width: 100%; }
    .footer-links li { width: 100%; }
    .footer-links a { display: block; font-size: 13px; padding: 4px 0; }
    .footer-copy { margin-top: 24px; padding-top: 16px; text-align: left; font-size: 11px; }

    /* 시공 및 정산 모바일 레이아웃 */
    .page-title-const { flex-direction: column; align-items: flex-start; gap: 12px; }
    .status-summary-group { width: 100%; display: flex; gap: 8px; justify-content: flex-start; }

    .const-card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .const-card-price-zone { text-align: left; min-width: auto; width: 100%; background: #f8fafc; padding: 10px 14px; border-radius: 6px; }
    .const-card-price-zone .price-label { display: inline-block; margin-bottom: 0; margin-right: 8px; }
    .const-card-price-zone .price-value, 
    .const-card-price-zone .price-value-done { display: inline-block; font-size: 16px; vertical-align: middle; }

    .const-card-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
    .const-footer-notice { width: 100%; word-break: keep-all; }
    .const-action-buttons { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
    .const-action-buttons .btn-fns { flex: 1; height: 44px; font-size: 14px; justify-content: center; align-items: center; display: inline-flex; white-space: nowrap; }

    .settle-summary-grid { flex-direction: column; gap: 12px; }
    .settle-summary-card { width: 100%; min-width: auto; }
    .settle-price { font-size: 24px; }

    /* 정산 테이블 모바일 카드 변환 */
    .settle-table-responsive { border: none; overflow-x: hidden !important; padding: 0; width: 100% !important; box-sizing: border-box; }
    .settle-data-table { min-width: auto !important; width: 100% !important; display: block; box-sizing: border-box; }
    .settle-data-table thead { display: none !important; }
    .settle-data-table tbody { display: block; width: 100% !important; }
    .settle-data-table tbody tr { display: block; width: 100% !important; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; margin-bottom: 14px; box-sizing: border-box; }
    .settle-data-table td { display: block; width: 100% !important; padding: 0 !important; border: none !important; box-sizing: border-box; text-align: left; }
    
    .cell-date { display: inline-block !important; width: auto !important; font-size: 12.5px; color: #64748b; font-weight: 600; margin-bottom: 8px; margin-right: 6px; }
    .cell-type { display: inline-block !important; width: auto !important; margin-bottom: 8px; }
    .cell-subject { display: block !important; width: 100% !important; font-size: 14px; font-weight: 700; color: #1e293b; line-height: 1.45; margin-bottom: 12px; word-break: break-all; white-space: normal !important; }
    .cell-amount { display: flex !important; width: 100% !important; justify-content: space-between; align-items: center; border-top: 1px dashed #e2e8f0; padding-top: 12px !important; margin-bottom: 8px; font-size: 14.5px; white-space: nowrap; }
    .cell-amount::before { content: "거래 대금"; font-size: 12px; color: #64748b; font-weight: 500; }
    .cell-status { display: flex !important; width: 100% !important; justify-content: flex-end; margin-top: 4px; }

    /* 🛠️ [PROFILE EDIT MOBILE OPTIMIZATION] 프로필 수정 전용 모바일 최적화 */
    .profile-section-card { padding: 16px; }
    .form-row-grid { grid-template-columns: 1fr; gap: 12px; }
    .profile-match-split { grid-template-columns: 1fr; }
    .profile-page .category-grid-select { grid-template-columns: repeat(2, 1fr); }
    .profile-aside { max-width: none; }
    .profile-main { padding: 20px 20px 24px; }
    .profile-img-upload-box { flex-direction: column; text-align: center; justify-content: center; padding: 20px; }
    .upload-btn-wrap { align-items: center; }
    .form-checkbox-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; }
    .checkbox-item { justify-content: center; padding: 10px; }
    .profile-submit-zone { width: 100%; }
    .btn-profile-save { width: 100% !important; justify-content: center; }

    /* 파트너 가입 서식 모바일 대응 */
    .biz-type-group { display: flex !important; flex-direction: column !important; gap: 8px !important; width: 100% !important; margin-top: 8px !important; }
    .biz-type-btn { width: 100% !important; min-height: 52px !important; height: auto !important; padding: 14px 16px !important; border: 1px solid #cbd5e1 !important; border-radius: 8px !important; background: #ffffff !important; color: #475569 !important; font-size: 14px !important; font-weight: 600 !important; display: flex !important; align-items: center !important; justify-content: center !important; line-height: 1.2 !important; text-align: center !important; box-sizing: border-box !important; }
    .biz-type-btn input[type="radio"] { display: none !important; }
    .biz-type-btn.active { border: 2px solid #059669 !important; background-color: #ecfdf5 !important; color: #059669 !important; font-weight: 700 !important; }
    .category-grid-select { grid-template-columns: repeat(1, 1fr) !important; gap: 8px !important; }
    .cat-checkbox-item { padding: 10px 12px !important; font-size: 13px !important; }
    .step-btn-group { flex-direction: column; }
    .step-btn-group .btn-fns-submit { width: 100%; }

    .join-complete-box { padding: 24px 16px !important; }
    .complete-main-title { font-size: 20px !important; }
    .complete-sub-desc { font-size: 13.5px !important; margin-bottom: 20px !important; }
    .complete-process-timeline { padding: 12px 8px !important; }
    .timeline-icon { width: 30px !important; height: 30px !important; font-size: 12px !important; }
    .timeline-text { font-size: 11px !important; }
    .complete-btn-group { flex-direction: column !important; gap: 8px !important; }
    .btn-home-link { width: 100% !important; height: 48px !important; }
    .btn-dash-link { width: 100% !important; height: 48px !important; }
}

/* [SECTION R-09] 프로필 관리 모듈 (profile_edit.php) 모바일 대응 */
@media (max-width: 768px) {
  .partner-container { padding: 16px 12px 60px; }
  .profile-card, .profile-section-card { padding: 16px; margin-bottom: 16px; }
  .form-row-grid { grid-template-columns: 1fr; }
  .form-row-grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .profile-match-split { grid-template-columns: 1fr; }
  .status-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .file-upload-box { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-profile-save, .btn-submit-primary { width: 100%; padding: 0 16px; }
}

/* [SECTION R-16] 의뢰 탐색 모듈 (order_search.php) 모바일 반응형 */
@media (max-width: 768px) {
  .filter-row-grid { grid-template-columns: 1fr; gap: 10px; }
  .order-card-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-order-detail { width: 100%; text-align: center; box-sizing: border-box; }
  .category-filter-nav { gap: 6px; }
  .order-card-footer { flex-direction: column; align-items: stretch; }
  .btn-action-trigger { width: 100%; }
}


@media (max-width: 768px) {
    .partner-legal-wrap { margin: 24px auto 60px; padding: 0 16px; }
    .partner-legal-card { padding: 24px 18px; }
    .partner-legal-title { font-size: 18px; }
    .partner-legal-toc { padding: 12px; }
}

/* [SMALL MOBILE] 360px 이하 소형 화면 대응 */
@media (max-width: 360px) {
    .join-container,
    .benefit-sticky-box { padding: 20px 14px; }
    .page-title-area h2 { font-size: 18px; }
    .step-box { font-size: 11px; }
    .join-step-wrapper .step-box { font-size: 11px !important; gap: 3px !important; }
    .join-step-wrapper .step-number { width: 18px !important; height: 18px !important; font-size: 10px !important; }
}