/* ===================================================
   step_doc.css  –  หน้าแนบเอกสารประกอบการสมัครสินเชื่อ
   Theme: #d82027 red / Prompt font / card radius 14px
   =================================================== */

/* ── Container ── */
.step6-subpage {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Progress bar (ใช้ร่วมกับ step อื่น) ── */
.step6-progress {
    padding: 16px 24px 10px;
}

/* ── Banner ── */
.step6-banner {
    background: linear-gradient(135deg, #d82027 0%, #9b0e14 100%);
    border-radius: 14px;
    padding: 18px 20px 16px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.step6-banner::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}
.step6-banner::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.step6-banner-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    position: relative;
    z-index: 1;
}
.step6-banner-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.82);
    margin-top: 4px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ── Section header ── */
.doc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f5e5e5;
}
.doc-section-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d82027, #9b0e14);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.doc-section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #c62828;
    line-height: 1.3;
}
.doc-section-badge {
    margin-left: auto;
    background: #fff3f3;
    border: 1px solid #f5c6c6;
    color: #c62828;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 9px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Upload Card ── */
.doc-upload-card {
    background: #fff;
    border: 1.5px solid #eedede;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
.doc-upload-card.has-file {
    border-color: #1a8f00;
}
.doc-upload-card.optional-card {
    border-style: dashed;
    border-color: #ddd;
    background: #fafafa;
}

.doc-card-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.doc-card-label .doc-type-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 500;
    color: #888;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 1px 6px;
}

.upload-example-popup {
    max-width: 94vw !important;
}
.upload-example-html {
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden !important;
}
.upload-example-wrap {
    margin: 8px auto 0;
    max-height: 72vh;
    max-width: 100%;
    overflow: auto;
    width: 100%;
}
.upload-example-img {
    border: 1px solid #eee;
    border-radius: 8px;
    display: block;
    height: auto;
    margin: 0 auto;
    max-width: 100% !important;
    object-fit: contain;
    width: 100% !important;
}

/* ── Upload Zone ── */
.doc-upload-zone {
    border: 2px dashed #e0b5b5;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background: #fff9f9;
    transition: all 0.2s;
    position: relative;
}
.doc-upload-zone:hover,
.doc-upload-zone.dragover {
    border-color: #d82027;
    background: #fff4f4;
}
.doc-upload-zone.uploaded {
    border-color: #1a8f00;
    border-style: solid;
    background: #f4fff1;
}
.doc-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.doc-upload-zone-text {
    font-size: 0.78rem;
    color: #888;
    font-weight: 500;
}
.doc-upload-zone-hint {
    font-size: 0.68rem;
    color: #bbb;
    margin-top: 3px;
}
.doc-upload-zone.uploaded .doc-upload-zone-text {
    color: #1a8f00;
    font-weight: 600;
}

/* ── File preview chips ── */
.doc-file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.doc-file-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    color: #444;
    max-width: 200px;
    overflow: hidden;
}
.doc-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-file-chip-remove {
    cursor: pointer;
    color: #d82027;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    font-size: 0.9rem;
}
.doc-file-chip.pdf-chip {
    background: #fff3f3;
    border-color: #f5c6c6;
    color: #c62828;
}
.doc-file-chip.img-chip {
    background: #f0f7ff;
    border-color: #c6d8f5;
    color: #1565c0;
}
.chip-compressed {
    font-size: 0.6rem;
    color: #e65100;
    font-weight: 500;
    margin-left: 2px;
}

/* ── Bank Statement Grid (6 months) ── */
.bank-stmt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}
.bank-stmt-item {
    background: #fff;
    border: 1.5px solid #eedede;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: border-color 0.2s;
    position: relative;
}
.bank-stmt-item.has-file {
    border-color: #1a8f00;
    background: #f4fff1;
}
.bank-stmt-month {
    font-size: 0.72rem;
    font-weight: 600;
    color: #c62828;
    margin-bottom: 6px;
}
.bank-stmt-upload-zone {
    position: relative;
    border: 1.5px dashed #e0b5b5;
    border-radius: 8px;
    padding: 10px 6px;
    cursor: pointer;
    background: #fff9f9;
    transition: all 0.2s;
}
.bank-stmt-upload-zone:hover {
    border-color: #d82027;
    background: #fff4f4;
}
.bank-stmt-item.has-file .bank-stmt-upload-zone {
    border-color: #1a8f00;
    border-style: solid;
    background: #f4fff1;
}
.bank-stmt-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.bank-stmt-text {
    font-size: 0.65rem;
    color: #aaa;
    line-height: 1.3;
}
.bank-stmt-item.has-file .bank-stmt-text {
    color: #1a8f00;
    font-weight: 600;
    font-size: 0.62rem;
}
.bank-stmt-filename {
    display: none;
    font-size: 0.62rem;
    color: #1a8f00;
    margin-top: 4px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}
.bank-stmt-item.has-file .bank-stmt-filename {
    display: block;
}
.bank-stmt-checkmark {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #1a8f00;
    border-radius: 50%;
    color: #fff;
    font-size: 0.65rem;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.bank-stmt-item.has-file .bank-stmt-checkmark {
    display: flex;
}

/* ── Progress summary ── */
.doc-progress-bar-wrap {
    background: #f5f5f5;
    border-radius: 30px;
    height: 6px;
    margin: 8px 0 4px;
    overflow: hidden;
}
.doc-progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #d82027, #ff5252);
    border-radius: 30px;
    transition: width 0.4s ease;
}
.doc-progress-label {
    font-size: 0.72rem;
    color: #888;
    text-align: right;
}
.doc-progress-label span {
    color: #d82027;
    font-weight: 700;
}

/* ── Submit button ── */
.step6-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 0 10px;
    margin-top: auto;
}

/* ── Phone verify instruction box ── */
.phone-verify-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.phone-verify-box-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 4px;
}
.phone-verify-box-code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #b71c1c;
    background: #fff;
    border: 1px solid #f5c6c6;
    border-radius: 6px;
    padding: 4px 12px;
    display: inline-block;
    margin: 4px 0;
    letter-spacing: 2px;
}
.phone-verify-box-desc {
    font-size: 0.72rem;
    color: #666;
    margin-top: 4px;
}

/* ── Optional tag ── */
.optional-tag {
    font-size: 0.65rem;
    color: #888;
    font-weight: 400;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 4px;
}
.required-tag {
    font-size: 0.65rem;
    color: #c62828;
    font-weight: 700;
    margin-left: 2px;
}

/* ── Scrollable container ── */
.step6-scroll-content {
    padding: 0 24px 24px;
    flex: 1;
    overflow-y: auto;
}

/* ── Skip note ── */
.doc-skip-note {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.72rem;
    color: #888;
    text-align: center;
    margin-top: 8px;
}
