/* =======================================================
   KYC — Etapa Documento (Pixel match Figma Desktop & Mobile)
   Scoped strictly to .kyc-page--documento
   ======================================================= */

/* Card base & Layout */
.kyc-page--documento .kyc-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1080px;
    height: 680px;
    max-height: calc(100vh - 48px);
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

/* Coluna Esquerda: Sidebar */
.kyc-page--documento .kyc-card-sidebar {
    flex: 0 0 500px;
    max-width: 500px;
    width: 48%;
    display: flex;
    flex-direction: column;
    padding: 32px 36px;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid #F3F4F6;
    background: #FFFFFF;
    min-width: 0;
}

/* Timeline Vertical na Sidebar */
.kyc-page--documento .kyc-vstep {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    margin-top: 8px;
    min-height: 0;
}

.kyc-page--documento .kyc-vstep-item {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    column-gap: 14px !important;
    align-items: stretch !important;
    min-height: fit-content !important;
    flex-shrink: 0 !important;
}

.kyc-page--documento .kyc-vstep-body {
    display: flex !important;
    gap: 12px !important;
    align-items: flex-start !important;
    padding-bottom: 16px !important;
    min-width: 0 !important;
}

.kyc-page--documento .kyc-vstep-icon,
.kyc-page--documento .kyc-vstep-icon img {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0 !important;
}

.kyc-page--documento .kyc-vstep-title {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
    color: #3F3F3F;
    margin: 0 0 2px 0;
}

.kyc-page--documento .kyc-vstep-desc {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.35;
    color: #888888;
    margin: 0;
}

/* Coluna Direita: Main Content */
.kyc-page--documento .kyc-card-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 32px 36px;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    position: relative;
    background: #FFFFFF;
    min-width: 0;
}

.kyc-page--documento .kyc-card-main-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Títulos do Painel Principal */
.kyc-page--documento .kyc-main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.kyc-page--documento .kyc-main-title {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    color: #3F3F3F;
    margin: 0 0 8px 0;
    text-align: center;
}

.kyc-page--documento .kyc-main-subtitle {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #888888;
    margin: 0 auto 20px;
    text-align: center;
    max-width: 440px;
}

/* Grid das Upload Zones (Lado a lado no Desktop) */
.kyc-page--documento .kyc-upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
    width: 100%;
}

/* Card Upload Zone */
.kyc-page--documento .kyc-upload-zone {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}

.kyc-page--documento .kyc-upload-zone:hover {
    border-color: #CBD5E1;
}

.kyc-page--documento .kyc-upload-zone--drag {
    border-color: #0EA5E9 !important;
    background: #F0F9FF !important;
}

.kyc-page--documento .kyc-upload-zone .kyc-upload-input {
    display: none;
}

.kyc-page--documento .kyc-upload-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.kyc-page--documento .kyc-upload-title {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    color: #3F3F3F;
    margin: 0 0 4px 0;
    text-align: center;
    word-break: break-word;
}

.kyc-page--documento .kyc-upload-desc {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    color: #888888;
    margin: 0 0 4px 0;
    max-width: 100%;
}

.kyc-page--documento .kyc-upload-hint {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #9CA3AF;
    margin: 0 0 12px 0;
}

/* Botão Enviar/Substituir no Card */
.kyc-page--documento .kyc-btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    border: 1px solid #4B5563;
    border-radius: 100px;
    background: transparent;
    color: #374151;
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: auto;
    white-space: nowrap;
}

.kyc-page--documento .kyc-btn-upload:hover:not(.kyc-btn-upload--disabled) {
    background: #F9FAFB;
    border-color: #111827;
}

.kyc-page--documento .kyc-btn-upload--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card com Arquivo Enviado (Preview) */
.kyc-page--documento .kyc-upload-file {
    width: 100%;
    background: #FAFAFA;
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 10px 0;
    text-align: left;
    min-width: 0;
}

.kyc-page--documento .kyc-upload-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #E5E7EB;
}

