/* Buttons get border-box from the UA stylesheet by default, but anchors/list items/divs don't -
   without this, the same `width: 100% + padding` combo renders at a different actual size
   depending on which tag it's applied to (a real bug this caused: a settings row built on an <a>
   overflowed the viewport by exactly its own horizontal padding, while an identical row built on
   a <button> didn't). */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5M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em/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Showroom Camera app shell */

html, body {
    margin: 0;
    height: 100%;
    background: #0e0c15;
    color: #f0f2f5;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

button {
    font: inherit;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
}

    button.primary {
        background: #805af5;
        border-color: #805af5;
        color: #fff;
    }

    button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.camera-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.camera-viewport {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

    .camera-viewport video,
    .camera-viewport img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.stencil-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    pointer-events: none;
    fill: none;
    stroke: #ffffff;
    stroke-width: 4;
}

.camera-panel {
    padding: 0.75rem 1rem;
}

    .camera-panel label {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        font-size: 0.9rem;
    }

    .camera-panel select {
        padding: 0.5rem;
        border-radius: 8px;
    }

.camera-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
}

.camera-status,
.camera-error {
    text-align: center;
    padding: 0 1rem;
}

.camera-error {
    color: #ff6b6b;
}

.login-page {
    max-width: 360px;
    margin: 15vh auto 0;
    padding: 0 1.5rem;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    margin-top: 1.5rem;
}

    .login-form label {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .login-form input,
    .login-form textarea {
        padding: 0.6rem;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.05);
        color: inherit;
        font: inherit;
        resize: vertical;
    }

.login-error {
    color: #ff6b6b;
}

.dealer-status-bar {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.dealer-status-name {
    font-weight: 600;
}

.dealer-status-quota {
    opacity: 0.7;
}

.bottom-nav {
    display: flex;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding-bottom: env(safe-area-inset-bottom);
}

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        padding: 0.5rem 0;
        font-size: 0.7rem;
        color: inherit;
        text-decoration: none;
        opacity: 0.55;
    }

        .bottom-nav-item.active {
            opacity: 1;
            font-weight: 600;
            color: #805af5;
        }

    .bottom-nav-icon {
        font-size: 1.3rem;
        line-height: 1;
    }

.settings-page {
    padding: 1rem 1rem 2rem;
}

    .settings-page h1 {
        font-size: 1.4rem;
        margin: 0 0 1rem;
    }

.settings-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 1.25rem;
}

.settings-card-icon {
    font-size: 1.8rem;
}

.settings-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.settings-card-title {
    font-weight: 600;
}

.settings-card-detail {
    font-size: 0.8rem;
    opacity: 0.7;
}

.settings-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

    .settings-list li + li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

.settings-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
}

.settings-row-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.settings-row-label {
    flex: 1;
    min-width: 0;
}

.settings-row-detail {
    font-size: 0.8rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.settings-row-chevron {
    opacity: 0.5;
    flex-shrink: 0;
}

.settings-row-static {
    cursor: default;
}

.settings-row-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.settings-row-subtext {
    font-size: 0.75rem;
    opacity: 0.6;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .page-header h1 {
        margin: 0;
    }

.page-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.sort-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    background: rgba(128, 90, 245, 0.15);
    color: #b39dfa;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.angle-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

    .angle-list li + li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

.angle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
}

    .angle-row.angle-row-disabled {
        opacity: 0.45;
    }

.angle-checkbox {
    flex-shrink: 0;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #805af5;
}

.angle-reorder-controls {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 0.1rem;
}

    .angle-reorder-controls button {
        padding: 0.1rem 0.4rem;
        font-size: 0.6rem;
        border-radius: 6px;
    }

.angle-thumb {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

    .angle-thumb .stencil-overlay {
        opacity: 0.9;
    }

.angle-label {
    flex: 1;
    min-width: 0;
}

.angle-ai-badge {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #1c1a24;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.camera-step-indicator {
    opacity: 0.6;
    font-size: 0.85rem;
}

.camera-progress-track {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 0.75rem;
}

.camera-progress-bar {
    height: 100%;
    background: #805af5;
    transition: width 0.2s ease-in-out;
}

.camera-review-grid {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.camera-review-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.camera-review-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .camera-review-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.camera-review-missing {
    font-size: 0.75rem;
    opacity: 0.5;
}

.camera-review-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Cars: the picker on the home screen and a car's capture overview. */
.listing-search {
    width: 100%;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font: inherit;
}

.listing-plate {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.listing-intro {
    margin: 0 0 0.75rem;
    padding: 0;
    text-align: left;
    opacity: 0.7;
}

.listing-progress {
    font-size: 0.85rem;
    opacity: 0.7;
}

.listing-footer-link {
    margin-top: 1.5rem;
}

    .listing-footer-link a {
        color: inherit;
        opacity: 0.7;
    }

/* A link that looks like the app's buttons (the "Done" on a car's overview). */
.camera-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    padding: 0.6rem 1.1rem;
    text-decoration: none;
}
