/**
 * q-auth styles
 */

/* Design tokens */
.q-auth-verification-wrapper,
.q-auth-qr-login-section {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Verification Page */
.q-auth-verification-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #f0f2f5;
}

.q-auth-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 40px;
    max-width: 440px;
    width: 100%;
}

.q-auth-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

.q-auth-subtitle {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.q-auth-description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

/* Method Tabs */
.q-auth-method-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.q-auth-method-tab {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.q-auth-method-tab:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}

.q-auth-method-tab.active {
    border-color: #0073aa;
    background: #f0f9ff;
    color: #0073aa;
}

/* OTP input
 *
 * One real input sitting on top of six decorative cells. The input's
 * letter-spacing and padding are derived from the cell metrics so each digit
 * lands dead centre in its own cell, while the caret, the selection and
 * one-time-code autofill all behave completely natively.
 *
 * `1ch` is the advance width of "0" — a digit — and digits share one advance
 * width in every font, so the offset maths holds whichever family wins the
 * cascade. The stack below is here to guarantee tabular figures and a
 * consistent look in the field rather than to make the alignment work.
 */
.q-auth-otp {
    --otp-cell: 46px;
    --otp-gap: 8px;
    --otp-size: 22px;
    --otp-height: 56px;
    /* Left inset that centres the first digit in the first cell: half a cell
     * minus half of one digit's advance. */
    --otp-lead: calc((var(--otp-cell) - 1ch) / 2);
    position: relative;
    width: 100%;
    max-width: calc(6 * var(--otp-cell) + 5 * var(--otp-gap));
    height: var(--otp-height);
    margin: 0 auto 24px;
}

.q-auth-otp input {
    border-style: none !important;
}

/*
 * Scoped as ".q-auth-otp .q-auth-otp__field" rather than a bare class, and
 * that extra class is load-bearing.
 *
 * Hello Elementor's reset ships:
 *   input[type=text] { border:1px solid #666; border-radius:3px;
 *                      padding:.5rem 1rem; width:100% }
 * at (0,1,1), which outranks a single class at (0,1,0). Those theme paddings
 * were the real cause of the digits sitting off-centre: 16px of inherited
 * padding inside a width:100% box left far less content width than the six
 * spaced digits need, so the input scrolled its own text sideways and dragged
 * the whole code out of its cells as soon as the last digit landed. Winning
 * the cascade outright is cleaner than patching each symptom with
 * !important, so the border rule above is belt-and-braces only.
 */
.q-auth-otp .q-auth-otp__field {
    position: absolute;
    top: 0;
    left: 0;
    /* Above the cells so their borders never swallow a click or the caret. */
    z-index: 1;
    /*
     * content-box is deliberate. Six digits at (cell + gap) pitch measure
     * 6*cell + 6*gap, while the visible row measures 6*cell + 5*gap, so the
     * text needs exactly one gap more than the row provides — letter-spacing
     * adds a gap after the final digit too.
     *
     * Row plus one gap is enough in theory, but the surplus is padded out by a
     * further 1ch so subpixel rounding can never leave the text a fraction of a
     * pixel wider than the box. That matters because an input which outgrows
     * its content box scrolls its own text sideways, silently hiding the last
     * digits. The spare width and the left padding both land in empty space to
     * the right of the final cell, where nothing is drawn.
     */
    box-sizing: content-box;
    width: calc(100% + var(--otp-gap) + 1ch);
    height: var(--otp-height);
    margin: 0;
    padding: 0 0 0 var(--otp-lead);
    border: 0;
    background: transparent;
    color: #1e293b;
    font-family: 'SF Mono', 'Consolas', ui-monospace, 'Courier New', monospace;
    font-size: var(--otp-size);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: var(--otp-height);
    text-align: left;
    letter-spacing: calc(var(--otp-cell) + var(--otp-gap) - 1ch);
    caret-color: #0073aa;
    -webkit-appearance: none;
    appearance: none;
}

.q-auth-otp .q-auth-otp__field:focus {
    outline: none;
}

.q-auth-otp__cells {
    position: absolute;
    inset: 0;
    display: flex;
    gap: var(--otp-gap);
    /* Purely decorative: clicks and taps belong to the input underneath. */
    pointer-events: none;
}

.q-auth-otp__cell {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.q-auth-otp__cell.is-filled {
    border-color: #94a3b8;
}

/* The cell the next digit will land in. Driven by the value length, so this
 * is the only piece of state the JS has to mirror. */
.q-auth-otp .q-auth-otp__field:focus + .q-auth-otp__cells .q-auth-otp__cell.is-active {
    border-color: #0073aa;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.q-auth-otp.is-complete .q-auth-otp__cell {
    border-color: #0073aa;
}

/* Recovery Code Input */
/* Recovery Code Input
 *
 * Scoped under the panel for the same reason as the OTP field: a bare
 * .q-auth-recovery-input is (0,1,0) and loses to Hello Elementor's
 * input[type=text] at (0,1,1), so the theme's grey border, 3px radius and
 * .5rem 1rem padding were winning over the design tokens here too.
 */
.q-auth-method-panel .q-auth-recovery-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 2px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.15s ease;
    margin-bottom: 24px;
}

.q-auth-method-panel .q-auth-recovery-input:focus {
    outline: none;
    border-color: #0073aa;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* Verify Button */
.q-auth-verify-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #0073aa;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.q-auth-verify-btn:hover {
    background: #005a87;
}

.q-auth-verify-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* In-flight state.
 *
 * The label is blanked with colour rather than removed, so the button keeps
 * its width and does not jump as the spinner appears. Same technique the
 * enrollment buttons use, so the two do not read as different controls.
 */
.q-auth-verify-btn.is-loading {
    background: #0073aa;
    color: transparent;
}

.q-auth-verify-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: q-auth-spin 0.8s linear infinite;
}

