﻿

/* Base */
.ib-idp-page {
    max-width: 980px;
    margin: 35px auto;
    padding: 0 15px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #1f2d3d;
}

.ib-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.10);
    padding: 26px;
}

.ib-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.ib-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
}

.ib-brand-a {
    color: #2f4050;
}

.ib-brand-b {
    color: #1ab394;
}

.ib-pill {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(26,179,148,.10);
    border: 1px solid rgba(26,179,148,.25);
    color: #1ab394;
    letter-spacing: .5px;
}

.ib-sub {
    font-size: 12.5px;
    color: rgba(47,64,80,.65);
}

.ib-title {
    margin: 10px 0 8px;
    font-size: 26px;
    line-height: 1.15;
    color: #1f2d3d;
}

.ib-desc {
    margin: 0 0 18px;
    color: rgba(47,64,80,.70);
    max-width: 760px;
}

.ib-drop {
    border: 1px dashed rgba(47,64,80,.35);
    background: #fafbfd;
    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    transition: .15s ease;
}

    .ib-drop:hover {
        border-color: rgba(26,179,148,.55);
        background: #f6fffc;
    }

    .ib-drop.dragover {
        border-color: rgba(26,179,148,.85);
        background: #ecfffa;
    }

    .ib-drop:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(26,179,148,.12);
    }

.ib-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.ib-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26,179,148,.10);
    border: 1px solid rgba(26,179,148,.25);
    color: #1ab394;
    font-weight: 900;
    font-size: 18px;
}

.ib-drop-title {
    font-weight: 800;
    color: #1f2d3d;
    font-size: 15px;
}

.ib-drop-sub {
    color: rgba(47,64,80,.65);
    font-size: 13px;
}

.ib-file {
    margin-top: 16px;
    border: 1px solid rgba(0,0,0,.07);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
}

.ib-file-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.ib-file-name {
    font-weight: 800;
    color: #1f2d3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ib-file-size {
    font-size: 12.5px;
    color: rgba(47,64,80,.60);
    white-space: nowrap;
}

.ib-file-hint {
    margin-top: 6px;
    font-size: 12.5px;
    color: rgba(47,64,80,.65);
}

.ib-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.ib-btn {
    background: #1ab394;
    border: 1px solid rgba(26,179,148,.35);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .15s ease;
}

    .ib-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .ib-btn:not(:disabled):hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 18px rgba(26,179,148,.15);
    }

.ib-btn-ghost {
    background: #fff;
    border: 1px solid rgba(47,64,80,.20);
    color: #2f4050;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .15s ease;
}

    .ib-btn-ghost:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .ib-btn-ghost:not(:disabled):hover {
        transform: translateY(-1px);
        border-color: rgba(47,64,80,.35);
    }

.ib-result {
    margin-top: 18px;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: #fbfbfc;
    font-weight: 800;
}

.ib-ok {
    color: #1ab394;
}

.ib-bad {
    color: #ed5565;
}

.ib-info {
    color: #1c84c6;
}

/* Modal */
.ib-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.40);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.ib-modal-card {
    width: 520px;
    max-width: 100%;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 25px 60px rgba(0,0,0,.20);
    padding: 18px;
}

.ib-modal-title {
    font-weight: 900;
    font-size: 16px;
    color: #1f2d3d;
    margin-bottom: 6px;
}

.ib-modal-text {
    color: rgba(47,64,80,.75);
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.45;
}

.ib-modal-file {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    background: #fbfbfc;
    color: #1f2d3d;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ib-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

/* Processing overlay */
.ib-processing {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.ib-processing-card {
    width: 720px;
    max-width: 100%;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 25px 60px rgba(0,0,0,.20);
    padding: 22px;
    text-align: center;
}

.ib-processing-title {
    font-weight: 900;
    color: #1f2d3d;
    margin-top: 10px;
}

.ib-processing-sub {
    color: rgba(47,64,80,.70);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.4;
}

.ib-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.08);
    overflow: hidden;
    margin-top: 14px;
    position: relative;
}

    .ib-bar span {
        position: absolute;
        left: -40%;
        top: 0;
        height: 100%;
        width: 40%;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(26,179,148,0), rgba(26,179,148,.60), rgba(28,132,198,.45), rgba(26,179,148,0));
        animation: ibBar 1.2s ease-in-out infinite;
    }