.kyc-page--documento .kyc-upload-file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.kyc-page--documento .kyc-upload-file-name {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #1F2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kyc-page--documento .kyc-upload-file-size {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 9.5px;
    color: #6B7280;
    margin: 1px 0;
}

.kyc-page--documento .kyc-upload-file-status {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 9.5px;
    font-weight: 500;
    color: #10B981;
}

/* Info Box (Avisos amarelo e verde) */
.kyc-page--documento .kyc-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 4px;
    box-sizing: border-box;
    width: 100%;
}

.kyc-page--documento .kyc-info-box--warning {
    background: #FFFBEB;
    border: 1px solid #FEF3C7;
}

.kyc-page--documento .kyc-info-box--warning p {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11.5px;
    line-height: 1.4;
    color: #92400E;
    margin: 0;
}

.kyc-page--documento .kyc-info-box--success {
    background: #F0FDF4;
    border: 1px solid #DCFCE7;
}

.kyc-page--documento .kyc-info-box--success p {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 11.5px;
    line-height: 1.4;
    color: #166534;
    margin: 0;
}

.kyc-page--documento .kyc-info-box-icon-img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Rodapé / Ações (Avançar e Pular) */
.kyc-page--documento .kyc-footer-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: auto !important;
    padding-top: 14px !important;
}

.kyc-page--documento .kyc-footer-actions .kyc-btn-secondary {
    flex: 1 1 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    background: #FFFFFF !important;
    color: #374151 !important;
    border: 1px solid #4B5563 !important;
    border-radius: 6.85px !important;
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
}

.kyc-page--documento .kyc-footer-actions .kyc-btn-secondary:hover:not(:disabled) {
    background: #F9FAFB !important;
    border-color: #111827 !important;
}

.kyc-page--documento .kyc-footer-actions .kyc-btn-primary {
    flex: 1 1 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    background: #0EA5E9 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 6.85px !important;
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: background 0.15s ease !important;
    box-sizing: border-box !important;
}

.kyc-page--documento .kyc-footer-actions .kyc-btn-primary:hover:not(:disabled) {
    background: #0284C7 !important;
}

.kyc-page--documento .kyc-footer-actions .kyc-btn-primary:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
}

/* Painel de Resultados (Sucesso / Erro) */
.kyc-page--documento .kyc-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    width: 100%;
    padding: 16px 0;
}

.kyc-page--documento .kyc-result-illustration {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kyc-page--documento .kyc-result-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.kyc-page--documento .kyc-result-title {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    color: #3F3F3F;
    margin: 0 0 10px 0;
    max-width: 440px;
}

.kyc-page--documento .kyc-result-desc {
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.4;
    color: #888888;
    margin: 0 auto 28px;
    max-width: 440px;
}

.kyc-page--documento .kyc-result-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 440px !important;
    margin-top: auto !important;
}