@keyframes q-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Attempts remaining
 *
 * Only earns colour at two or fewer. A calm line at the start is information;
 * a red one from the first render is just alarm with no news attached.
 */
.q-auth-attempts {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    transition: color 0.2s ease;
}

.q-auth-attempts.is-warning {
    color: #dc2626;
    font-weight: 500;
}

/* Action Links
 *
 * The spacing lives on the button rather than the row, so a method with
 * nothing to resend — which hides the button outright — leaves no orphaned gap
 * where it used to be.
 */
.q-auth-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.q-auth-link-btn {
    margin-top: 16px;
    background: none;
    border: none;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.q-auth-link-btn:hover {
    color: #005a87;
}

.q-auth-link-btn:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    /* The countdown owns the button's text, so hovering must not imply it is
     * clickable again. */
    text-decoration: none;
}

/* Rejected-code shake
 *
 * Applied to the OTP group, not the card: the failure is about the code, and
 * shaking the whole card moves the tabs and the button too.
 */
@keyframes q-auth-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-8px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(2px);
    }
}

.q-auth-otp.is-shake {
    animation: q-auth-shake 0.4s ease-in-out;
}

/* Motion is a confirmation cue, never the only channel — every state it
 * conveys is already carried by colour, text and focus. */
@media (prefers-reduced-motion: reduce) {
    .q-auth-otp.is-shake {
        animation: none;
    }

    .q-auth-verify-btn.is-loading::after {
        animation-duration: 2s;
    }

    .q-auth-card,
    .q-auth-method-tab,
    .q-auth-verify-btn,
    .q-auth-otp__cell {
        transition: none;
    }
}

/* Messages */
.q-auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.q-auth-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.q-auth-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Footer */
.q-auth-footer {
    margin-top: 24px;
    text-align: center;
}

.q-auth-footer a {
    color: #64748b;
    font-size: 13px;
    text-decoration: none;
}

.q-auth-footer a:hover {
    color: #0073aa;
}

/* Verification page: small screens
 *
 * The OTP cells are a fixed pixel width because that width is what the
 * letter-spacing offset is derived from. Rather than let them overflow, scale
 * the whole group down and trim the card padding that surrounds it.
 */
@media screen and (max-width: 480px) {
    .q-auth-card {
        padding: 24px 20px;
    }

    .q-auth-otp {
        --otp-cell: 38px;
        --otp-gap: 6px;
        --otp-size: 19px;
        --otp-height: 50px;
    }
}

@media screen and (max-width: 360px) {
    .q-auth-otp {
        --otp-cell: 32px;
        --otp-gap: 5px;
        --otp-size: 17px;
        --otp-height: 46px;
    }
}

/* Session Badges */
.q-auth-current-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 12px;
    font-weight: 500;
}

.q-auth-active-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 12px;
    font-weight: 500;
}

/* Error text */
.q-auth-error {
    color: #dc2626;
    text-align: center;
    padding: 20px;
}

