/* ── QR Code Generator — redesigned layout ─────────────────────────── */

/* Page heading */
.qr-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: var(--bb-primary, #4f46e5);
    margin-bottom: 0.25rem;
}
.qr-page-title i { margin-right: 0.4rem; }

.qr-page-sub {
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ── Content-type tab bar ──────────────────────────────────────────── */
.qr-type-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.4rem;
    margin-bottom: 1.25rem;
}

.qr-type-tab {
    flex: 1;
    min-width: 90px;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}
.qr-type-tab i { margin-right: 0.3rem; }

.qr-type-tab:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.qr-type-tab.active {
    background: #fff;
    color: var(--bb-primary, #4f46e5);
    box-shadow: 0 1px 6px rgba(0,0,0,0.10);
}

/* ── Main two-panel card ───────────────────────────────────────────── */
.qr-main-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Left column */
.qr-left {
    flex: 1 1 0;
    min-width: 0;
    padding: 1.75rem 1.75rem 1.75rem 1.75rem;
    border-right: 1px solid #f1f5f9;
}

/* Right column */
.qr-right {
    width: 260px;
    flex-shrink: 0;
    padding: 1.75rem;
}

/* ── Step headings ─────────────────────────────────────────────────── */
.qr-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.qr-step--inline { margin-bottom: 1.25rem; }

.qr-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bb-primary, #4f46e5);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qr-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.qr-divider {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 1.25rem 0;
}

/* ── Form fields ───────────────────────────────────────────────────── */
.qr-field-group {
    margin-bottom: 1rem;
}
.qr-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}
.qr-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.qr-input:focus {
    outline: none;
    border-color: var(--bb-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.10);
}

.qr-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
}

/* ── Design sub-tabs ───────────────────────────────────────────────── */
.qr-design-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 1rem;
}
.qr-design-tab {
    padding: 0.4rem 0.85rem;
    border: none;
    background: transparent;
    font-size: 0.84rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.qr-design-tab:hover { color: #475569; }
.qr-design-tab.active {
    color: var(--bb-primary, #4f46e5);
    border-bottom-color: var(--bb-primary, #4f46e5);
}

.qr-design-panel { animation: fadeIn 0.15s ease; }

/* ── Color swatches ────────────────────────────────────────────────── */
.qr-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.qr-color-swatch {
    width: 42px;
    height: 36px;
    padding: 2px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}
.qr-color-hex {
    font-size: 0.85rem;
    color: #64748b;
    font-family: monospace;
}

/* ── Logo upload ───────────────────────────────────────────────────── */
.qr-logo-upload-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.qr-logo-preview-box {
    width: 80px;
    height: 80px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.6rem;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8fafc;
}
.qr-logo-preview-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-logo-upload-info { flex: 1; }
.qr-logo-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0.35rem 0;
}

/* ── Radio rows ────────────────────────────────────────────────────── */
.qr-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.qr-radio-opt {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.88rem;
    color: #475569;
    cursor: pointer;
    padding: 0.35rem 0.7rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
}
.qr-radio-opt:has(input:checked) {
    border-color: var(--bb-primary, #4f46e5);
    background: #eef2ff;
    color: var(--bb-primary, #4f46e5);
    font-weight: 600;
}

/* ── Right panel: QR preview card ─────────────────────────────────── */
.qr-preview-card {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-canvas-wrap {
    position: relative;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    min-width: 180px;
    min-height: 180px;
}

#qrcode {
    display: inline-block;
    line-height: 0;
    border-radius: 6px;
    overflow: hidden;
}
#qrcode canvas,
#qrcode img {
    display: block;
    max-width: 100%;
    border-radius: 6px;
}

#logoPreviewInQR {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 0 6px rgba(0,0,0,0.18);
    overflow: hidden;
    display: none;
    z-index: 10;
}
#logoInQRPreview { width: 100%; height: 100%; object-fit: contain; }

/* ── Download buttons ──────────────────────────────────────────────── */
.qr-download-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}
.qr-dl-btn {
    flex: 1;
    min-width: 62px;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.qr-dl-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.qr-dl-btn--jpg { background: #22c55e; color: #fff; }
.qr-dl-btn--svg { background: #f59e0b; color: #fff; }
.qr-dl-btn--png { background: var(--bb-primary, #4f46e5); color: #fff; }

.qr-dl-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* ── QR-ready badge ────────────────────────────────────────────────── */
.qr-ready-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #22c55e;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: fadeInOut 2s ease-in-out forwards;
    z-index: 20;
}

@keyframes fadeInOut {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .qr-main-card {
        flex-direction: column;
    }
    .qr-left {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        padding: 1.25rem;
    }
    .qr-right {
        width: 100%;
        padding: 1.25rem;
    }
    .qr-preview-card { position: static; }
    .qr-grid-2 { grid-template-columns: 1fr; }
    .qr-type-tab { font-size: 0.8rem; padding: 0.45rem 0.6rem; }
}
