/*  Pre-permission camera dialog (js/camera-consent.js).

    Shown on a public shopping page, so it has to feel trustworthy and calm, not
    like a system alert. Uses the app's own tokens (tokens.css) — plum ground,
    zari gold accent, silk text — so it reads as part of the certificate, not a
    browser chrome popup. Styling only; the dialog's behaviour lives in the JS.
*/

.camconsent {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 4, 9, 0.62);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.camconsent.is-open {
    opacity: 1;
}

.camconsent__card {
    width: 100%;
    max-width: 360px;
    background: var(--silk-2, #FDF9F0);
    color: var(--ink, #2B1418);
    border-radius: 18px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 18px 48px rgba(15, 4, 9, 0.45);
    /* Rises and settles when the overlay opens. */
    transform: translateY(12px) scale(0.98);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.camconsent.is-open .camconsent__card {
    transform: translateY(0) scale(1);
}

.camconsent__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--maroon, #7A1F35);
    background: linear-gradient(160deg, #F7E6C6, #F0D98A);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.camconsent__icon svg {
    width: 28px;
    height: 28px;
}

.camconsent__title {
    margin: 0;
    font: 400 21px/1.25 var(--font-display, Georgia, serif);
    color: var(--plum, #24060F);
}

.camconsent__hi {
    margin: 3px 0 0;
    font-size: 14px;
    color: var(--maroon, #7A1F35);
}

.camconsent__body {
    margin: 12px 0 20px;
    font: 400 14.5px/1.55 var(--font-ui, system-ui, sans-serif);
    color: var(--ink, #2B1418);
}

.camconsent__actions {
    display: flex;
    gap: 10px;
}

.camconsent__actions button {
    flex: 1;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    font: 600 15px/1 var(--font-ui, system-ui, sans-serif);
    cursor: pointer;
    transition: transform 80ms ease, filter 140ms ease, background 140ms ease;
}

.camconsent__actions button:active {
    transform: translateY(1px);
}

.camconsent__allow {
    border: none;
    color: var(--plum, #24060F);
    background: linear-gradient(160deg, #F0D98A, #C9A227);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.4);
}

.camconsent__allow:hover {
    filter: brightness(1.04);
}

.camconsent__deny {
    border: 1px solid var(--line, #E7D9C4);
    color: var(--muted, #7A5A5F);
    background: transparent;
}

.camconsent__deny:hover {
    background: rgba(122, 90, 95, 0.08);
}

.camconsent__actions button:focus-visible,
.camconsent__deny:focus-visible {
    outline: 2px solid var(--maroon, #7A1F35);
    outline-offset: 2px;
}

.camconsent__reassure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 16px 0 0;
    font: 400 12px/1.4 var(--font-ui, system-ui, sans-serif);
    color: var(--muted, #7A5A5F);
}

.camconsent__reassure svg {
    width: 13px;
    height: 13px;
    flex: none;
    color: var(--ok, #1E7A4C);
}

@media (prefers-reduced-motion: reduce) {
    .camconsent,
    .camconsent__card {
        transition: none;
    }
    .camconsent__card {
        transform: none;
    }
}

/* notify() variants — a single-button informational popup (unsupported browser,
   camera failed to open) rather than the two-button Allow/Not now ask(). Same
   card shape, an amber or red icon in place of the gold camera/location one. */
.camconsent__icon--warn {
    color: var(--warn, #9A6A00);
    background: linear-gradient(160deg, #FBEBC7, #F3D98A);
    box-shadow: 0 4px 14px rgba(154, 106, 0, 0.3);
}

.camconsent__icon--danger {
    color: var(--danger, #A62B37);
    background: linear-gradient(160deg, #F6D9DC, #EEB7BD);
    box-shadow: 0 4px 14px rgba(166, 43, 55, 0.3);
}

.camconsent__actions--single {
    justify-content: center;
}

.camconsent__actions--single .camconsent__ok {
    flex: 0 1 200px;
    min-height: 48px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font: 600 15px/1 var(--font-ui, system-ui, sans-serif);
    color: var(--plum, #24060F);
    background: linear-gradient(160deg, #F0D98A, #C9A227);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.4);
    cursor: pointer;
    transition: transform 80ms ease, filter 140ms ease;
}

.camconsent__actions--single .camconsent__ok:hover {
    filter: brightness(1.04);
}

.camconsent__actions--single .camconsent__ok:active {
    transform: translateY(1px);
}

.camconsent__actions--single .camconsent__ok:focus-visible {
    outline: 2px solid var(--maroon, #7A1F35);
    outline-offset: 2px;
}
