/* QR Code Generator — page styles on top of apps.css */

.qr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.qr-colors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.qr-colors .field { margin-bottom: 0; }

/* ---------- Color swatch ---------- */
.swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 12px 0 6px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 11, 22, 0.75);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.swatch:hover { border-color: rgba(var(--signal-rgb), 0.5); }
.swatch:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(var(--signal-rgb), 0.15); }
.swatch input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
}
.swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; }
.swatch input[type="color"]::-moz-color-swatch { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; }
.swatch__hex { font-size: 0.9rem; color: var(--fg); letter-spacing: 0.02em; }

/* ---------- Preview ---------- */
.qr-preview { display: grid; gap: 0; }
.qr-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 340px;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background:
        radial-gradient(circle at 50% 40%, rgba(var(--signal-rgb), 0.08), transparent 65%),
        rgba(7, 11, 22, 0.5);
}
.qr-container { display: grid; place-items: center; max-width: 100%; }
.qr-container:empty { display: none; }
.qr-container img,
.qr-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: qr-in 0.35s var(--ease-out);
}
.qr-empty { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--fg-3); }
.qr-empty[hidden] { display: none; }
.qr-empty i { font-size: 3rem; color: var(--line); }
.qr-empty p { max-width: 26ch; font-size: 0.92rem; }

.qr-download { width: 100%; justify-content: center; margin-top: 16px; }
.qr-download:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes qr-in { from { opacity: 0; transform: scale(0.96); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .qr-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .qr-colors { grid-template-columns: minmax(0, 1fr); }
    .qr-stage { min-height: 260px; padding: 16px; }
}