@keyframes ibBar {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(140%);
    }

    100% {
        transform: translateX(280%);
    }
}

/* =========================================================
       ✅ SCANNER ANIMATION (namespaced)
       ========================================================= */
.ib-scan-wrap {
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: radial-gradient(900px circle at 10% 0%, rgba(26,179,148,.08), transparent 45%), radial-gradient(900px circle at 90% 20%, rgba(28,132,198,.08), transparent 45%), linear-gradient(135deg, #fbfbfc, #ffffff);
    box-shadow: 0 14px 34px rgba(0,0,0,.10);
    padding: 16px;
    text-align: left;
}

.ib-scan-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.ib-scan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(26,179,148,.10);
    border: 1px solid rgba(26,179,148,.22);
    color: #1ab394;
    font-weight: 900;
    letter-spacing: .4px;
    font-size: 11.5px;
}

.ib-scan-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1ab394;
    box-shadow: 0 0 0 0 rgba(26,179,148,.35);
    animation: ibScanPulse 1.2s ease-in-out infinite;
}

@keyframes ibScanPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(26,179,148,.35);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(26,179,148,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(26,179,148,0);
    }
}

.ib-scan-title {
    font-weight: 950;
    color: #1f2d3d;
    font-size: 14px;
}

.ib-scan-sub {
    font-weight: 700;
    color: rgba(47,64,80,.70);
    font-size: 12.5px;
}

.ib-scan-stage {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 14px;
    align-items: stretch;
}

.ib-scan-paper {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: linear-gradient(180deg, #ffffff, #fbfbfc);
    height: 190px;
    overflow: hidden;
    box-shadow: inset 0 12px 30px rgba(0,0,0,.05);
}

.ib-scan-lines {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: .95;
}

    .ib-scan-lines span {
        height: 8px;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(47,64,80,.16), rgba(47,64,80,.08));
        position: relative;
        overflow: hidden;
    }

        .ib-scan-lines span.short {
            width: 62%;
        }

        .ib-scan-lines span::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(26,179,148,.22), transparent);
            transform: translateX(-120%);
            animation: ibOcrSweep 1.9s ease-in-out infinite;
        }

        .ib-scan-lines span:nth-child(2)::after {
            animation-delay: .10s;
        }

        .ib-scan-lines span:nth-child(3)::after {
            animation-delay: .20s;
        }

        .ib-scan-lines span:nth-child(4)::after {
            animation-delay: .30s;
        }

        .ib-scan-lines span:nth-child(5)::after {
            animation-delay: .40s;
        }

        .ib-scan-lines span:nth-child(6)::after {
            animation-delay: .50s;
        }

        .ib-scan-lines span:nth-child(7)::after {
            animation-delay: .60s;
        }

        .ib-scan-lines span:nth-child(8)::after {
            animation-delay: .70s;
        }

        .ib-scan-lines span:nth-child(9)::after {
            animation-delay: .80s;
        }

        .ib-scan-lines span:nth-child(10)::after {
            animation-delay: .90s;
        }

        .ib-scan-lines span:nth-child(11)::after {
            animation-delay: 1.00s;
        }

        .ib-scan-lines span:nth-child(12)::after {
            animation-delay: 1.10s;
        }

        .ib-scan-lines span:nth-child(13)::after {
            animation-delay: 1.20s;
        }