/* ===========================================================================
 * Admin — Settings dashboard (.q-auth-settings-wrap)
 *
 * A left sidebar of sections doubles as the setup checklist, with metric tiles
 * across the top and each settings group in its own panel. Scoped entirely to
 * the settings screen so no other admin or plugin markup is affected, and built
 * from the same Inter stack and 8px radius token as the frontend.
 * ======================================================================== */
.q-auth-settings-wrap {
    max-width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --q-auth-line: #e3e4e8;
    --q-auth-ink: #1d2327;
    --q-auth-muted: #646970;
    --q-auth-accent: #2271b1;
    /* wp-admin's fixed toolbar. Core sets it to 32px and raises it to 46px in
     * its own <=782px media query, so every sticky offset below tracks it. */
    --q-auth-toolbar: var(--wp-admin--admin-bar--height, 32px);
    /* Clearance for the sticky action bar, used by scroll offsets. */
    --q-auth-bar-gap: 88px;
}

.q-auth-settings-wrap h1,
.q-auth-settings-wrap h2,
.q-auth-settings-wrap p,
.q-auth-settings-wrap label,
.q-auth-settings-wrap td,
.q-auth-settings-wrap th,
.q-auth-settings-wrap button,
.q-auth-settings-wrap input,
.q-auth-settings-wrap .button,
.q-auth-settings-wrap .description {
    font-family: inherit;
}

