/* ================================================
   프로젝트 등록 위자드 stepper
   artisthub-base.css 토큰 의존
   ================================================ */

.sp-wizard-stepper-wrapper {
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
}

.sp-wizard-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 0;
}

.sp-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 4px 10px;
    cursor: pointer;
    position: relative;
    transition: opacity 0.2s ease;
}

.sp-wizard-step:hover {
    opacity: 0.8;
}

/* ---- 배지 ---- */
.sp-wizard-step__badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid var(--gray-300);
    color: var(--text-desc);
    background: transparent;
    transition: all 0.3s ease;
}

.sp-wizard-step__check {
    display: none !important;
    font-size: 12px;
}

.sp-wizard-step.is-complete .sp-wizard-step__check {
    display: inline !important;
}

/* 활성 단계 */
.sp-wizard-step.is-active .sp-wizard-step__badge {
    background: var(--ai-accent-dark);
    border-color: var(--ai-accent-dark);
    color: #fff;
}

.sp-wizard-step.is-active .sp-wizard-step__title {
    color: var(--ai-accent-dark);
    font-weight: 700;
}

/* 완료 단계 */
.sp-wizard-step.is-complete .sp-wizard-step__badge {
    background: var(--ai-accent-dark);
    border-color: var(--ai-accent-dark);
    color: #fff;
}

.sp-wizard-step.is-complete .sp-wizard-step__number {
    display: none;
}

.sp-wizard-step.is-complete .sp-wizard-step__title {
    color: var(--ai-accent-dark);
}

/* 제목 */
.sp-wizard-step__title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-desc);
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* ---- 진행 바 ---- */
.sp-wizard-progress {
    position: relative;
    height: 4px;
    background: transparent;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    --sp-progress-track-left: 0px;
    --sp-progress-track-right: 0px;
    --sp-progress-fill: 0px;
}

.sp-wizard-progress::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--sp-progress-track-left);
    right: var(--sp-progress-track-right);
    height: 100%;
    background: var(--gray-200);
    border-radius: var(--radius-full);
}

.sp-wizard-progress__bar {
    position: absolute;
    top: 0;
    left: var(--sp-progress-track-left);
    height: 100%;
    width: var(--sp-progress-fill);
    background: linear-gradient(90deg, var(--ai-accent-dark) 0%, var(--ai-accent) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-wizard-progress.is-resetting .sp-wizard-progress__bar {
    transition: none;
}

/* ---- 위자드 모드 모달 크기·패딩 확장 ---- */
[data-ui-modal="search-popup"].is-wizard .search-popup {
    width: 640px;
    max-height: 85vh;
    min-height: 0;
}

[data-ui-modal="search-popup"].is-wizard .search-popup__scroll {
    padding: 24px 32px;
    overflow-x: hidden;
}

/* popup-title 숨김 (stepper가 단계 표시) */
[data-ui-modal="search-popup"].is-wizard .popup-title {
    display: none;
}

/* text-div 숨김 (section-header로 대체) */
[data-ui-modal="search-popup"].is-wizard .text-div {
    display: none;
}

/* ---- 섹션 헤더: 아이콘 + 제목 + 설명 ---- */
.sp-wizard-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}

.sp-wizard-section-header__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4fc 100%);
    color: var(--ai-accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sp-wizard-section-header__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-wizard-section-header__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.sp-wizard-section-header__desc {
    font-size: 13px;
    color: var(--text-sub);
}

/* ---- input/label 오버라이드 ---- */
[data-ui-modal="search-popup"].is-wizard .input-div {
    margin-bottom: 14px;
}

[data-ui-modal="search-popup"].is-wizard .input-div label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* 라벨 + 인라인 옵션(체크박스) */
[data-ui-modal="search-popup"].is-wizard .sp-wizard-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

[data-ui-modal="search-popup"].is-wizard .sp-wizard-label-row label {
    margin-bottom: 0;
}

[data-ui-modal="search-popup"].is-wizard .input-div input,
[data-ui-modal="search-popup"].is-wizard .input-div textarea {
    height: 50px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-ui-modal="search-popup"].is-wizard .input-div textarea {
    height: auto;
    padding: 12px;
}

/* iOS는 16px 미만 입력에 포커스하면 화면을 확대한다 — 핀치 줌은 막지 않고 글자 크기로 해결한다(룰링 2026-11-02). 셀렉트는 tom-select-custom.css의 같은 가드가 맡는다. */
@media (max-width: 640px) {
    [data-ui-modal="search-popup"].is-wizard .input-div input,
    [data-ui-modal="search-popup"].is-wizard .input-div textarea {
        font-size: 16px;
    }
}

/* 휴대폰은 flatpickr 대신 네이티브 날짜 입력이 떠서 140px 아래로 줄면 날짜가 잘린다 —
   기간 설정으로 두 칸이 한 줄에 못 들어가면 끝 날짜를 다음 줄로 내린다. */
[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] .input-flex-between {
    flex-wrap: wrap;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] .input-flex-between > input {
    flex: 1 1 140px;
    min-width: 0;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] .input-flex-between > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] [data-time-range-input] {
    display: flex;
    width: 100%;
    height: 50px;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] [data-time-range-input] > div {
    flex: 1 1 0;
    min-width: 0;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] [data-time-range-input] .schedule-input {
    width: 100%;
}

