/* Page-specific styling for the QR generator. Kept in its own file so the
   shared style.css stays untouched. */

/* An author rule setting `display` beats the user-agent's `[hidden]` rule
   regardless of specificity, so elements carrying both -- the download button,
   which is .generate-btn and starts hidden -- would render anyway without
   this. */
[hidden] {
    display: none !important;
}

.qr-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

#qr-text {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--inset);
    color: inherit;
    resize: vertical;
}

#qr-text:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.qr-meter {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
}

#qr-kind {
    text-align: right;
    word-break: break-all;
}

.qr-options {
    display: grid;
    /* 140px lets all four controls sit on one row inside the card instead of
       stranding the last one; below ~600px they reflow to two, then one. */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.qr-option label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.qr-option select {
    width: 100%;
    padding: 0.45rem;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--inset);
    color: inherit;
}

.qr-status {
    margin: 1rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border-left: 3px solid var(--line-strong);
    background: var(--panel);
    font-size: 0.9rem;
}

.qr-status-error {
    border-left-color: #d14343;
}

.qr-status-warn {
    border-left-color: #d1a343;
}

.qr-result {
    margin-top: 1.4rem;
    text-align: center;
}

/* The symbol has to keep a light quiet zone to stay scannable, so it sits on
   its own white card rather than inheriting the page background in dark mode. */
.qr-canvas {
    display: inline-block;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    line-height: 0;
}

#qr-image {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.qr-meta {
    margin: 0.8rem 0;
    font-size: 0.85rem;
    opacity: 0.75;
}

.qr-download {
    display: inline-block;
    text-decoration: none;
}

.qr-notes ul {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.qr-notes li {
    margin-bottom: 0.4rem;
}

/* --- override unlock ------------------------------------------------------ */

.qr-unlock {
    margin-top: 1.1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}

.qr-unlock-hint {
    margin: 0 0 0.7rem;
    font-size: 0.85rem;
    opacity: 0.75;
    text-align: left;
}

.qr-unlock-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

#qr-code {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--inset);
    color: inherit;
}

#qr-unlock-btn {
    flex: 0 0 auto;
    min-width: 8rem;
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
}

.qr-badge {
    margin: -0.5rem 0 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b9e5f;
}
