/* DOCUMENT MANAGER */
.documents-manager {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: visible;
}

/* HEADER */
.documents-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.documents-title h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: #1D1D1F;
}

.documents-title p {
    margin: 0;
    color: #6B7280;
    font-size: .95rem;
    line-height: 1.6;
}

/* TABS BAR */
.documents-tabs-bar {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* NAVIGATION WRAPPER */
.documents-navigation-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.documents-navigation-wrapper::-webkit-scrollbar {
    display: none;
}

.documents-navigation-wrapper::before,
.documents-navigation-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 48px;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 1;
}

.documents-navigation-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--white-green), rgba(245, 251, 247, 0));
}

.documents-navigation-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--white-green), rgba(245, 251, 247, 0));
}

.documents-navigation-wrapper.can-scroll-left::before,
.documents-navigation-wrapper.can-scroll-right::after {
    opacity: 1;
}

.documents-tabs-bar.has-prev-arrow .documents-navigation-wrapper {
    padding-left: 36px;
}

.documents-tabs-bar.has-next-arrow .documents-navigation-wrapper {
    padding-right: 36px;
}

/* SCROLL ARROWS (desktop) */
.documents-tabs-arrow {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
    color: #94A3B8;
    box-shadow: 0 1px 6px rgba(15, 23, 42, .08);
    cursor: pointer;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    transition: color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.documents-tabs-arrow:hover {
    color: var(--secondary-green);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .12);
}

.documents-tabs-arrow:focus-visible {
    outline: 2px solid rgba(94, 202, 142, .35);
    outline-offset: 2px;
}

.documents-tabs-arrow--prev {
    left: 6px;
}

.documents-tabs-arrow--next {
    right: 0;
}

@media (min-width: 769px) {
    .documents-tabs-arrow:not([hidden]) {
        display: flex;
    }

    .documents-navigation-wrapper {
        padding-inline: 4px;
    }
}

/* ADD DOCUMENT PICKER */
.document-add-picker {
    position: fixed;
    z-index: 1000;
    min-width: 240px;
    max-width: calc(100vw - 24px);
    padding: 14px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
    transform: translateX(-50%);
}

.document-add-picker p {
    margin: 0 0 10px;
    font-size: .85rem;
    color: #6B7280;
}

.document-add-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: #1F2937;
}

.document-add-option:hover,
.document-add-option:focus-visible {
    background: #F8FFF3;
    outline: none;
}

.document-add-option img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* NAVIGATION */
.documents-navigation {
    display: flex;
    gap: 18px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 6px;
}

/* DOCUMENT TAB */
.document-tab {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--white);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    scroll-snap-align: start;
}

.document-tab:hover {
    border-color: var(--secondary-green);
    z-index: 3;
}

.document-tab:active {
    transform: scale(.96);
}

.document-tab.active {
    border-color: var(--secondary-green);
    background: #F8FFF3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.document-tab.active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 10px;
    height: 4px;
    border-radius: 999px;
    background: var(--secondary-green);
}

/* STATUS */
.document-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--light-grey);
}

.document-status.completed {
    background: var(--secondary-green);
}

.document-status.warning {
    background: #F59E0B;
}

.document-status.error {
    background: #EF4444;
}

/* ICON */
.document-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .25s ease;
}

.document-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.document-tab:hover .document-icon {
    transform: translateY(-2px);
}

/* ADD BUTTON */
.document-tab-add {
    border: 2px dashed #CBD5E1;
    background: #FCFCFD;
}

.document-tab-add:hover {
    background: #F6FFF2;
    border-style: solid;
}

.document-tab-add .document-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px dashed var(--secondary-green);
    color: var(--secondary-green);
}

.document-tab-add:hover .document-icon {
    transform: rotate(90deg);
}

/* DOCUMENT CARD */
.document-card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
}

.document-delete-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    border: none;
    background: transparent;
    color: var(--secondary-green);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: color .2s ease;
    font-family: var(--primary-font);
}

.document-delete-btn:hover,
.document-delete-btn:focus-visible {
    color: var(--secondary-green);
    outline: none;
}

.document-delete-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.document-card:hover {
    box-shadow: 0 22px 50px rgba(15, 23, 42, .08);
}

.document-card-body {
    padding: 20px;
}

.document-card-body::-webkit-scrollbar {
    width: 8px;
}

.document-card-body::-webkit-scrollbar-thumb {
    background: #D6DCE5;
    border-radius: 999px;
}

.personal-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.field-full {
    grid-column: 1 / -1;
}

.field-half {
    grid-column: span 1;
}

.document-divider {
    grid-column: 1/-1;
    height: 1px;
    background: #EEF2F7;
    margin: 6px 0;
}

/* DOCUMENT STATE BADGES */
.document-state {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
}

.document-state::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.document-state.completed {
    background: #ECFDF5;
    color: #15803D;
}

.document-state.completed::before {
    background: #22C55E;
}

.document-state.warning {
    background: #FEF3C7;
    color: #B45309;
}

.document-state.warning::before {
    background: #F59E0B;
}

.document-state.error {
    background: #FEE2E2;
    color: #B91C1C;
}

.document-state.error::before {
    background: #EF4444;
}

/* EMPTY STATE */
.document-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex: 1;
    text-align: center;
    color: #94A3B8;
}

.document-empty img {
    width: 90px;
    opacity: .5;
}

.document-empty h4 {
    margin: 0;
    color: #475569;
    font-size: 1.2rem;
}

.document-empty p {
    margin: 0;
    max-width: 420px;
    line-height: 1.6;
}

/* LOADING */
/*REMOVER SE NAO FOR NECESSARIO LOADING*/
.document-card.loading {
    pointer-events: none;
}

.document-card.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
    animation: loading 1.3s infinite;
}

/* ANIMATIONS */
/*REMOVER SE NAO FOR NECESSARIO LOADING*/
@keyframes loading {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* RESPONSIVE */
@media(max-width:992px) {
    .document-state {
        position: static;
        margin-top: 18px;
    }
}

@media(max-width:768px) {
    .documents-navigation-wrapper {
        scroll-snap-type: x proximity;
        margin-inline: -4px;
        padding-inline: 4px;
    }

    .documents-manager {
        gap: 20px;
    }

    .documents-header {
        gap: 12px;
    }

    .documents-title h2 {
        font-size: 1.35rem;
    }

    .documents-title p {
        font-size: .88rem;
    }

    .document-tab {
        width: 82px;
        height: 82px;
    }

    .document-card {
        border-radius: 22px;
    }

    .document-card-body {
        padding: 22px;
    }

    .personal-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .field-half {
        grid-column: 1;
    }
}

@media(max-width:480px) {
    .documents-navigation {
        gap: 14px;
    }

    .document-tab {
        width: 74px;
        height: 74px;
    }

    .document-icon img {
        width: 24px;
        height: 24px;
    }

    .document-card {
        border-radius: 18px;
    }

    .document-card-body {
        padding: 18px;
    }
}