[data-ui-modal="search-popup"].is-wizard [data-search-popup-scene="project-schedule"] [data-time-range-input] .wave {
    flex: 0 0 auto;
}

[data-ui-modal="search-popup"].is-wizard .input-div input:focus,
[data-ui-modal="search-popup"].is-wizard .input-div textarea:focus {
    outline: none;
    border-color: var(--ai-accent-dark);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-ui-modal="search-popup"].is-wizard .input-div input::placeholder,
[data-ui-modal="search-popup"].is-wizard .input-div textarea::placeholder {
    font-size: 13px;
    color: var(--text-desc);
}

/* Tom Select 스타일 통일 */
[data-ui-modal="search-popup"].is-wizard .ts-control {
    border-radius: var(--radius-md);
    border-color: var(--gray-300);
}

[data-ui-modal="search-popup"].is-wizard .ts-control.focus {
    border-color: var(--ai-accent-dark);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 예산 input 너비: flex 균등 분배 */
[data-ui-modal="search-popup"].is-wizard .input-with-unit {
    flex: 1 1 0;
    min-width: 0;
}

[data-ui-modal="search-popup"].is-wizard .popup-scene {
    overflow: visible;
}

/* ---- 버튼 영역 리디자인 ---- */
[data-ui-modal="search-popup"].is-wizard .button-div {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    gap: 10px;
}

[data-ui-modal="search-popup"].is-wizard .button-div button {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all 0.2s ease;
}

/* 이전 버튼: outlined */
[data-ui-modal="search-popup"].is-wizard .button-div button:first-child {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--gray-300);
}

[data-ui-modal="search-popup"].is-wizard .button-div button:first-child:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* 다음/저장 버튼: filled primary */
[data-ui-modal="search-popup"].is-wizard .button-div button:last-child {
    background: var(--ai-accent-dark);
    color: #fff;
    border: none;
}

[data-ui-modal="search-popup"].is-wizard .button-div button:last-child:hover:not(:disabled) {
    background: #063a78;
}

[data-ui-modal="search-popup"].is-wizard .button-div button:disabled {
    background: var(--gray-200) !important;
    color: var(--gray-400) !important;
    border: none !important;
    cursor: not-allowed;
    opacity: 1;
}

/* ---- 5단계 최종 확인 ---- */
.sp-confirm-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 14px;
}

.sp-confirm-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.sp-confirm-section__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ai-accent-dark);
}

