/*
 * QR login: confirmation page on the phone (templates/confirm.html.twig) and the section for the device (templates/_tv.html.twig, qr-login.js).
 * To match your site, set --qr-accent, --qr-ink, --qr-text, --qr-text-soft, --qr-focus, --qr-line or --qr-font anywhere: on :root,
 * on an ancestor or on the elements themselves, in any stylesheet order. Without them the values after the comma apply, which first
 * look for the variables --gold, --ink, --text, --text-soft, --cyan and --blue of the surrounding site.
 * The rules below only read the --_qr-* variables, which are internal: :where() keeps this block at specificity zero.
 */
:where(.qrpage, .qrconfirm, .qrlogin) {
    --_qr-accent: var(--qr-accent, var(--gold, #ffd978));
    --_qr-ink: var(--qr-ink, var(--ink, #0b0818));
    --_qr-text: var(--qr-text, var(--text, #f2eefc));
    --_qr-text-soft: var(--qr-text-soft, var(--text-soft, #b9b0d6));
    --_qr-focus: var(--qr-focus, var(--cyan, #5ee7ff));
    --_qr-line: var(--qr-line, var(--blue, #6c8cff));
    --_qr-font: var(--qr-font, 'Chakra Petch', system-ui, sans-serif);
}
.qrpage { max-width: 720px; margin: 0 auto; padding: 24px 16px; color: var(--_qr-text); background: var(--_qr-ink); min-height: 100vh; box-sizing: border-box; }

/* Phone: confirmation page */
.qrconfirm__title { font-family: var(--_qr-font); }
.qrconfirm .qrconfirm__code {
    margin: 0;
    font-family: var(--_qr-font);
    font-weight: 700;
    font-size: clamp(56px, 22vw, 120px);
    line-height: 1;
    letter-spacing: 0.18em;
    color: var(--_qr-accent);
}
.qrconfirm .qrconfirm__device { font-size: 14px; line-height: 1.5; color: var(--_qr-text-soft); overflow-wrap: anywhere; }
.qrconfirm .qrconfirm__device span { font-family: ui-monospace, monospace; font-size: 13px; }
.qrconfirm .qrconfirm__warning { padding: 12px 14px; font-size: 15px; background: rgba(255, 217, 120, 0.1); border: 1px solid rgba(255, 217, 120, 0.4); }
.qrconfirm .qrconfirm__result { font-size: 18px; }
.qrconfirm__actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.qrconfirm__actions form { margin: 0; }
.qrconfirm__button { min-height: 52px; font: inherit; cursor: pointer; }
.qrconfirm__button--primary { padding: 0 28px; font-family: var(--_qr-font); font-weight: 700; letter-spacing: 0.12em; color: var(--_qr-ink); background: var(--_qr-accent); border: 0; }
.qrconfirm__button--link, .qrconfirm__link { padding: 0; color: var(--_qr-text); background: transparent; border-width: 0 0 2px; border-style: solid; border-color: var(--_qr-line); font-family: var(--_qr-font); font-weight: 600; font-size: 15px; letter-spacing: 0.12em; text-decoration: none; }
.qrconfirm__button:focus-visible, .qrconfirm__link:focus-visible { outline: 3px solid var(--_qr-focus); outline-offset: 3px; }

/* Device: section to include in the page the TV shows, for guests only */
.qrlogin { margin: 0 0 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.qrlogin[hidden], .qrlogin [hidden] { display: none; }
.qrlogin__title { margin: 0; font-family: var(--_qr-font); }
.qrlogin__lead { margin: 0; font-size: 16px; line-height: 1.5; color: var(--_qr-text); max-width: 680px; }
.qrlogin__button {
    min-height: 56px;
    padding: 0 28px;
    font-family: var(--_qr-font);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.12em;
    color: var(--_qr-ink);
    background: var(--_qr-accent);
    border: 0;
    cursor: pointer;
}
.qrlogin__button:disabled { opacity: 0.6; cursor: progress; }
.qrlogin__button:focus-visible, .qrlogin__cancel:focus-visible { outline: 3px solid var(--_qr-focus); outline-offset: 3px; }
.qrlogin__panel { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 20px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); }
/* The white area including the quiet zone is part of the image; the size follows the screen, so a camera can read it from the sofa. */
.qrlogin__image { display: block; width: clamp(220px, 34vmin, 420px); height: auto; background: #fff; }
.qrlogin__side { display: flex; flex-direction: column; gap: 10px; }
.qrlogin__label { margin: 0; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--_qr-accent); font-family: var(--_qr-font); }
.qrlogin__code { margin: 0; font-family: var(--_qr-font); font-weight: 700; font-size: clamp(48px, 10vmin, 110px); line-height: 1; letter-spacing: 0.18em; color: #fff; }
.qrlogin__status { margin: 0; font-size: 16px; line-height: 1.5; color: var(--_qr-text-soft); }
.qrlogin__cancel { align-self: flex-start; min-height: 48px; padding: 0 4px; font: inherit; font-family: var(--_qr-font); font-weight: 600; letter-spacing: 0.12em; color: var(--_qr-text); background: transparent; border: 0; border-bottom: 2px solid var(--_qr-line); cursor: pointer; }