.kyc-page--documento .kyc-result-actions .kyc-btn-result {
    flex: 1 1 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    background: #0EA5E9 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 6.85px !important;
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.kyc-page--documento .kyc-result-actions .kyc-btn-result:hover:not(:disabled) {
    background: #0284C7 !important;
}

.kyc-page--documento .kyc-result-actions .kyc-btn-outline-result {
    flex: 1 1 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    background: #FFFFFF !important;
    color: #374151 !important;
    border: 1px solid #4B5563 !important;
    border-radius: 6.85px !important;
    font-family: 'Work Sans', 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* =======================================================
   Tablets / Laptops Intermediários (768px – 1079px)
   ======================================================= */
@media (min-width: 768px) and (max-width: 1079px) {
    .kyc-page--documento .kyc-card {
        max-width: calc(100vw - 32px);
        width: 100%;
        height: auto;
        min-height: 580px;
        max-height: calc(100vh - 32px);
    }

    .kyc-page--documento .kyc-card-sidebar {
        flex: 0 0 42%;
        max-width: 420px;
        min-width: 280px;
        padding: 24px 24px;
    }

    .kyc-page--documento .kyc-sidebar-title {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .kyc-page--documento .kyc-sidebar-subtitle {
        font-size: 11.5px;
        margin-bottom: 12px;
    }

    .kyc-page--documento .kyc-vstep-icon,
    .kyc-page--documento .kyc-vstep-icon img {
        width: 36px !important;
        height: 36px !important;
    }

    .kyc-page--documento .kyc-vstep-title {
        font-size: 13px;
    }

    .kyc-page--documento .kyc-vstep-desc {
        font-size: 11px;
    }

    .kyc-page--documento .kyc-card-main {
        flex: 1 1 58%;
        padding: 24px 24px;
    }

    .kyc-page--documento .kyc-main-title {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .kyc-page--documento .kyc-main-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .kyc-page--documento .kyc-upload-row {
        gap: 10px;
    }

    .kyc-page--documento .kyc-upload-zone {
        padding: 14px 8px;
    }

    .kyc-page--documento .kyc-upload-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }

    .kyc-page--documento .kyc-upload-title {
        font-size: 12px;
    }

    .kyc-page--documento .kyc-upload-desc {
        font-size: 10.5px;
    }

    .kyc-page--documento .kyc-upload-hint {
        font-size: 9.5px;
        margin-bottom: 8px;
    }

    .kyc-page--documento .kyc-btn-upload {
        padding: 4px 12px;
        font-size: 11px;
    }

    .kyc-page--documento .kyc-footer-actions {
        padding-top: 12px !important;
    }

    .kyc-page--documento .kyc-footer-actions .kyc-btn-primary,
    .kyc-page--documento .kyc-footer-actions .kyc-btn-secondary {
        height: 38px !important;
        min-height: 38px !important;
        font-size: 13px !important;
    }
}

/* =======================================================
   Mobile Layout (≤ 767px — Figma 40013033:1189, 40013038:1676, etc.)
   ======================================================= */
@media (max-width: 767px) {
    .kyc-page--documento .kyc-card {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: #FFFFFF !important;
    }

    .kyc-page--documento .kyc-card-sidebar {
        display: none !important;
    }

    .kyc-page--documento .kyc-mobile-top {
        display: block !important;
        padding: 16px 18px 0 !important;
        background: #FFFFFF !important;
    }

    .kyc-page--documento .kyc-mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .kyc-page--documento .kyc-mobile-etapa {
        font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
        font-size: 12px;
        font-weight: 600;
        color: #0EA5E9;
        text-align: center;
        margin: 12px 0 16px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Stepper horizontal mobile */
    .kyc-page--documento .kyc-mstep {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 24px;
    }

    .kyc-page--documento .kyc-mstep-circle {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
        font-size: 13px;
        font-weight: 600;
        background: #E5E7EB;
        color: #9CA3AF;
        flex-shrink: 0;
    }

    .kyc-page--documento .kyc-mstep-circle--active {
        background: #0EA5E9;
        color: #FFFFFF;
    }

    .kyc-page--documento .kyc-mstep-circle--done {
        background: #0EA5E9;
        color: #FFFFFF;
    }

    .kyc-page--documento .kyc-mstep-line {
        flex: 1;
        max-width: 48px;
        height: 2px;
        background: #E5E7EB;
        margin: 0 4px;
    }

    .kyc-page--documento .kyc-mstep-line--active {
        background: #0EA5E9;
    }

    .kyc-page--documento .kyc-card-main {
        flex: 1 1 auto !important;
        width: 100% !important;
        padding: 0 18px 24px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .kyc-page--documento .kyc-main-title {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .kyc-page--documento .kyc-main-subtitle {
        font-size: 13.5px;
        margin-bottom: 20px;
    }

    /* Upload Zones empilhadas no mobile */
    .kyc-page--documento .kyc-upload-row {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 16px;
    }

    .kyc-page--documento .kyc-upload-zone {
        padding: 20px 16px;
    }

    .kyc-page--documento .kyc-footer-actions {
        flex-direction: column !important;
        gap: 8px !important;
        padding-top: 16px !important;
        margin-top: auto !important;
    }

    .kyc-page--documento .kyc-footer-actions .kyc-btn-primary,
    .kyc-page--documento .kyc-footer-actions .kyc-btn-secondary {
        width: 100% !important;
        flex: none !important;
        height: 44px !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }

    .kyc-page--documento .kyc-result-illustration {
        width: 140px;
        height: 140px;
        margin-bottom: 20px;
    }

    .kyc-page--documento .kyc-result-title {
        font-size: 24px;
        line-height: 1.25;
    }

    .kyc-page--documento .kyc-result-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .kyc-page--documento .kyc-result-actions .kyc-btn-result,
    .kyc-page--documento .kyc-result-actions .kyc-btn-outline-result {
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
    }
}

/* =======================================================
   Alturas Baixas no Desktop (max-height ≤ 740px)
   ======================================================= */
@media (min-width: 768px) and (max-height: 740px) {
    .kyc-page--documento .kyc-card {
        height: calc(100vh - 32px);
        min-height: 0;
    }

    .kyc-page--documento .kyc-card-sidebar {
        padding: 16px 20px;
    }

    .kyc-page--documento .kyc-sidebar-title {
        font-size: 19px;
        margin-bottom: 4px;
    }

    .kyc-page--documento .kyc-sidebar-subtitle {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .kyc-page--documento .kyc-vstep {
        gap: 0;
        overflow-y: auto;
    }

    .kyc-page--documento .kyc-vstep-item {
        flex-shrink: 0 !important;
        min-height: fit-content !important;
    }

    .kyc-page--documento .kyc-vstep-body {
        padding-bottom: 10px !important;
    }

    .kyc-page--documento .kyc-vstep-icon,
    .kyc-page--documento .kyc-vstep-icon img {
        width: 32px !important;
        height: 32px !important;
    }

    .kyc-page--documento .kyc-vstep-title {
        font-size: 12.5px;
    }

    .kyc-page--documento .kyc-vstep-desc {
        font-size: 10.5px;
    }

    .kyc-page--documento .kyc-card-main {
        padding: 16px 24px;
    }

    .kyc-page--documento .kyc-main-title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .kyc-page--documento .kyc-main-subtitle {
        font-size: 11.5px;
        margin-bottom: 12px;
    }

    .kyc-page--documento .kyc-upload-zone {
        padding: 12px 8px;
    }

    .kyc-page--documento .kyc-upload-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 4px;
    }

    .kyc-page--documento .kyc-upload-title {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .kyc-page--documento .kyc-upload-desc {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .kyc-page--documento .kyc-upload-hint {
        font-size: 9px;
        margin-bottom: 6px;
    }

    .kyc-page--documento .kyc-footer-actions {
        padding-top: 10px !important;
    }

    .kyc-page--documento .kyc-footer-actions .kyc-btn-primary,
    .kyc-page--documento .kyc-footer-actions .kyc-btn-secondary {
        height: 36px !important;
        min-height: 36px !important;
        font-size: 12.5px !important;
    }
}

/* O documento possui dois cards de upload e pode ultrapassar a altura do
   celular. Deixa o card/main crescerem com o conteúdo para que o .kyc-page
   consiga rolar até o rodapé, sem cortar o segundo upload. */
@media (max-width: 767px) {
    .kyc-page.kyc-page--documento:not(.kyc-page--intro):not(.kyc-page--success) .kyc-card {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .kyc-page.kyc-page--documento:not(.kyc-page--intro):not(.kyc-page--success) .kyc-card-main {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .kyc-page.kyc-page--documento:not(.kyc-page--intro):not(.kyc-page--success) .kyc-card-main-inner {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .kyc-page--documento .kyc-card-footer {
        flex: 0 0 auto !important;
    }

    .kyc-page--documento .kyc-footer-actions {
        margin-top: 16px !important;
    }
}