.sp-confirm-section__edit {
    font-size: 12px;
    font-weight: 600;
    color: var(--ai-accent-dark);
    background: none;
    border: 1px solid var(--ai-accent-dark);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sp-confirm-section__edit:hover {
    background: var(--ai-accent-dark);
    color: #fff;
}

.sp-confirm-dl {
    margin: 0;
}

.sp-confirm-row {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.5;
}

.sp-confirm-row dt {
    flex: 0 0 110px;
    color: var(--text-desc);
    font-weight: 500;
}

.sp-confirm-row dd {
    flex: 1;
    color: var(--text-main);
    margin: 0;
    word-break: break-word;
}


/* ================================================
   다크모드 오버라이드
   ================================================ */

/* 위자드 stepper 래퍼 */
body.theme-dark .sp-wizard-stepper-wrapper {
    background: rgba(255, 255, 255, 0.03);
}

/* 배지 기본 — 비활성 단계 가시성 확보 */
body.theme-dark .sp-wizard-step__badge {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-sub);
}

/* 비활성 단계 제목 */
body.theme-dark .sp-wizard-step__title {
    color: var(--text-sub);
}

/* 활성/완료 배지 — 블루 글로우 */
body.theme-dark .sp-wizard-step.is-active .sp-wizard-step__badge,
body.theme-dark .sp-wizard-step.is-complete .sp-wizard-step__badge {
    background: var(--ai-accent);
    border-color: var(--ai-accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

body.theme-dark .sp-wizard-step.is-active .sp-wizard-step__title,
body.theme-dark .sp-wizard-step.is-complete .sp-wizard-step__title {
    color: var(--ai-accent);
}

/* 진행 바 트랙 */
body.theme-dark .sp-wizard-progress::before {
    background: rgba(255, 255, 255, 0.06);
}

/* 진행 바 채움 — 글로우 */
body.theme-dark .sp-wizard-progress__bar {
    background: linear-gradient(90deg, #1D4ED8 0%, #3B82F6 50%, #0EA5E9 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* 섹션 헤더 */
body.theme-dark .sp-wizard-section-header {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .sp-wizard-section-header__icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.2) 100%);
    color: var(--ai-accent);
}

/* 인풋 필드 */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .input-div input,
body.theme-dark [data-ui-modal="search-popup"].is-wizard .input-div textarea {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark [data-ui-modal="search-popup"].is-wizard .input-div input:focus,
body.theme-dark [data-ui-modal="search-popup"].is-wizard .input-div textarea:focus {
    border-color: var(--ai-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Tom Select */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .ts-control {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

body.theme-dark [data-ui-modal="search-popup"].is-wizard .ts-control.focus {
    border-color: var(--ai-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 버튼 영역 */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div {
    border-color: rgba(255, 255, 255, 0.06);
}

/* 이전 버튼 */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div button:first-child {
    background: transparent;
    color: var(--text-sub);
    border-color: rgba(255, 255, 255, 0.15);
}

body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div button:first-child:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

/* 다음/저장 버튼 — 활성 상태만 글로우 (btn-primary 다크모드 패턴) */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div button:last-child:not(:disabled) {
    background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 50%, #0EA5E9 100%);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div button:last-child:hover:not(:disabled) {
    box-shadow: var(--shadow-glow-intense);
}

/* 비활성 버튼 — 글로우 제거, 텍스트 대비 확보 */
body.theme-dark [data-ui-modal="search-popup"].is-wizard .button-div button:disabled {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-sub) !important;
    border: none !important;
    box-shadow: none !important;
}

/* 5단계 최종 확인 */
body.theme-dark .sp-confirm-section {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

body.theme-dark .sp-confirm-section__header {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .sp-confirm-section__title {
    color: var(--ai-accent);
}

body.theme-dark .sp-confirm-section__edit {
    color: var(--ai-accent);
    border-color: var(--ai-accent);
}

body.theme-dark .sp-confirm-section__edit:hover {
    background: var(--ai-accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
