/*
 * ==========================================================
 * VehicleWatch registration plate viewer
 * ==========================================================
 *
 * This is a VehicleWatch visual representation of a recorded
 * registration. It deliberately does not reproduce government
 * logos, slogans or official plate artwork.
 */


/*
 * ----------------------------------------------------------
 * Small plate shown in search results / case pages
 * ----------------------------------------------------------
 */

.vw-plate-trigger {
    --vw-plate-accent:
        #334155;

    appearance:
        none;

    -webkit-appearance:
        none;

    position:
        relative;

    display:
        inline-flex;

    align-items:
        center;

    gap:
        9px;

    min-width:
        150px;

    max-width:
        100%;

    margin:
        3px
        0
        2px;

    padding:
        7px
        11px;

    border:
        2px solid #1f2937;

    border-radius:
        7px;

    background:
        #ffffff;

    color:
        #111827;

    box-shadow:
        inset 0 4px 0
        var(--vw-plate-accent),
        0 1px 2px
        rgba(15,23,42,.10);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    cursor:
        pointer;

    text-align:
        left;
}


.vw-plate-trigger:hover,
.vw-plate-trigger:focus {
    background:
        #f8fafc;

    border-color:
        #0f172a;

    transform:
        translateY(-1px);
}


.vw-plate-trigger:focus-visible {
    outline:
        3px solid
        rgba(37,99,235,.30);

    outline-offset:
        2px;
}


.vw-plate-mini-state {
    flex:
        0 0 auto;

    color:
        var(--vw-plate-accent);

    font-size:
        9px;

    font-weight:
        900;

    line-height:
        1;

    letter-spacing:
        .06em;

    text-transform:
        uppercase;
}


.vw-plate-mini-registration {
    min-width:
        0;

    overflow:
        hidden;

    color:
        #111827;

    font-size:
        18px;

    font-weight:
        900;

    line-height:
        1;

    letter-spacing:
        .055em;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}


.vw-plate-hint {
    margin:
        1px
        0
        6px;

    color:
        #64748b;

    font-size:
        10px;

    font-weight:
        700;

    line-height:
        1.2;
}


.vw-plate-trigger-case {
    min-width:
        210px;

    padding:
        9px
        13px;
}


.vw-plate-trigger-case
.vw-plate-mini-registration {
    font-size:
        23px;
}


/*
 * State-specific accent.
 *
 * These are VehicleWatch accents only, not exact reproductions
 * of official number plate designs.
 */

.vw-plate-trigger[data-state="VIC"],
.vw-plate-large[data-state="VIC"] {
    --vw-plate-accent:
        #1e3a8a;
}


.vw-plate-trigger[data-state="NSW"],
.vw-plate-large[data-state="NSW"] {
    --vw-plate-accent:
        #2563eb;
}


.vw-plate-trigger[data-state="QLD"],
.vw-plate-large[data-state="QLD"] {
    --vw-plate-accent:
        #7f1d1d;
}


.vw-plate-trigger[data-state="SA"],
.vw-plate-large[data-state="SA"] {
    --vw-plate-accent:
        #b91c1c;
}


.vw-plate-trigger[data-state="WA"],
.vw-plate-large[data-state="WA"] {
    --vw-plate-accent:
        #1d4ed8;
}


.vw-plate-trigger[data-state="TAS"],
.vw-plate-large[data-state="TAS"] {
    --vw-plate-accent:
        #166534;
}


.vw-plate-trigger[data-state="ACT"],
.vw-plate-large[data-state="ACT"] {
    --vw-plate-accent:
        #0369a1;
}


.vw-plate-trigger[data-state="NT"],
.vw-plate-large[data-state="NT"] {
    --vw-plate-accent:
        #92400e;
}


/*
 * ----------------------------------------------------------
 * Full-screen plate viewer
 * ----------------------------------------------------------
 */

.vw-plate-viewer {
    position:
        fixed;

    inset:
        0;

    z-index:
        5000;

    display:
        none;

    align-items:
        center;

    justify-content:
        center;

    padding:
        18px;

    background:
        rgba(15,23,42,.76);

    -webkit-backdrop-filter:
        blur(5px);

    backdrop-filter:
        blur(5px);
}


.vw-plate-viewer.is-open {
    display:
        flex;
}


body.vw-plate-viewer-open {
    overflow:
        hidden !important;
}


.vw-plate-dialog {
    position:
        relative;

    width:
        min(
            720px,
            100%
        );

    max-height:
        calc(100vh - 36px);

    overflow-y:
        auto;

    -webkit-overflow-scrolling:
        touch;

    padding:
        26px;

    border-radius:
        16px;

    background:
        #ffffff;

    box-shadow:
        0 24px 70px
        rgba(0,0,0,.35);

    text-align:
        center;
}