/* Sticky action bar -------------------------------------------------------- */
.q-auth-dash__bar {
    position: sticky;
    top: var(--q-auth-toolbar);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    padding: 14px 20px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.q-auth-dash__bar h1 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.q-auth-dash__bar-text p {
    margin: 2px 0 0;
    color: var(--q-auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

.q-auth-dash__bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.q-auth-dash__save.button-primary {
    min-height: 36px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 600;
}

.q-auth-dash__dirty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8a6116;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.q-auth-dash__dirty[hidden] {
    display: none;
}

.q-auth-dash__dirty::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 8px;
    background: #dba617;
}

/* Layout ------------------------------------------------------------------- */
.q-auth-dash__layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* Sidebar ------------------------------------------------------------------ */
.q-auth-dash__nav {
    position: sticky;
    top: calc(var(--q-auth-toolbar) + var(--q-auth-bar-gap));
    padding: 14px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
}

.q-auth-dash__nav-heading {
    margin: 0 0 8px;
    padding: 0 8px;
    color: var(--q-auth-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.q-auth-dash__nav-heading:not(:first-child) {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f1;
}

.q-auth-dash__nav-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 2px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--q-auth-ink);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.q-auth-dash__nav-item:hover {
    background: #f6f7f7;
    color: var(--q-auth-ink);
    text-decoration: none;
}

.q-auth-dash__nav-item.is-active {
    background: #f0f6fc;
    box-shadow: inset 2px 0 0 var(--q-auth-accent);
}

.q-auth-dash__nav-text {
    display: block;
    min-width: 0;
}

.q-auth-dash__nav-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.q-auth-dash__nav-note {
    display: block;
    margin-top: 1px;
    color: var(--q-auth-muted);
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.q-auth-dash__nav-item.is-active .q-auth-dash__nav-note {
    color: #4a5568;
}

.q-auth-dash__nav-code {
    display: block;
    padding: 3px 10px;
}

.q-auth-dash__nav-code code {
    color: var(--q-auth-muted);
    font-size: 11px;
}

/* Status dots -------------------------------------------------------------- */
.q-auth-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 8px;
}

.q-auth-dot--success {
    background: #00a32a;
}

.q-auth-dot--warning {
    background: #dba617;
}

.q-auth-dot--error {
    background: #d63638;
}

.q-auth-dot--muted {
    background: #c3c4c7;
}

/* Metric tiles ------------------------------------------------------------- */
.q-auth-tiles {
    display: grid;
    /* auto-fit rather than a fixed count so adding a tile reflows cleanly. */
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.q-auth-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
}

.q-auth-tile__label {
    color: var(--q-auth-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.q-auth-tile__value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.q-auth-tile__max {
    color: #a7aaad;
    font-size: 14px;
    font-weight: 500;
}

.q-auth-tile__meter {
    display: block;
    height: 4px;
    border-radius: 8px;
    background: #f0f0f1;
    overflow: hidden;
}

.q-auth-tile__meter-fill {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: #c3c4c7;
}

.q-auth-tile--success .q-auth-tile__meter-fill {
    background: #00a32a;
}

.q-auth-tile--warning .q-auth-tile__meter-fill {
    background: #dba617;
}

.q-auth-tile--error .q-auth-tile__meter-fill {
    background: #d63638;
}

.q-auth-tile__meta {
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Panels ------------------------------------------------------------------- */
.q-auth-panel {
    margin-bottom: 20px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
    /* Anchor jumps have to clear the sticky action bar. */
    scroll-margin-top: calc(var(--q-auth-toolbar) + var(--q-auth-bar-gap) + 12px);
}

.q-auth-panel:focus {
    outline: none;
}

.q-auth-panel__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f1;
}

.q-auth-panel__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--q-auth-ink);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.q-auth-panel__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.q-auth-panel__heading h2 {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.q-auth-panel__heading p {
    margin: 2px 0 0;
    color: var(--q-auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Panels that report data rather than collect settings use an icon instead of
 * a step number, so the numbering still reads as a setup sequence. */
.q-auth-panel__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f0f6fc;
    color: var(--q-auth-accent);
}

.q-auth-panel__body {
    padding: 20px;
}

/* Fields ------------------------------------------------------------------- */
.q-auth-field {
    padding: 18px 0;
    border-top: 1px solid #f6f7f7;
}

.q-auth-field:first-child {
    padding-top: 0;
    border-top: 0;
}

.q-auth-field:last-child {
    padding-bottom: 0;
}

.q-auth-field__label {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.q-auth-field__hint {
    margin: 0 0 12px;
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.55;
}

.q-auth-field__hint:last-child {
    margin-bottom: 0;
}

.q-auth-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px 24px;
}

.q-auth-field-grid .q-auth-field {
    padding: 0;
    border-top: 0;
}

/* Inputs ------------------------------------------------------------------- */
.q-auth-input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 8px;
    background: #fff;
    color: var(--q-auth-ink);
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.q-auth-input:focus {
    border-color: var(--q-auth-accent);
    box-shadow: 0 0 0 1px var(--q-auth-accent);
    outline: 2px solid transparent;
}

.q-auth-input--wide {
    max-width: 460px;
}

.q-auth-field--narrow .q-auth-input-group {
    max-width: 200px;
}

.q-auth-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-auth-input-group__suffix {
    flex: 0 0 auto;
    color: var(--q-auth-muted);
    font-size: 13px;
}

/* Selectable tiles (roles + methods) ---------------------------------------- */
.q-auth-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

/* Roles carry only a short label and a user count, so they fit more per row
 * than the method cards, whose descriptions run longer. */
.q-auth-tile-grid--roles {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.q-auth-tile-check {
    display: block;
    margin: 0;
    cursor: pointer;
}

/* The real input stays in the accessibility tree and keeps form submission
 * working; the visible control is the box below it. */
.q-auth-tile-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.q-auth-tile-check__body {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.q-auth-tile-check:hover .q-auth-tile-check__body {
    border-color: #c3c4c7;
    background: #fbfbfc;
}

.q-auth-tile-check input:focus-visible + .q-auth-tile-check__body {
    border-color: var(--q-auth-accent);
    box-shadow: 0 0 0 2px #cfe2f3;
}

.q-auth-tile-check input:checked + .q-auth-tile-check__body {
    border-color: var(--q-auth-accent);
    background: #f0f6fc;
    box-shadow: inset 3px 0 0 var(--q-auth-accent);
}

.q-auth-tile-check__title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.q-auth-tile-check__meta {
    display: block;
    margin-top: 1px;
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Toggle switch ------------------------------------------------------------ */
.q-auth-switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    cursor: pointer;
}

.q-auth-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.q-auth-switch__track {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    margin-top: 2px;
    border-radius: 8px;
    background: #c3c4c7;
    transition: background 0.18s ease;
}

.q-auth-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}

.q-auth-switch input:checked + .q-auth-switch__track {
    background: var(--q-auth-accent);
}

.q-auth-switch input:checked + .q-auth-switch__track .q-auth-switch__thumb {
    transform: translateX(18px);
}

.q-auth-switch input:focus-visible + .q-auth-switch__track {
    box-shadow: 0 0 0 2px #cfe2f3;
}

.q-auth-switch__text {
    display: block;
    min-width: 0;
}

.q-auth-switch__title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.q-auth-switch__hint {
    display: block;
    margin-top: 1px;
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Chips + inline messages -------------------------------------------------- */
.q-auth-chip {
    flex: 0 0 auto;
    display: inline-block;
    max-width: 210px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}

.q-auth-chip--success {
    background: #edfaef;
    border-color: #b8e6c1;
    color: #007017;
}

.q-auth-chip--warning {
    background: #fcf9e8;
    border-color: #f0d9a0;
    color: #8a6116;
}

.q-auth-chip--error {
    background: #fcf0f1;
    border-color: #f0b8bd;
    color: #8a2424;
}

.q-auth-chip--muted {
    background: #f6f7f7;
    border-color: var(--q-auth-line);
    color: var(--q-auth-muted);
}

.q-auth-inline-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #f0b8bd;
    border-radius: 8px;
    background: #fcf0f1;
    color: #8a2424;
    font-size: 12px;
    line-height: 1.6;
}

.q-auth-setup-status {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    font-weight: 600;
}

.q-auth-status-success {
    color: #007017;
    font-weight: 600;
}

.q-auth-status-warning {
    color: #8a6116;
    font-weight: 600;
}

.q-auth-status-error {
    color: #8a2424;
    font-weight: 600;
}

/* Lists -------------------------------------------------------------------- */
.q-auth-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--q-auth-muted);
    font-size: 13px;
    line-height: 1.7;
}

.q-auth-steps li {
    margin-bottom: 2px;
}

.q-auth-method-list {
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    overflow: hidden;
}

.q-auth-method-list__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 11px 14px;
}

.q-auth-method-list__row + .q-auth-method-list__row {
    border-top: 1px solid #f6f7f7;
}

.q-auth-method-list__name {
    font-size: 13px;
    font-weight: 600;
}

.q-auth-method-list__desc {
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.55;
}

.q-auth-shortcode-list {
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    overflow: hidden;
}

.q-auth-shortcode-list__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 11px 14px;
    font-size: 12px;
    line-height: 1.55;
}

.q-auth-shortcode-list__row + .q-auth-shortcode-list__row {
    border-top: 1px solid #f6f7f7;
}

.q-auth-shortcode-list__row span {
    color: var(--q-auth-muted);
}

.q-auth-shortcode,
.q-auth-dash__nav-code code,
.q-auth-settings-wrap code {
    padding: 3px 8px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #f6f7f7;
    color: #2c3338;
    font-size: 12px;
}

.q-auth-settings-wrap pre,
.q-auth-settings-wrap code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Coverage bar ------------------------------------------------------------- */
.q-auth-progress__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.q-auth-progress__count {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.q-auth-progress__label {
    color: var(--q-auth-muted);
    font-size: 12px;
}

.q-auth-progress__track {
    height: 8px;
    border-radius: 8px;
    background: #f0f0f1;
    overflow: hidden;
}

.q-auth-progress__fill {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: #2271b1;
}

/* Sessions table ----------------------------------------------------------- */
.q-auth-sessions-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.q-auth-sessions-toolbar__count {
    color: var(--q-auth-muted);
    font-size: 12px;
}

.q-auth-input--search {
    max-width: 280px;
    min-height: 34px;
    font-size: 13px;
}

.q-auth-table-wrap {
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    overflow-x: auto;
}

.q-auth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.q-auth-table thead th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--q-auth-line);
    background: #f6f7f7;
    color: var(--q-auth-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.q-auth-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #f6f7f7;
    line-height: 1.5;
    vertical-align: top;
}

.q-auth-table tbody tr:last-child td {
    border-bottom: 0;
}

.q-auth-table tbody tr:hover {
    background: #fbfbfc;
}

.q-auth-table__user {
    display: block;
    color: var(--q-auth-ink);
    font-weight: 600;
    text-decoration: none;
}

.q-auth-table__user:hover {
    color: var(--q-auth-accent);
}

.q-auth-table__meta {
    display: block;
    color: var(--q-auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.q-auth-table code {
    font-size: 12px;
    white-space: nowrap;
}

.q-auth-table__empty {
    margin: 10px 0 0;
}

/* Empty state -------------------------------------------------------------- */
.q-auth-empty {
    padding: 32px 20px;
    border: 1px dashed var(--q-auth-line);
    border-radius: 8px;
    text-align: center;
}

.q-auth-empty__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #f6f7f7;
    color: #a7aaad;
}

.q-auth-empty__title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
}

.q-auth-empty__text {
    margin: 0;
    color: var(--q-auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.q-auth-btn {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
    color: var(--q-auth-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.q-auth-btn:hover {
    border-color: var(--q-auth-accent);
    background: #f0f6fc;
    color: var(--q-auth-accent);
    text-decoration: none;
}

.q-auth-btn--ghost {
    color: var(--q-auth-accent);
}

/* Footer ------------------------------------------------------------------- */
.q-auth-dash__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--q-auth-line);
    border-radius: 8px;
    background: #fff;
}

.q-auth-dash__foot p {
    margin: 0;
    color: var(--q-auth-muted);
    font-size: 12px;
}

.q-auth-dash__foot .button {
    min-height: 36px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 600;
}

/* Responsive --------------------------------------------------------------- */
@media screen and (max-width: 1200px) {
    .q-auth-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 960px) {
    .q-auth-dash__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    /* On narrow screens the sidebar becomes a horizontally scrollable strip
     * rather than a column, which keeps the checklist visible while scrolling. */
    .q-auth-dash__nav {
        position: static;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .q-auth-dash__nav-heading,
    .q-auth-dash__nav-code {
        display: none;
    }

    .q-auth-dash__nav-item {
        flex: 0 0 auto;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .q-auth-dash__nav-note {
        display: none;
    }
}

@media screen and (max-width: 782px) {
    /* The bar stops being sticky here, so anchor jumps no longer need the
     * large clearance it was reserving. */
    .q-auth-settings-wrap {
        --q-auth-bar-gap: 16px;
    }

    .q-auth-dash__bar {
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }

    .q-auth-dash__bar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .q-auth-panel__head {
        flex-wrap: wrap;
    }

    .q-auth-chip {
        max-width: 100%;
    }

    .q-auth-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .q-auth-tile-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .q-auth-input--wide {
        max-width: none;
    }

    .q-auth-dash__foot {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    /* Below this width six columns stop being readable, so each row becomes a
     * stacked card and the column header moves into the cell as a label. */
    .q-auth-table thead {
        display: none;
    }

    .q-auth-table,
    .q-auth-table tbody,
    .q-auth-table tr,
    .q-auth-table td {
        display: block;
        width: 100%;
    }

    .q-auth-table tbody tr {
        padding: 12px 14px;
        border-bottom: 1px solid #f6f7f7;
    }

    .q-auth-table tbody tr:last-child {
        border-bottom: 0;
    }

    .q-auth-table tbody td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        padding: 3px 0;
        border: 0;
        text-align: right;
    }

    .q-auth-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--q-auth-muted);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-align: left;
    }

    /* The stacked cells read as one block of text, not as three rows. */
    .q-auth-table__user,
    .q-auth-table__meta {
        display: inline;
    }

    .q-auth-sessions-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .q-auth-input--search {
        max-width: none;
    }
}

/* ---------------------------------------------------------------------------
 * Radius token enforcement
 *
 * Our buttons lose their radius to foreign CSS that ties or outranks us:
 *   - Hello Elementor's reset sets [type=button]{border-radius:3px} at
 *     specificity (0,1,0), which ties with a single class (.q-auth-btn) and
 *     is therefore decided purely by stylesheet load order.
 *   - wp-admin core styles .wp-core-ui .button at (0,2,0), outranking any
 *     single-class rule, and carries its own radius.
 *
 * Raising specificity further would be brittle across theme versions, so the
 * token is asserted with !important. Every selector is scoped to a container
 * this plugin owns, so nothing else in the theme or admin is affected.
 *
 * The inputs are a different case and deliberately not listed here. Hello
 * Elementor also sets input[type=text] at (0,1,1) — border, radius, padding and
 * width — and those paddings are load-bearing for the OTP cell alignment, not
 * just cosmetic. A near-miss there drags every digit out of its box, so the OTP
 * and recovery fields win the cascade properly by being scoped two classes deep
 * instead. See the notes above .q-auth-otp .q-auth-otp__field.
 * ------------------------------------------------------------------------ */
.q-auth-btn,
.q-auth-verification-wrapper button,
.q-auth-verification-wrapper .q-auth-verify-btn,
.q-auth-verification-wrapper .q-auth-method-tab,
.q-auth-qr-login-section button,
.q-auth-qr-login-section .q-auth-qr-generate-btn,
.q-auth-admin-profile button,
.q-auth-admin-profile .button,
.q-auth-settings-wrap button,
.q-auth-settings-wrap .button,
.q-auth-modal-content button,
.q-auth-modal-content .button {
    border-radius: 8px !important;
}

/* Textarea for email templates ----------------------------------------------- */
.q-auth-textarea-code {
    font-family: 'SF Mono', 'Consolas', monospace !important;
    line-height: 1.5;
    white-space: pre;
}