@keyframes ibOcrSweep {
    0% {
        transform: translateX(-120%);
        opacity: .0;
    }

    20% {
        opacity: .9;
    }

    50% {
        opacity: .6;
    }

    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

.ib-scan-corners i {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(26,179,148,.55);
    border-right: none;
    border-bottom: none;
    border-radius: 6px 0 0 0;
    opacity: .0;
    animation: ibCornerLock 2.0s ease-in-out infinite;
}

    .ib-scan-corners i.c1 {
        left: 10px;
        top: 10px;
    }

    .ib-scan-corners i.c2 {
        right: 10px;
        top: 10px;
        transform: rotate(90deg);
    }

    .ib-scan-corners i.c3 {
        right: 10px;
        bottom: 10px;
        transform: rotate(180deg);
    }

    .ib-scan-corners i.c4 {
        left: 10px;
        bottom: 10px;
        transform: rotate(270deg);
    }

@keyframes ibCornerLock {
    0% {
        opacity: 0;
        filter: blur(.4px);
    }

    25% {
        opacity: 1;
    }

    50% {
        opacity: .85;
    }

    100% {
        opacity: 1;
    }
}

.ib-scan-beam {
    position: absolute;
    left: -10%;
    right: -10%;
    height: 46px;
    top: -46px;
    background: linear-gradient(180deg, rgba(26,179,148,0), rgba(26,179,148,.18), rgba(28,132,198,.10), rgba(26,179,148,0));
    filter: blur(.2px);
    animation: ibBeam 2.4s ease-in-out infinite;
    mix-blend-mode: multiply;
}

.ib-scan-glow {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    top: 0;
    background: rgba(26,179,148,.55);
    box-shadow: 0 0 18px rgba(26,179,148,.45);
    animation: ibGlow 2.4s ease-in-out infinite;
    opacity: .0;
}

@keyframes ibBeam {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(250px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes ibGlow {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: .9;
    }

    50% {
        transform: translateY(190px);
        opacity: .7;
    }

    90% {
        opacity: .9;
    }

    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

.ib-scan-side {
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.75);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ib-scan-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

    .ib-scan-metric .k {
        font-weight: 900;
        color: #1f2d3d;
        font-size: 12.5px;
    }

    .ib-scan-metric .v {
        font-weight: 900;
        color: rgba(47,64,80,.75);
        font-size: 12px;
        display: flex;
        gap: 8px;
        align-items: center;
    }

.ib-scan-pill {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

    .ib-scan-pill.ok {
        background: #1ab394;
        box-shadow: 0 0 0 0 rgba(26,179,148,.30);
        animation: ibPill 1.6s ease-in-out infinite;
    }

    .ib-scan-pill.run {
        background: #1c84c6;
        box-shadow: 0 0 0 0 rgba(28,132,198,.25);
        animation: ibPill 1.0s ease-in-out infinite;
    }

    .ib-scan-pill.wait {
        background: rgba(47,64,80,.25);
    }

@keyframes ibPill {
    0% {
        box-shadow: 0 0 0 0 rgba(26,179,148,.30);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(26,179,148,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(26,179,148,0);
    }
}

.ib-scan-progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.08);
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.ib-scan-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(26,179,148,0), rgba(26,179,148,.75), rgba(28,132,198,.55), rgba(26,179,148,0));
    animation: ibProg 1.25s ease-in-out infinite;
}

@keyframes ibProg {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(160%);
    }

    100% {
        transform: translateX(320%);
    }
}

.ib-scan-hint {
    font-size: 12px;
    font-weight: 800;
    color: rgba(47,64,80,.65);
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed rgba(0,0,0,.10);
}

@media (max-width: 720px) {
    .ib-scan-stage {
        grid-template-columns: 1fr;
    }

    .ib-processing-card {
        width: 560px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ib-scan-dot, .ib-scan-lines span::after, .ib-scan-corners i,
    .ib-scan-beam, .ib-scan-glow, .ib-scan-pill.ok, .ib-scan-pill.run,
    .ib-scan-progress-bar, .ib-bar span {
        animation: none !important;
    }
}