.vw-plate-close {
    position:
        absolute;

    top:
        10px;

    right:
        10px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    width:
        42px;

    height:
        42px;

    padding:
        0;

    border:
        0;

    border-radius:
        50%;

    background:
        #f1f5f9;

    color:
        #334155;

    font-size:
        26px;

    font-weight:
        700;

    cursor:
        pointer;
}


.vw-plate-close:hover {
    background:
        #e2e8f0;
}


.vw-plate-dialog-label {
    margin-bottom:
        18px;

    color:
        #64748b;

    font-size:
        11px;

    font-weight:
        900;

    letter-spacing:
        .08em;

    text-transform:
        uppercase;
}


/*
 * Large plate itself.
 */

.vw-plate-large {
    --vw-plate-accent:
        #334155;

    position:
        relative;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    width:
        min(
            620px,
            94%
        );

    min-height:
        190px;

    margin:
        0
        auto;

    padding:
        22px
        24px;

    border:
        5px solid #111827;

    border-radius:
        14px;

    background:
        #ffffff;

    box-shadow:
        inset 0 10px 0
        var(--vw-plate-accent),
        inset 0 -3px 0
        #cbd5e1,
        0 8px 24px
        rgba(15,23,42,.16);
}


.vw-plate-large-state {
    margin-bottom:
        10px;

    color:
        var(--vw-plate-accent);

    font-size:
        16px;

    font-weight:
        900;

    letter-spacing:
        .16em;

    text-transform:
        uppercase;
}


.vw-plate-large-registration {
    max-width:
        100%;

    overflow:
        hidden;

    color:
        #050505;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        clamp(
            44px,
            10vw,
            82px
        );

    font-weight:
        900;

    line-height:
        1;

    letter-spacing:
        .08em;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}


.vw-plate-vehicle-title {
    margin-top:
        20px;

    color:
        #111827;

    font-size:
        20px;

    font-weight:
        900;
}


.vw-plate-compare-note {
    max-width:
        560px;

    margin:
        8px
        auto
        0;

    color:
        #64748b;

    font-size:
        12px;

    line-height:
        1.45;
}


.vw-plate-actions {
    display:
        grid;

    grid-template-columns:
        1fr
        1fr;

    gap:
        10px;

    max-width:
        560px;

    margin:
        20px
        auto
        0;
}


.vw-plate-action {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        48px;

    padding:
        10px
        14px;

    border-radius:
        9px;

    text-decoration:
        none;

    text-align:
        center;

    font-size:
        14px;

    font-weight:
        900;
}


.vw-plate-action-case {
    border:
        1px solid #cbd5e1;

    background:
        #f8fafc;

    color:
        #111827;
}


.vw-plate-action-sighting {
    border:
        1px solid #b91c1c;

    background:
        #dc2626;

    color:
        #ffffff;
}


.vw-plate-action-sighting:hover {
    background:
        #b91c1c;
}


/*
 * ----------------------------------------------------------
 * Mobile
 * ----------------------------------------------------------
 */

@media (max-width: 700px) {

    .vw-plate-trigger {
        min-height:
            42px;
    }


    .vw-plate-trigger-compact {
        min-width:
            170px;
    }


    .vw-plate-mini-registration {
        font-size:
            19px;
    }


    .vw-plate-hint {
        font-size:
            11px;
    }


    .vw-plate-viewer {
        align-items:
            flex-end;

        padding:
            0;
    }


    .vw-plate-dialog {
        width:
            100%;

        max-height:
            94dvh;

        padding:
            28px
            14px
            calc(
                20px +
                env(
                    safe-area-inset-bottom,
                    0px
                )
            );

        border-radius:
            18px
            18px
            0
            0;
    }


    .vw-plate-large {
        width:
            96%;

        min-height:
            170px;

        padding:
            20px
            12px;

        border-width:
            4px;
    }


    .vw-plate-large-state {
        margin-bottom:
            8px;

        font-size:
            14px;
    }


    .vw-plate-large-registration {
        font-size:
            clamp(
                46px,
                14vw,
                72px
            );

        letter-spacing:
            .055em;
    }


    .vw-plate-vehicle-title {
        font-size:
            18px;
    }


    .vw-plate-actions {
        grid-template-columns:
            1fr;

        gap:
            9px;
    }


    .vw-plate-action {
        min-height:
            52px;

        font-size:
            16px;
    }

}
